From ebadc524b67a69c60d50fbc902921cc33d5c76df Mon Sep 17 00:00:00 2001 From: Super12138 <70494801+Super12138@users.noreply.github.com> Date: Sat, 13 Jan 2024 15:18:01 +0800 Subject: [PATCH] Change component of secure mode --- .../cn/super12138/todo/views/settings/SettingsActivity.kt | 4 ++-- app/src/main/res/xml/preferences.xml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/cn/super12138/todo/views/settings/SettingsActivity.kt b/app/src/main/kotlin/cn/super12138/todo/views/settings/SettingsActivity.kt index ced4ac6..c54ef08 100644 --- a/app/src/main/kotlin/cn/super12138/todo/views/settings/SettingsActivity.kt +++ b/app/src/main/kotlin/cn/super12138/todo/views/settings/SettingsActivity.kt @@ -6,7 +6,7 @@ import android.view.WindowManager import androidx.appcompat.app.AppCompatDelegate import androidx.preference.ListPreference import androidx.preference.PreferenceFragmentCompat -import androidx.preference.SwitchPreference +import androidx.preference.SwitchPreferenceCompat import cn.super12138.todo.R import cn.super12138.todo.databinding.ActivitySettingsBinding import cn.super12138.todo.views.BaseActivity @@ -54,7 +54,7 @@ class SettingsActivity : BaseActivity() { } } - findPreference("secure_mode")?.apply { + findPreference("secure_mode")?.apply { setOnPreferenceChangeListener { preference, newValue -> when (newValue) { true -> activity?.window?.setFlags( diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 656079b..f4e4ebc 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -19,10 +19,10 @@ android:title="文本预测项目" app:dialogMessage="多个项目请使用英文逗号隔开" app:summary="自定义创建待办时文本框的预测项" />--> -