Merge pull request #516 from afischerdev/app-update

App update: Show only updatable tiles
This commit is contained in:
afischerdev 2023-03-28 09:40:53 +02:00 committed by GitHub
commit 0b8a7fda39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -17,6 +17,7 @@
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:preserveLegacyExternalStorage="true" android:preserveLegacyExternalStorage="true"
android:hasFragileUserData="true"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/Theme.App"> android:theme="@style/Theme.App">
<activity <activity

View file

@ -162,8 +162,10 @@ public class BInstallerActivity extends AppCompatActivity {
private void updateDownloadButton() { private void updateDownloadButton() {
final ArrayList<Integer> selectedTilesDownload = mBInstallerView.getSelectedTiles(MASK_SELECTED_RD5); 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> selectedTilesUpdate = mBInstallerView.getSelectedTiles(MASK_INSTALLED_RD5);
final ArrayList<Integer> selectedTilesDelete = mBInstallerView.getSelectedTiles(MASK_DELETED_RD5); final ArrayList<Integer> selectedTilesDelete = mBInstallerView.getSelectedTiles(MASK_DELETED_RD5);
selectedTilesUpdate.removeAll(selectedTilesLastUpdate);
mSummaryInfo.setText(""); mSummaryInfo.setText("");
if (selectedTilesDelete.size() > 0) { if (selectedTilesDelete.size() > 0) {

View file

@ -9,7 +9,6 @@ import android.graphics.Bitmap;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.Rect;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.Toast; import android.widget.Toast;
@ -258,6 +257,8 @@ public class BRouterView extends View {
ConfigMigration.tryMigrateStorageConfig( ConfigMigration.tryMigrateStorageConfig(
new File(basedir + "/brouter/segments3/storageconfig.txt"), new File(basedir + "/brouter/segments3/storageconfig.txt"),
new File(basedir + "/brouter/segments4/storageconfig.txt")); new File(basedir + "/brouter/segments4/storageconfig.txt"));
} else {
ServerConfig.checkForUpdate(getContext(), segmentDir, "segments4.zip");
} }
profileDir = new File(basedir, "brouter/profiles2"); profileDir = new File(basedir, "brouter/profiles2");
assertDirectoryExists("profile directory", profileDir, "profiles2.zip", version); assertDirectoryExists("profile directory", profileDir, "profiles2.zip", version);
@ -582,6 +583,7 @@ public class BRouterView extends View {
} }
} }
if (!path.exists() || !path.isDirectory()) if (!path.exists() || !path.isDirectory())
throw new IllegalArgumentException(message + ": " + path + " cannot be created"); throw new IllegalArgumentException(message + ": " + path + " cannot be created");
return false; return false;