|
@@ -9,6 +9,7 @@ import android.view.View;
|
|
import android.widget.AdapterView;
|
|
import android.widget.AdapterView;
|
|
import android.widget.ArrayAdapter;
|
|
import android.widget.ArrayAdapter;
|
|
import android.widget.Button;
|
|
import android.widget.Button;
|
|
|
|
+import android.widget.ImageView;
|
|
import android.widget.RadioButton;
|
|
import android.widget.RadioButton;
|
|
import android.widget.RadioGroup;
|
|
import android.widget.RadioGroup;
|
|
import android.widget.Spinner;
|
|
import android.widget.Spinner;
|
|
@@ -38,6 +39,8 @@ import com.wdkl.ncs.android.middleware.tcp.dto.TcpCallback;
|
|
import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel;
|
|
import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel;
|
|
import com.wdkl.ncs.android.middleware.utils.CommonUtils;
|
|
import com.wdkl.ncs.android.middleware.utils.CommonUtils;
|
|
|
|
|
|
|
|
+import java.util.Locale;
|
|
|
|
+
|
|
public class WatchUserSettingActivity extends Activity {
|
|
public class WatchUserSettingActivity extends Activity {
|
|
private static final String TAG = WatchUserSettingActivity.class.getSimpleName();
|
|
private static final String TAG = WatchUserSettingActivity.class.getSimpleName();
|
|
|
|
|
|
@@ -52,6 +55,10 @@ public class WatchUserSettingActivity extends Activity {
|
|
private RadioGroup callTransGroup;
|
|
private RadioGroup callTransGroup;
|
|
private RadioButton transferOn, transferOff;
|
|
private RadioButton transferOn, transferOff;
|
|
|
|
|
|
|
|
+ private TextView tvTtsRate;
|
|
|
|
+ private ImageView ttsRateDecrease, ttsRateIncrease;
|
|
|
|
+ private int ttsRate;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
//切换语言
|
|
//切换语言
|
|
@@ -86,6 +93,41 @@ public class WatchUserSettingActivity extends Activity {
|
|
transferOn = findViewById(R.id.rb_call_transfer_on);
|
|
transferOn = findViewById(R.id.rb_call_transfer_on);
|
|
transferOff = findViewById(R.id.rb_call_transfer_off);
|
|
transferOff = findViewById(R.id.rb_call_transfer_off);
|
|
|
|
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+
|
|
TextView partNameView = findViewById(R.id.part_name);
|
|
TextView partNameView = findViewById(R.id.part_name);
|
|
partNameView.setText(Constants.Companion.getPartName());
|
|
partNameView.setText(Constants.Companion.getPartName());
|
|
|
|
|