mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-20 20:03:05 +02:00
Merge pull request #3872 from timrae/rename-pref
Give integer preference a new name to prevent crash
This commit is contained in:
commit
d6afdb4262
@ -1669,7 +1669,7 @@ public abstract class AbstractFlashcardViewer extends NavigationDrawerActivity {
|
||||
mLongClickWorkaround = preferences.getBoolean("textSelectionLongclickWorkaround", false);
|
||||
// mDeckFilename = preferences.getString("deckFilename", "");
|
||||
mNightMode = preferences.getBoolean("invertedColors", false);
|
||||
mPrefFullscreenReview = Integer.parseInt(preferences.getString("fullscreenReview", "0")) >0;
|
||||
mPrefFullscreenReview = Integer.parseInt(preferences.getString("fullscreenMode", "0")) >0;
|
||||
mCardZoom = preferences.getInt("cardZoom", 100);
|
||||
mImageZoom = preferences.getInt("imageZoom", 100);
|
||||
mRelativeButtonSize = preferences.getInt("answerButtonSize", 100);
|
||||
|
@ -907,7 +907,7 @@ public class DeckPicker extends NavigationDrawerActivity implements
|
||||
if (previousVersionCode < 20500219) {
|
||||
// clear fullscreen flag as we use a integer
|
||||
boolean old =preferences.getBoolean("fullscreenReview", false);
|
||||
preferences.edit().putString("fullscreenReview", old ? "1": "0").commit();
|
||||
preferences.edit().putString("fullscreenMode", old ? "1": "0").commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ public class Preferences extends AppCompatPreferenceActivity implements Preferen
|
||||
screen = listener.getPreferenceScreen();
|
||||
// Show error toast if the user tries to disable answer button without gestures on
|
||||
ListPreference fullscreenPreference = (ListPreference)
|
||||
screen.findPreference("fullscreenReview");
|
||||
screen.findPreference("fullscreenMode");
|
||||
fullscreenPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||
public boolean onPreferenceChange(Preference preference, final Object newValue) {
|
||||
SharedPreferences prefs = AnkiDroidApp.getSharedPrefs(Preferences.this);
|
||||
|
@ -320,7 +320,7 @@ public class Reviewer extends AbstractFlashcardViewer {
|
||||
super.restorePreferences();
|
||||
SharedPreferences preferences = AnkiDroidApp.getSharedPrefs(getBaseContext());
|
||||
mBlackWhiteboard = preferences.getBoolean("blackWhiteboard", true);
|
||||
mPrefFullscreenReview = Integer.parseInt(preferences.getString("fullscreenReview", "0")) >0;
|
||||
mPrefFullscreenReview = Integer.parseInt(preferences.getString("fullscreenMode", "0")) >0;
|
||||
return preferences;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class CompatV19 extends CompatV16 implements Compat {
|
||||
|
||||
// Show / hide the Action bar together with the status bar
|
||||
SharedPreferences prefs = AnkiDroidApp.getSharedPrefs(a);
|
||||
final int fullscreenMode = Integer.parseInt(prefs.getString("fullscreenReview", "0"));
|
||||
final int fullscreenMode = Integer.parseInt(prefs.getString("fullscreenMode", "0"));
|
||||
View decorView = a.getWindow().getDecorView();
|
||||
decorView.setOnSystemUiVisibilityChangeListener
|
||||
(new View.OnSystemUiVisibilityChangeListener() {
|
||||
|
@ -61,7 +61,7 @@
|
||||
android:title="@string/pref_keep_screen_on" />
|
||||
<ListPreference
|
||||
android:defaultValue="false"
|
||||
android:key="fullscreenReview"
|
||||
android:key="fullscreenMode"
|
||||
android:summary=""
|
||||
android:entries="@array/full_screen_mode_labels"
|
||||
android:entryValues="@array/full_screen_mode_values"
|
||||
|
Loading…
Reference in New Issue
Block a user