Skip to content

Commit

Permalink
Change component of secure mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Super12138 committed Jan 13, 2024
1 parent 67a7eb8 commit ebadc52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,7 +54,7 @@ class SettingsActivity : BaseActivity() {
}
}

findPreference<SwitchPreference>("secure_mode")?.apply {
findPreference<SwitchPreferenceCompat>("secure_mode")?.apply {
setOnPreferenceChangeListener { preference, newValue ->
when (newValue) {
true -> activity?.window?.setFlags(
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
android:title="文本预测项目"
app:dialogMessage="多个项目请使用英文逗号隔开"
app:summary="自定义创建待办时文本框的预测项" />-->
<SwitchPreference
android:defaultValue="false"
android:key="secure_mode"
android:title="@string/secure_mode"
<SwitchPreferenceCompat
app:defaultValue="false"
app:key="secure_mode"
app:title="@string/secure_mode"
app:summary="@string/secure_mode_summary" />
</PreferenceCategory>

Expand Down

0 comments on commit ebadc52

Please sign in to comment.