Get rid of custom switch preference

This commit is contained in:
Torsten Grote
2021-01-22 15:45:32 -03:00
parent 484817db08
commit f0685c4a43
6 changed files with 14 additions and 32 deletions

View File

@@ -44,7 +44,6 @@
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/text_size_medium"
android:widgetLayout="@layout/preference_switch_compat"
tools:checked="true"
tools:text="@string/tor_enable_title" />

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!-- Needed for SwitchPreference on Android 4 (API < 21)-->
<androidx.appcompat.widget.SwitchCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/switch_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
tools:targetApi="n" />

View File

@@ -2,32 +2,29 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<SwitchPreference
<SwitchPreferenceCompat
android:defaultValue="false"
android:enabled="false"
android:key="pref_key_bluetooth"
android:persistent="false"
android:title="@string/bluetooth_setting"
android:widgetLayout="@layout/preference_switch_compat"
app:iconSpaceReserved="false" />
<SwitchPreference
<SwitchPreferenceCompat
android:defaultValue="false"
android:enabled="false"
android:key="pref_key_wifi"
android:persistent="false"
android:title="@string/wifi_setting"
android:widgetLayout="@layout/preference_switch_compat"
app:iconSpaceReserved="false" />
<SwitchPreference
<SwitchPreferenceCompat
android:defaultValue="true"
android:enabled="false"
android:key="pref_key_tor_enable"
android:persistent="false"
android:summary="@string/tor_enable_summary"
android:title="@string/tor_enable_title"
android:widgetLayout="@layout/preference_switch_compat"
app:iconSpaceReserved="false" />
<ListPreference
@@ -42,17 +39,16 @@
android:title="@string/tor_network_setting"
app:iconSpaceReserved="false" />
<SwitchPreference
<SwitchPreferenceCompat
android:defaultValue="true"
android:dependency="pref_key_tor_enable"
android:enabled="false"
android:key="pref_key_tor_mobile_data"
android:persistent="false"
android:title="@string/tor_mobile_data_title"
android:widgetLayout="@layout/preference_switch_compat"
app:iconSpaceReserved="false" />
<SwitchPreference
<SwitchPreferenceCompat
android:defaultValue="false"
android:dependency="pref_key_tor_enable"
android:enabled="false"
@@ -60,7 +56,6 @@
android:persistent="false"
android:summary="@string/tor_only_when_charging_summary"
android:title="@string/tor_only_when_charging_title"
android:widgetLayout="@layout/preference_switch_compat"
app:iconSpaceReserved="false" />
</PreferenceScreen>

View File

@@ -3,13 +3,12 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<SwitchPreference
<SwitchPreferenceCompat
android:enabled="false"
android:key="pref_key_lock"
android:persistent="false"
android:summary="@string/pref_lock_summary"
android:title="@string/pref_lock_title"
android:widgetLayout="@layout/preference_switch_compat"
app:iconSpaceReserved="false" />
<ListPreference