Skip to content

Commit

Permalink
Merge pull request #516 from afischerdev/app-update
Browse files Browse the repository at this point in the history
App update: Show only updatable tiles
  • Loading branch information
afischerdev committed Mar 28, 2023
2 parents 88977cc + 22c9263 commit 0b8a7fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions brouter-routing-app/src/main/AndroidManifest.xml
Expand Up @@ -17,6 +17,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:preserveLegacyExternalStorage="true"
android:hasFragileUserData="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/Theme.App">
<activity
Expand Down
Expand Up @@ -162,8 +162,10 @@ private String getSegmentsPlural(int count) {

private void updateDownloadButton() {
final ArrayList<Integer> selectedTilesDownload = mBInstallerView.getSelectedTiles(MASK_SELECTED_RD5);
final ArrayList<Integer> selectedTilesLastUpdate = mBInstallerView.getSelectedTiles(MASK_CURRENT_RD5);
final ArrayList<Integer> selectedTilesUpdate = mBInstallerView.getSelectedTiles(MASK_INSTALLED_RD5);
final ArrayList<Integer> selectedTilesDelete = mBInstallerView.getSelectedTiles(MASK_DELETED_RD5);
selectedTilesUpdate.removeAll(selectedTilesLastUpdate);
mSummaryInfo.setText("");

if (selectedTilesDelete.size() > 0) {
Expand Down
Expand Up @@ -9,7 +9,6 @@
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;
Expand Down Expand Up @@ -258,6 +257,8 @@ private void populateBasedir(String basedir) {
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);
Expand Down Expand Up @@ -582,6 +583,7 @@ private boolean assertDirectoryExists(String message, File path, String assetZip

}
}

if (!path.exists() || !path.isDirectory())
throw new IllegalArgumentException(message + ": " + path + " cannot be created");
return false;
Expand Down

0 comments on commit 0b8a7fd

Please sign in to comment.