diff --git a/res/values/strings.xml b/res/values/strings.xml index 846fbb6dff..aabae678f1 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -82,6 +82,7 @@ Keep screen on. useArabicNames keepScreenOn + displayMarkerPopup lockOrientation landscapeOrientation translationTextSize @@ -101,6 +102,7 @@ No active translation set, set an active translation first (Settings > Set Active Translation) and then search again. Set Active Translation You have not got any available translations, please download a translation first (Menu > Get More Translations) and then search again. + Reading Preferences Translation Preferences Display Settings activeTranslation diff --git a/res/xml/quran_preferences.xml b/res/xml/quran_preferences.xml index 99506422ca..f8d7afdb18 100644 --- a/res/xml/quran_preferences.xml +++ b/res/xml/quran_preferences.xml @@ -21,6 +21,13 @@ + + + + 30 ? 30 : juz < 1 ? 1 : juz; } + public static int getPageFromRub3(int rub3){ + if ((rub3 < 1) || (rub3 > 8 * ApplicationConstants.JUZ2_COUNT)) return -1; + return QuranInfo.RUB3_PAGE_START[rub3-1]; + } + + public static int getRub3FromPage(int page) { + if ((page > ApplicationConstants.PAGES_LAST) || (page < 1)) return -1; + return PAGE_RUB3_START[page-1]; + } + public static int getPageFromSuraAyah(int sura, int ayah){ // basic bounds checking if (ayah == 0) ayah = 1; diff --git a/src/com/quran/labs/androidquran/util/QuranSettings.java b/src/com/quran/labs/androidquran/util/QuranSettings.java index 0e8c4da13a..0878079878 100644 --- a/src/com/quran/labs/androidquran/util/QuranSettings.java +++ b/src/com/quran/labs/androidquran/util/QuranSettings.java @@ -13,6 +13,7 @@ public class QuranSettings { private boolean keepScreenOn = false; private boolean lockOrientation = false; private boolean landscapeOrientation = false; + private boolean displayMarkerPopup = false; private int translationTextSize = ApplicationConstants.DEFAULT_TEXT_SIZE; private int lastPage = 0; private String activeTranslation = null; @@ -75,6 +76,14 @@ public void setLandscapeOrientation(boolean landscapeOrientation) { this.landscapeOrientation = landscapeOrientation; } + public boolean isDisplayMarkerPopup() { + return displayMarkerPopup; + } + + public void setMarkerPopup(boolean displayMarkerPopup) { + this.displayMarkerPopup = displayMarkerPopup; + } + public int getTranslationTextSize() { return translationTextSize; } @@ -100,6 +109,7 @@ public static void load(SharedPreferences preferences) { instance.keepScreenOn = preferences.getBoolean(ApplicationConstants.PREF_KEEP_SCREEN_ON, true); instance.lockOrientation = preferences.getBoolean(ApplicationConstants.PREF_LOCK_ORIENTATION, false); instance.landscapeOrientation = preferences.getBoolean(ApplicationConstants.PREF_LANDSCAPE_ORIENTATION, false); + instance.displayMarkerPopup = preferences.getBoolean(ApplicationConstants.PREF_DISPLAY_MARKER_POPUP, false); instance.translationTextSize = preferences.getInt(ApplicationConstants.PREF_TRANSLATION_TEXT_SIZE, ApplicationConstants.DEFAULT_TEXT_SIZE); instance.lastPage = preferences.getInt(ApplicationConstants.PREF_LAST_PAGE, ApplicationConstants.NO_PAGE_SAVED); instance.activeTranslation = preferences.getString(ApplicationConstants.PREF_ACTIVE_TRANSLATION, null); @@ -113,6 +123,7 @@ public static void save(SharedPreferences preferences) { editor.putBoolean(ApplicationConstants.PREF_KEEP_SCREEN_ON, instance.keepScreenOn); editor.putBoolean(ApplicationConstants.PREF_LOCK_ORIENTATION, instance.lockOrientation); editor.putBoolean(ApplicationConstants.PREF_LANDSCAPE_ORIENTATION, instance.landscapeOrientation); + editor.putBoolean(ApplicationConstants.PREF_DISPLAY_MARKER_POPUP, instance.displayMarkerPopup); editor.putInt(ApplicationConstants.PREF_TRANSLATION_TEXT_SIZE, instance.translationTextSize); editor.putInt(ApplicationConstants.PREF_LAST_PAGE, instance.lastPage); editor.putString(ApplicationConstants.PREF_ACTIVE_TRANSLATION, instance.activeTranslation);