From 22c92635b28f399c2301c1418da59fe490eeca69 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Thu, 23 Mar 2023 11:38:28 +0100 Subject: [PATCH] count only updatable tiles --- .../src/main/java/btools/routingapp/BInstallerActivity.java | 2 ++ .../src/main/java/btools/routingapp/BRouterView.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BInstallerActivity.java b/brouter-routing-app/src/main/java/btools/routingapp/BInstallerActivity.java index 6a70259..e1848d8 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BInstallerActivity.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BInstallerActivity.java @@ -162,8 +162,10 @@ public class BInstallerActivity extends AppCompatActivity { private void updateDownloadButton() { final ArrayList selectedTilesDownload = mBInstallerView.getSelectedTiles(MASK_SELECTED_RD5); + final ArrayList selectedTilesLastUpdate = mBInstallerView.getSelectedTiles(MASK_CURRENT_RD5); final ArrayList selectedTilesUpdate = mBInstallerView.getSelectedTiles(MASK_INSTALLED_RD5); final ArrayList selectedTilesDelete = mBInstallerView.getSelectedTiles(MASK_DELETED_RD5); + selectedTilesUpdate.removeAll(selectedTilesLastUpdate); mSummaryInfo.setText(""); if (selectedTilesDelete.size() > 0) { diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java index f243039..7e31474 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java @@ -9,7 +9,6 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import android.graphics.Rect; import android.util.Log; import android.view.View; import android.widget.Toast; @@ -258,6 +257,8 @@ public class BRouterView extends View { ConfigMigration.tryMigrateStorageConfig( new File(basedir + "/brouter/segments3/storageconfig.txt"), new File(basedir + "/brouter/segments4/storageconfig.txt")); + } else { + ServerConfig.checkForUpdate(getContext(), segmentDir, "segments4.zip"); } profileDir = new File(basedir, "brouter/profiles2"); assertDirectoryExists("profile directory", profileDir, "profiles2.zip", version); @@ -582,6 +583,7 @@ public class BRouterView extends View { } } + if (!path.exists() || !path.isDirectory()) throw new IllegalArgumentException(message + ": " + path + " cannot be created"); return false;