Remove redundant casts.

This commit is contained in:
akwizgran
2020-01-16 14:09:22 +00:00
parent 706c03aa8b
commit 4f54bd90fb

View File

@@ -163,28 +163,21 @@ public class SettingsFragment extends PreferenceFragmentCompat
public void onCreatePreferences(Bundle bundle, String s) { public void onCreatePreferences(Bundle bundle, String s) {
addPreferencesFromResource(R.xml.settings); addPreferencesFromResource(R.xml.settings);
language = (ListPreference) findPreference(LANGUAGE); language = findPreference(LANGUAGE);
setLanguageEntries(); setLanguageEntries();
ListPreference theme = ListPreference theme = findPreference("pref_key_theme");
(ListPreference) findPreference("pref_key_theme"); enableBluetooth = findPreference("pref_key_bluetooth");
enableBluetooth = (ListPreference) findPreference("pref_key_bluetooth"); torNetwork = findPreference(TOR_NETWORK);
torNetwork = (ListPreference) findPreference(TOR_NETWORK); torMobile = findPreference(TOR_MOBILE);
torMobile = (SwitchPreference) findPreference(TOR_MOBILE); torOnlyWhenCharging = findPreference(TOR_ONLY_WHEN_CHARGING);
torOnlyWhenCharging = screenLock = findPreference(PREF_SCREEN_LOCK);
(SwitchPreference) findPreference(TOR_ONLY_WHEN_CHARGING); screenLockTimeout = findPreference(PREF_SCREEN_LOCK_TIMEOUT);
screenLock = (SwitchPreference) findPreference(PREF_SCREEN_LOCK); notifyPrivateMessages =
screenLockTimeout = findPreference("pref_key_notify_private_messages");
(ListPreference) findPreference(PREF_SCREEN_LOCK_TIMEOUT); notifyGroupMessages = findPreference("pref_key_notify_group_messages");
notifyPrivateMessages = (SwitchPreference) findPreference( notifyForumPosts = findPreference("pref_key_notify_forum_posts");
"pref_key_notify_private_messages"); notifyBlogPosts = findPreference("pref_key_notify_blog_posts");
notifyGroupMessages = (SwitchPreference) findPreference( notifyVibration = findPreference("pref_key_notify_vibration");
"pref_key_notify_group_messages");
notifyForumPosts = (SwitchPreference) findPreference(
"pref_key_notify_forum_posts");
notifyBlogPosts = (SwitchPreference) findPreference(
"pref_key_notify_blog_posts");
notifyVibration = (SwitchPreference) findPreference(
"pref_key_notify_vibration");
notifySound = findPreference("pref_key_notify_sound"); notifySound = findPreference("pref_key_notify_sound");
language.setOnPreferenceChangeListener(this); language.setOnPreferenceChangeListener(this);
@@ -335,7 +328,8 @@ public class SettingsFragment extends PreferenceFragmentCompat
boolean blocked = boolean blocked =
circumventionProvider.isTorProbablyBlocked(country); circumventionProvider.isTorProbablyBlocked(country);
boolean useBridges = circumventionProvider.doBridgesWork(country); boolean useBridges = circumventionProvider.doBridgesWork(country);
String setting = getString(R.string.tor_network_setting_without_bridges); String setting =
getString(R.string.tor_network_setting_without_bridges);
if (blocked && useBridges) { if (blocked && useBridges) {
setting = getString(R.string.tor_network_setting_with_bridges); setting = getString(R.string.tor_network_setting_with_bridges);
} else if (blocked) { } else if (blocked) {