|
|
@@ -10,6 +10,7 @@ import android.content.ServiceConnection;
|
|
|
import android.content.SharedPreferences;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.IBinder;
|
|
|
+import android.text.InputType;
|
|
|
import android.util.Log;
|
|
|
import android.view.View;
|
|
|
import android.widget.TextView;
|
|
|
@@ -34,6 +35,7 @@ public class SettingsActivity extends AppCompatActivity {
|
|
|
public static final String PREF_NAME_SETTINGS = "settings";
|
|
|
public static final String PREF_KEY_SPACE_ID = "spaceId";
|
|
|
public static final String PREF_KEY_SPACE_NAME = "spaceName";
|
|
|
+ public static final String PREF_KEY_ROOM_NO = "roomNo";
|
|
|
public static final String PREF_KEY_ADDRESS = "address";
|
|
|
|
|
|
private SharedPreferences sharedPreferences;
|
|
|
@@ -70,7 +72,7 @@ public class SettingsActivity extends AppCompatActivity {
|
|
|
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
|
|
| View.SYSTEM_UI_FLAG_IMMERSIVE;
|
|
|
decorView.setSystemUiVisibility(uiOptions);
|
|
|
- tvTitle.setText("财富管理室" + sharedPreferences.getString(PREF_KEY_SPACE_NAME, ""));
|
|
|
+ tvTitle.setText(sharedPreferences.getString(PREF_KEY_SPACE_NAME, "") + sharedPreferences.getString(PREF_KEY_ROOM_NO, ""));
|
|
|
tvSpaceId.setText(sharedPreferences.getString(PREF_KEY_SPACE_ID, ""));
|
|
|
tvSpaceName.setText(sharedPreferences.getString(PREF_KEY_SPACE_NAME, ""));
|
|
|
tvAddress.setText(sharedPreferences.getString(PREF_KEY_ADDRESS, ""));
|
|
|
@@ -94,6 +96,7 @@ public class SettingsActivity extends AppCompatActivity {
|
|
|
new PromptBuilder(this)
|
|
|
.setTitle("输入空间ID")
|
|
|
.setValue(tvSpaceId.getText().toString())
|
|
|
+ .setInputType(InputType.TYPE_CLASS_TEXT)
|
|
|
.setPositiveButton("确定")
|
|
|
.setNegativeButton("取消")
|
|
|
.setPromptListener(new PromptBuilder.PromptListener() {
|
|
|
@@ -106,9 +109,15 @@ public class SettingsActivity extends AppCompatActivity {
|
|
|
public void onConfirm(DialogInterface dialog, String value) {
|
|
|
dialog.dismiss();
|
|
|
tvSpaceId.setText(value);
|
|
|
+ if (value.contains("-")) {
|
|
|
+ sharedPreferences.edit()
|
|
|
+ .putString(PREF_KEY_ROOM_NO, value.split("-")[value.split("-").length - 1])
|
|
|
+ .apply();
|
|
|
+ }
|
|
|
sharedPreferences.edit()
|
|
|
.putString(PREF_KEY_SPACE_ID, value)
|
|
|
.apply();
|
|
|
+ tvTitle.setText(sharedPreferences.getString(PREF_KEY_SPACE_NAME, "") + sharedPreferences.getString(PREF_KEY_ROOM_NO, ""));
|
|
|
}
|
|
|
})
|
|
|
.show();
|
|
|
@@ -130,11 +139,11 @@ public class SettingsActivity extends AppCompatActivity {
|
|
|
@Override
|
|
|
public void onConfirm(DialogInterface dialog, String value) {
|
|
|
dialog.dismiss();
|
|
|
- tvTitle.setText("财富管理室" + value);
|
|
|
tvSpaceName.setText(value);
|
|
|
sharedPreferences.edit()
|
|
|
.putString(PREF_KEY_SPACE_NAME, value)
|
|
|
.apply();
|
|
|
+ tvTitle.setText(sharedPreferences.getString(PREF_KEY_SPACE_NAME, "") + sharedPreferences.getString(PREF_KEY_ROOM_NO, ""));
|
|
|
}
|
|
|
})
|
|
|
.show();
|