简化设置,取消“转发时附加卡槽信息”和“转发时附加设备名称”开关,若需要直接修改“转发信息模板”
This commit is contained in:
parent
7fe607f5db
commit
8b5d626c40
|
@ -26,9 +26,6 @@ public class SettingActivity extends AppCompatActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_setting);
|
||||
|
||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_add_extra = findViewById(R.id.switch_add_extra);
|
||||
switchAddExtra(switch_add_extra);
|
||||
|
||||
EditText et_add_extra_device_mark = findViewById(R.id.et_add_extra_device_mark);
|
||||
editAddExtraDeviceMark(et_add_extra_device_mark);
|
||||
|
||||
|
@ -62,16 +59,6 @@ public class SettingActivity extends AppCompatActivity {
|
|||
editSmsTemplate(textSmsTemplate);
|
||||
}
|
||||
|
||||
//设置转发附加信息
|
||||
private void switchAddExtra(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_add_extra) {
|
||||
switch_add_extra.setChecked(SettingUtil.getSwitchAddExtra());
|
||||
|
||||
switch_add_extra.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
SettingUtil.switchAddExtra(isChecked);
|
||||
Log.d(TAG, "onCheckedChanged:" + isChecked);
|
||||
});
|
||||
}
|
||||
|
||||
//设置转发来电
|
||||
private void switchEnablePhone(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_phone) {
|
||||
switch_enable_phone.setChecked(SettingUtil.getSwitchEnablePhone());
|
||||
|
@ -82,7 +69,7 @@ public class SettingActivity extends AppCompatActivity {
|
|||
});
|
||||
}
|
||||
|
||||
//设置转发附加信息deviceMark
|
||||
//设置设备名称
|
||||
private void editAddExtraDeviceMark(final EditText et_add_extra_device_mark) {
|
||||
et_add_extra_device_mark.setText(SettingUtil.getAddExtraDeviceMark());
|
||||
|
||||
|
@ -104,7 +91,7 @@ public class SettingActivity extends AppCompatActivity {
|
|||
});
|
||||
}
|
||||
|
||||
//设置转发附加信息deviceMark
|
||||
//设置SIM1备注
|
||||
private void editAddExtraSim1(final EditText et_add_extra_sim1) {
|
||||
et_add_extra_sim1.setText(SettingUtil.getAddExtraSim1());
|
||||
|
||||
|
@ -126,7 +113,7 @@ public class SettingActivity extends AppCompatActivity {
|
|||
});
|
||||
}
|
||||
|
||||
//设置转发附加信息deviceMark
|
||||
//设置SIM2备注
|
||||
private void editAddExtraSim2(final EditText et_add_extra_sim2) {
|
||||
et_add_extra_sim2.setText(SettingUtil.getAddExtraSim2());
|
||||
|
||||
|
@ -218,7 +205,7 @@ public class SettingActivity extends AppCompatActivity {
|
|||
});
|
||||
}
|
||||
|
||||
//设置转发附加信息deviceMark
|
||||
//设置转发信息模版
|
||||
private void editSmsTemplate(final EditText textSmsTemplate) {
|
||||
textSmsTemplate.setText(SettingUtil.getSmsTemplate());
|
||||
|
||||
|
@ -268,9 +255,6 @@ public class SettingActivity extends AppCompatActivity {
|
|||
|
||||
//恢复初始化配置
|
||||
public void initSetting(View view) {
|
||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_add_extra = findViewById(R.id.switch_add_extra);
|
||||
switch_add_extra.setChecked(false);
|
||||
switchAddExtra(switch_add_extra);
|
||||
|
||||
EditText et_add_extra_device_mark = findViewById(R.id.et_add_extra_device_mark);
|
||||
et_add_extra_device_mark.setText("");
|
||||
|
|
|
@ -271,61 +271,12 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="@android:color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:text="@string/add_extra"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch_add_extra"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:gravity="end"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:text="@string/add_device_name"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Switch
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:gravity="end"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:padding="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -335,15 +286,14 @@
|
|||
|
||||
<Switch
|
||||
android:id="@+id/switch_enable_phone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:checked="true"
|
||||
android:layout_weight="3"
|
||||
android:gravity="end"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
Loading…
Reference in New Issue