mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +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);
|
||||
|
||||
Reference in New Issue
Block a user