diff --git a/app/build.gradle b/app/build.gradle index b8c78c402d..7176cda21f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 diff --git a/app/src/main/java/org/ole/planet/myplanet/datamanager/Service.java b/app/src/main/java/org/ole/planet/myplanet/datamanager/Service.java index e51bd00201..4d6962f715 100644 --- a/app/src/main/java/org/ole/planet/myplanet/datamanager/Service.java +++ b/app/src/main/java/org/ole/planet/myplanet/datamanager/Service.java @@ -274,7 +274,7 @@ public void onResponse(Call call, Response 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)); diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.java b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.java index 104c12ec01..6d33dff859 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.java +++ b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.java @@ -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; @@ -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()); @@ -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 { @@ -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);