Skip to content

Commit

Permalink
settings: more cloud switch stability (fixes #2722) (#2723)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Nov 22, 2023
1 parent fde9cde commit 9c2f340
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1154
versionName "0.11.54"
versionCode 1155
versionName "0.11.55"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,16 @@ public void onNothingSelected(AdapterView<?> adapterView) {
}
});
dialogServerUrlBinding.switchServerUrl.setOnCheckedChangeListener((compoundBtn, b) -> {
settings.edit().putBoolean("switchCloudUrl", b).commit();
dialogServerUrlBinding.spnCloud.setVisibility(b ? View.VISIBLE : View.GONE);
setUrlAndPin(dialogServerUrlBinding.switchServerUrl.isChecked());
if (b) {
settings.edit().putBoolean("switchCloudUrl", true).commit();
dialogServerUrlBinding.spnCloud.setVisibility(View.VISIBLE);
setUrlAndPin(dialogServerUrlBinding.switchServerUrl.isChecked());
} else {
settings.edit().putBoolean("switchCloudUrl", false).commit();
dialogServerUrlBinding.spnCloud.setVisibility(View.GONE);
setUrlAndPin(!dialogServerUrlBinding.switchServerUrl.isChecked());
}

});
serverUrl.addTextChangedListener(new MyTextWatcher(serverUrl));
dialogServerUrlBinding.switchServerUrl.setChecked(settings.getBoolean("switchCloudUrl", false));
Expand Down

0 comments on commit 9c2f340

Please sign in to comment.