mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
修复转发未接来电开关失效问题
This commit is contained in:
parent
8fed647c8d
commit
7fe607f5db
@ -55,6 +55,9 @@ public class SettingActivity extends AppCompatActivity {
|
||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_sms_template = findViewById(R.id.switch_sms_template);
|
||||
switchSmsTemplate(switch_sms_template);
|
||||
|
||||
@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_phone = findViewById(R.id.switch_enable_phone);
|
||||
switchEnablePhone(switch_enable_phone);
|
||||
|
||||
EditText textSmsTemplate = findViewById(R.id.text_sms_template);
|
||||
editSmsTemplate(textSmsTemplate);
|
||||
}
|
||||
@ -69,6 +72,16 @@ public class SettingActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
//设置转发来电
|
||||
private void switchEnablePhone(@SuppressLint("UseSwitchCompatOrMaterialCode") Switch switch_enable_phone) {
|
||||
switch_enable_phone.setChecked(SettingUtil.getSwitchEnablePhone());
|
||||
|
||||
switch_enable_phone.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
SettingUtil.switchEnablePhone(isChecked);
|
||||
Log.d(TAG, "onCheckedChanged:" + isChecked);
|
||||
});
|
||||
}
|
||||
|
||||
//设置转发附加信息deviceMark
|
||||
private void editAddExtraDeviceMark(final EditText et_add_extra_device_mark) {
|
||||
et_add_extra_device_mark.setText(SettingUtil.getAddExtraDeviceMark());
|
||||
|
@ -334,6 +334,7 @@
|
||||
tools:ignore="RelativeOverlap" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch_enable_phone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
|
Loading…
x
Reference in New Issue
Block a user