Skip to content

Commit

Permalink
settings: new default server planet learning (fixes #2643) (#2645)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Oct 30, 2023
1 parent 4eeb88e commit 03c40dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 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 1122
versionName "0.11.22"
versionCode 1123
versionName "0.11.23"
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 @@ -274,7 +274,7 @@ public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
jsonDoc = JsonUtils.getJsonObject("doc", jsonDoc);
String id = JsonUtils.getString("_id", jsonDoc);
RealmCommunity community = realm1.createObject(RealmCommunity.class, id);
if (JsonUtils.getString("name", jsonDoc).equals("vi")) {
if (JsonUtils.getString("name", jsonDoc).equals("learning")) {
community.setWeight(0);
}
community.setLocalDomain(JsonUtils.getString("localDomain", jsonDoc));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -733,6 +735,7 @@ public void onNothingSelected(AdapterView<?> adapterView) {
settings.edit().putBoolean("switchCloudUrl", b).commit();
dialogServerUrlBinding.spnCloud.setVisibility(b ? View.VISIBLE : View.GONE);
setUrlAndPin(dialogServerUrlBinding.switchServerUrl.isChecked());
Log.d("checked", String.valueOf(dialogServerUrlBinding.switchServerUrl.isChecked()));
});
serverUrl.addTextChangedListener(new MyTextWatcher(serverUrl));
dialogServerUrlBinding.deviceName.setText(getCustomDeviceName());
Expand Down Expand Up @@ -760,7 +763,8 @@ private void onChangeServerUrl() {
serverUrl.setText(selected.getLocalDomain());
protocol_checkin.check(R.id.radio_https);
settings.getString("serverProtocol", "https://");
serverPassword.setText(selected.getWeight() == 0 ? "0660" : "");
serverPassword.setTransformationMethod(PasswordTransformationMethod.getInstance());
serverPassword.setText(selected.getWeight() == 0 ? "1983" : "");
serverPassword.setEnabled(selected.getWeight() != 0);
}
} finally {
Expand All @@ -778,8 +782,10 @@ private void setUrlAndPin(boolean checked) {
serverPassword.setText(settings.getString("serverPin", ""));
protocol_checkin.check(TextUtils.equals(settings.getString("serverProtocol", ""), "http://") ? R.id.radio_http : R.id.radio_https);
serverUrlProtocol.setText(settings.getString("serverProtocol", ""));
serverPassword.setTransformationMethod(null);
}
serverUrl.setEnabled(!checked);
serverPassword.setEnabled(!checked);
serverPassword.clearFocus();
serverUrl.clearFocus();
protocol_checkin.setEnabled(!checked);
Expand Down

0 comments on commit 03c40dd

Please sign in to comment.