|
@@ -9,6 +9,7 @@ import android.view.View;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.ArrayAdapter;
|
|
|
import android.widget.Button;
|
|
|
+import android.widget.ImageView;
|
|
|
import android.widget.RadioButton;
|
|
|
import android.widget.RadioGroup;
|
|
|
import android.widget.Spinner;
|
|
@@ -49,6 +50,12 @@ public class WatchUserSettingActivity extends Activity {
|
|
|
private RadioButton callYes, callNo;
|
|
|
private RadioGroup imChannelGroup;
|
|
|
private RadioButton imChannelYes, imChannelNo;
|
|
|
+ private RadioGroup callTransGroup;
|
|
|
+ private RadioButton transferOn, transferOff;
|
|
|
+
|
|
|
+ private TextView tvTtsRate;
|
|
|
+ private ImageView ttsRateDecrease, ttsRateIncrease;
|
|
|
+ private int ttsRate;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -80,6 +87,10 @@ public class WatchUserSettingActivity extends Activity {
|
|
|
imChannelYes = findViewById(R.id.rb_im_channel_yes);
|
|
|
imChannelNo = findViewById(R.id.rb_im_channel_no);
|
|
|
|
|
|
+ callTransGroup = findViewById(R.id.group_call_transfer);
|
|
|
+ transferOn = findViewById(R.id.rb_call_transfer_on);
|
|
|
+ transferOff = findViewById(R.id.rb_call_transfer_off);
|
|
|
+
|
|
|
tvAppVersion.setText(CommonUtils.getAppVersionName(BaseApplication.appContext) + "_" + BuildConfig.BUILD_TIME);
|
|
|
tvDeviceId.setText("" + Constants.Companion.getDeviceId());
|
|
|
tvDeviceImei.setText(Constants.Companion.getImei());
|
|
@@ -88,6 +99,42 @@ public class WatchUserSettingActivity extends Activity {
|
|
|
String type = getString(R.string.phone_type, Constants.Companion.getPhoneType(), Constants.Companion.getBedPhoneType(), Constants.Companion.getNursePhoneType());
|
|
|
tvPhoneType.setText(type);
|
|
|
|
|
|
+ ttsRate = SettingConfig.getTtsSpeechRate(BaseApplication.appContext);
|
|
|
+ tvTtsRate = findViewById(R.id.tv_speech_rate_value);
|
|
|
+ tvTtsRate.setText("" + ttsRate);
|
|
|
+ ttsRateIncrease = findViewById(R.id.speech_rate_increase);
|
|
|
+ ttsRateDecrease = findViewById(R.id.speech_rate_decrease);
|
|
|
+ ttsRateIncrease.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (ttsRate < 10) {
|
|
|
+ ttsRate++;
|
|
|
+ } else {
|
|
|
+ ttsRate = 10;
|
|
|
+ }
|
|
|
+ tvTtsRate.setText("" + ttsRate);
|
|
|
+ SettingConfig.setTtsSpeechRate(BaseApplication.appContext, ttsRate);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ttsRateDecrease.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (ttsRate > 1) {
|
|
|
+ ttsRate--;
|
|
|
+ } else {
|
|
|
+ ttsRate = 1;
|
|
|
+ }
|
|
|
+ tvTtsRate.setText("" + ttsRate);
|
|
|
+ SettingConfig.setTtsSpeechRate(BaseApplication.appContext, ttsRate);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ if ("com.google.android.tts".equalsIgnoreCase(SpeechUtil.getInstance().getSpeechEngine())) {
|
|
|
+ findViewById(R.id.ll_speech_rate).setVisibility(View.VISIBLE);
|
|
|
+ findViewById(R.id.tv_speech_rate).setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+
|
|
|
if (SettingConfig.getVoiceCallType(BaseApplication.appContext) == SettingConfig.PHONE_CALL) {
|
|
|
callYes.setChecked(true);
|
|
|
} else {
|
|
@@ -100,6 +147,12 @@ public class WatchUserSettingActivity extends Activity {
|
|
|
imChannelNo.setChecked(true);
|
|
|
}
|
|
|
|
|
|
+ if (SettingConfig.getCallTransfer(BaseApplication.appContext)) {
|
|
|
+ transferOn.setChecked(true);
|
|
|
+ } else {
|
|
|
+ transferOff.setChecked(true);
|
|
|
+ }
|
|
|
+
|
|
|
int mode = SettingConfig.getLanguageMode(BaseApplication.appContext);
|
|
|
RadioGroup languageMode = findViewById(R.id.group_language_mode);
|
|
|
RadioButton languageYes = findViewById(R.id.rb_language_yes);
|
|
@@ -232,6 +285,17 @@ public class WatchUserSettingActivity extends Activity {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ callTransGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
|
|
+ @Override
|
|
|
+ public void onCheckedChanged(RadioGroup group, int checkedId) {
|
|
|
+ if (checkedId == R.id.rb_call_transfer_on) {
|
|
|
+ SettingConfig.setCallTransfer(BaseApplication.appContext, true);
|
|
|
+ } else {
|
|
|
+ SettingConfig.setCallTransfer(BaseApplication.appContext, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
Button update = findViewById(R.id.btn_update_contact);
|
|
|
update.setOnClickListener(new View.OnClickListener() {
|