Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Julian Dehm
briar
Commits
30a070dd
Verified
Commit
30a070dd
authored
Aug 13, 2018
by
Torsten Grote
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace CheckBoxPreference witht he more standard SwitchPreference
parent
4f18303a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
34 deletions
+34
-34
briar-android/src/main/java/org/briarproject/briar/android/panic/PanicPreferencesFragment.java
...project/briar/android/panic/PanicPreferencesFragment.java
+5
-5
briar-android/src/main/java/org/briarproject/briar/android/settings/SettingsFragment.java
...briarproject/briar/android/settings/SettingsFragment.java
+18
-18
briar-android/src/main/res/xml/panic_preferences.xml
briar-android/src/main/res/xml/panic_preferences.xml
+3
-3
briar-android/src/main/res/xml/settings.xml
briar-android/src/main/res/xml/settings.xml
+8
-8
No files found.
briar-android/src/main/java/org/briarproject/briar/android/panic/PanicPreferencesFragment.java
View file @
30a070dd
...
...
@@ -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
CheckBox
Preference
lockPref
,
purgePref
,
uninstallPref
;
private
Switch
Preference
lockPref
,
purgePref
,
uninstallPref
;
private
ListPreference
panicAppPref
;
@Override
...
...
@@ -46,10 +46,10 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
pm
=
getActivity
().
getPackageManager
();
lockPref
=
(
CheckBox
Preference
)
findPreference
(
KEY_LOCK
);
lockPref
=
(
Switch
Preference
)
findPreference
(
KEY_LOCK
);
panicAppPref
=
(
ListPreference
)
findPreference
(
KEY_PANIC_APP
);
purgePref
=
(
CheckBox
Preference
)
findPreference
(
KEY_PURGE
);
uninstallPref
=
(
CheckBox
Preference
)
findPreference
(
KEY_UNINSTALL
);
purgePref
=
(
Switch
Preference
)
findPreference
(
KEY_PURGE
);
uninstallPref
=
(
Switch
Preference
)
findPreference
(
KEY_UNINSTALL
);
// check for connect/disconnect intents from panic trigger apps
if
(
PanicResponder
.
checkForDisconnectIntent
(
getActivity
()))
{
...
...
briar-android/src/main/java/org/briarproject/briar/android/settings/SettingsFragment.java
View file @
30a070dd
...
...
@@ -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
CheckBox
Preference
torBlocked
;
private
CheckBox
Preference
notifyPrivateMessages
;
private
CheckBox
Preference
notifyGroupMessages
;
private
CheckBox
Preference
notifyForumPosts
;
private
CheckBox
Preference
notifyBlogPosts
;
private
CheckBox
Preference
notifyVibration
;
private
CheckBox
Preference
notifyLockscreen
;
private
Switch
Preference
torBlocked
;
private
Switch
Preference
notifyPrivateMessages
;
private
Switch
Preference
notifyGroupMessages
;
private
Switch
Preference
notifyForumPosts
;
private
Switch
Preference
notifyBlogPosts
;
private
Switch
Preference
notifyVibration
;
private
Switch
Preference
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
=
(
CheckBox
Preference
)
findPreference
(
TOR_LOCATION
);
torBlocked
=
(
Switch
Preference
)
findPreference
(
TOR_LOCATION
);
setBlockedCountries
();
CheckBox
Preference
notifySignIn
=
(
CheckBox
Preference
)
findPreference
(
NOTIFY_SIGN_IN
);
notifyPrivateMessages
=
(
CheckBox
Preference
)
findPreference
(
Switch
Preference
notifySignIn
=
(
Switch
Preference
)
findPreference
(
NOTIFY_SIGN_IN
);
notifyPrivateMessages
=
(
Switch
Preference
)
findPreference
(
"pref_key_notify_private_messages"
);
notifyGroupMessages
=
(
CheckBox
Preference
)
findPreference
(
notifyGroupMessages
=
(
Switch
Preference
)
findPreference
(
"pref_key_notify_group_messages"
);
notifyForumPosts
=
(
CheckBox
Preference
)
findPreference
(
notifyForumPosts
=
(
Switch
Preference
)
findPreference
(
"pref_key_notify_forum_posts"
);
notifyBlogPosts
=
(
CheckBox
Preference
)
findPreference
(
notifyBlogPosts
=
(
Switch
Preference
)
findPreference
(
"pref_key_notify_blog_posts"
);
notifyVibration
=
(
CheckBox
Preference
)
findPreference
(
notifyVibration
=
(
Switch
Preference
)
findPreference
(
"pref_key_notify_vibration"
);
notifyLockscreen
=
(
CheckBox
Preference
)
findPreference
(
notifyLockscreen
=
(
Switch
Preference
)
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
(
CheckBox
Preference
pref
,
private
void
setupNotificationPreference
(
Switch
Preference
pref
,
String
channelId
,
@StringRes
int
summary
)
{
pref
.
setWidgetLayoutResource
(
0
);
pref
.
setSummary
(
summary
);
...
...
briar-android/src/main/res/xml/panic_preferences.xml
View file @
30a070dd
...
...
@@ -8,21 +8,21 @@
android:summary=
"@string/panic_app_setting_summary"
android:title=
"@string/panic_app_setting_title"
/>
<
CheckBox
Preference
<
Switch
Preference
android:defaultValue=
"true"
android:enabled=
"false"
android:key=
"pref_key_lock"
android:summary=
"@string/lock_setting_summary"
android:title=
"@string/lock_setting_title"
/>
<
CheckBox
Preference
<
Switch
Preference
android:defaultValue=
"false"
android:enabled=
"false"
android:key=
"pref_key_purge"
android:summary=
"@string/purge_setting_summary"
android:title=
"@string/purge_setting_title"
/>
<
CheckBox
Preference
<
Switch
Preference
android:defaultValue=
"false"
android:enabled=
"false"
android:key=
"pref_key_uninstall"
...
...
briar-android/src/main/res/xml/settings.xml
View file @
30a070dd
...
...
@@ -44,7 +44,7 @@
android:summary=
"%s"
android:title=
"@string/tor_network_setting"
/>
<
CheckBox
Preference
<
Switch
Preference
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"
>
<
CheckBox
Preference
<
Switch
Preference
android:defaultValue=
"true"
android:key=
"pref_key_notify_sign_in"
android:summary=
"@string/notify_sign_in_summary"
android:title=
"@string/notify_sign_in_title"
/>
<
CheckBox
Preference
<
Switch
Preference
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"
/>
<
CheckBox
Preference
<
Switch
Preference
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"
/>
<
CheckBox
Preference
<
Switch
Preference
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"
/>
<
CheckBox
Preference
<
Switch
Preference
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"
/>
<
CheckBox
Preference
<
Switch
Preference
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"
/>
<
CheckBox
Preference
<
Switch
Preference
android:defaultValue=
"true"
android:key=
"pref_key_notify_vibration"
android:persistent=
"false"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment