mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Replace CheckBoxPreference witht he more standard SwitchPreference
This commit is contained in:
@@ -9,8 +9,8 @@ import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.preference.CheckBoxPreference;
|
||||
import android.support.v7.preference.ListPreference;
|
||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||
import android.text.TextUtils;
|
||||
@@ -37,7 +37,7 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
|
||||
Logger.getLogger(PanicPreferencesFragment.class.getName());
|
||||
|
||||
private PackageManager pm;
|
||||
private CheckBoxPreference lockPref, purgePref, uninstallPref;
|
||||
private SwitchPreference lockPref, purgePref, uninstallPref;
|
||||
private ListPreference panicAppPref;
|
||||
|
||||
@Override
|
||||
@@ -46,10 +46,10 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
|
||||
|
||||
pm = getActivity().getPackageManager();
|
||||
|
||||
lockPref = (CheckBoxPreference) findPreference(KEY_LOCK);
|
||||
lockPref = (SwitchPreference) findPreference(KEY_LOCK);
|
||||
panicAppPref = (ListPreference) findPreference(KEY_PANIC_APP);
|
||||
purgePref = (CheckBoxPreference) findPreference(KEY_PURGE);
|
||||
uninstallPref = (CheckBoxPreference) findPreference(KEY_UNINSTALL);
|
||||
purgePref = (SwitchPreference) findPreference(KEY_PURGE);
|
||||
uninstallPref = (SwitchPreference) findPreference(KEY_UNINSTALL);
|
||||
|
||||
// check for connect/disconnect intents from panic trigger apps
|
||||
if (PanicResponder.checkForDisconnectIntent(getActivity())) {
|
||||
|
||||
@@ -10,9 +10,9 @@ import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.text.TextUtilsCompat;
|
||||
import android.support.v7.preference.CheckBoxPreference;
|
||||
import android.support.v7.preference.ListPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||
@@ -119,13 +119,13 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
private ListPreference language;
|
||||
private ListPreference enableBluetooth;
|
||||
private ListPreference torNetwork;
|
||||
private CheckBoxPreference torBlocked;
|
||||
private CheckBoxPreference notifyPrivateMessages;
|
||||
private CheckBoxPreference notifyGroupMessages;
|
||||
private CheckBoxPreference notifyForumPosts;
|
||||
private CheckBoxPreference notifyBlogPosts;
|
||||
private CheckBoxPreference notifyVibration;
|
||||
private CheckBoxPreference notifyLockscreen;
|
||||
private SwitchPreference torBlocked;
|
||||
private SwitchPreference notifyPrivateMessages;
|
||||
private SwitchPreference notifyGroupMessages;
|
||||
private SwitchPreference notifyForumPosts;
|
||||
private SwitchPreference notifyBlogPosts;
|
||||
private SwitchPreference notifyVibration;
|
||||
private SwitchPreference notifyLockscreen;
|
||||
|
||||
private Preference notifySound;
|
||||
|
||||
@@ -158,21 +158,21 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
(ListPreference) findPreference("pref_key_theme");
|
||||
enableBluetooth = (ListPreference) findPreference("pref_key_bluetooth");
|
||||
torNetwork = (ListPreference) findPreference("pref_key_tor_network");
|
||||
torBlocked = (CheckBoxPreference) findPreference(TOR_LOCATION);
|
||||
torBlocked = (SwitchPreference) findPreference(TOR_LOCATION);
|
||||
setBlockedCountries();
|
||||
CheckBoxPreference notifySignIn =
|
||||
(CheckBoxPreference) findPreference(NOTIFY_SIGN_IN);
|
||||
notifyPrivateMessages = (CheckBoxPreference) findPreference(
|
||||
SwitchPreference notifySignIn =
|
||||
(SwitchPreference) findPreference(NOTIFY_SIGN_IN);
|
||||
notifyPrivateMessages = (SwitchPreference) findPreference(
|
||||
"pref_key_notify_private_messages");
|
||||
notifyGroupMessages = (CheckBoxPreference) findPreference(
|
||||
notifyGroupMessages = (SwitchPreference) findPreference(
|
||||
"pref_key_notify_group_messages");
|
||||
notifyForumPosts = (CheckBoxPreference) findPreference(
|
||||
notifyForumPosts = (SwitchPreference) findPreference(
|
||||
"pref_key_notify_forum_posts");
|
||||
notifyBlogPosts = (CheckBoxPreference) findPreference(
|
||||
notifyBlogPosts = (SwitchPreference) findPreference(
|
||||
"pref_key_notify_blog_posts");
|
||||
notifyVibration = (CheckBoxPreference) findPreference(
|
||||
notifyVibration = (SwitchPreference) findPreference(
|
||||
"pref_key_notify_vibration");
|
||||
notifyLockscreen = (CheckBoxPreference) findPreference(
|
||||
notifyLockscreen = (SwitchPreference) findPreference(
|
||||
"pref_key_notify_lock_screen");
|
||||
notifySound = findPreference("pref_key_notify_sound");
|
||||
|
||||
@@ -424,7 +424,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
}
|
||||
|
||||
@TargetApi(26)
|
||||
private void setupNotificationPreference(CheckBoxPreference pref,
|
||||
private void setupNotificationPreference(SwitchPreference pref,
|
||||
String channelId, @StringRes int summary) {
|
||||
pref.setWidgetLayoutResource(0);
|
||||
pref.setSummary(summary);
|
||||
|
||||
@@ -8,21 +8,21 @@
|
||||
android:summary="@string/panic_app_setting_summary"
|
||||
android:title="@string/panic_app_setting_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:enabled="false"
|
||||
android:key="pref_key_lock"
|
||||
android:summary="@string/lock_setting_summary"
|
||||
android:title="@string/lock_setting_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:enabled="false"
|
||||
android:key="pref_key_purge"
|
||||
android:summary="@string/purge_setting_summary"
|
||||
android:title="@string/purge_setting_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:enabled="false"
|
||||
android:key="pref_key_uninstall"
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
android:summary="%s"
|
||||
android:title="@string/tor_network_setting"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="pref_key_tor_location"
|
||||
android:persistent="false"
|
||||
@@ -87,41 +87,41 @@
|
||||
android:layout="@layout/preferences_category"
|
||||
android:title="@string/notification_settings_title">
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="pref_key_notify_sign_in"
|
||||
android:summary="@string/notify_sign_in_summary"
|
||||
android:title="@string/notify_sign_in_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="pref_key_notify_private_messages"
|
||||
android:persistent="false"
|
||||
android:summary="@string/notify_private_messages_setting_summary"
|
||||
android:title="@string/notify_private_messages_setting_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="pref_key_notify_group_messages"
|
||||
android:persistent="false"
|
||||
android:summary="@string/notify_group_messages_setting_summary"
|
||||
android:title="@string/notify_group_messages_setting_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="pref_key_notify_forum_posts"
|
||||
android:persistent="false"
|
||||
android:summary="@string/notify_forum_posts_setting_summary"
|
||||
android:title="@string/notify_forum_posts_setting_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="pref_key_notify_blog_posts"
|
||||
android:persistent="false"
|
||||
android:summary="@string/notify_blog_posts_setting_summary"
|
||||
android:title="@string/notify_blog_posts_setting_title"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="pref_key_notify_lock_screen"
|
||||
android:persistent="false"
|
||||
@@ -129,7 +129,7 @@
|
||||
android:title="@string/notify_lock_screen_setting_title"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="pref_key_notify_vibration"
|
||||
android:persistent="false"
|
||||
|
||||
Reference in New Issue
Block a user