Skip to content

Commit

Permalink
various bug fixes (where does settings return to, typo in sura name, …
Browse files Browse the repository at this point in the history
…etc).
  • Loading branch information
ahmedre committed Aug 21, 2010
1 parent 1d07eb3 commit 99915bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
7 changes: 4 additions & 3 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
doaa.</string>
<string name="help_title">Quran Android Help</string>
<string name="help">- Font size too small? Try
flipping your screen to landscape mode for a zoomed in version!
\n- Long press on any page to bring a menu and bookmark a page!
\n- Don\'t forget to check out the settings!</string>
flipping your screen to landscape mode for a zoomed in version.
\n- Change pages by swiping your finger across the screen or by using the arrow keys or trackball.
\n- Long press on any page to bring up the option to bookmark a page.
\n- Don\'t forget to check out the settings.</string>
<string name="settings_use_arabic_names">Arabic sura names.</string>
<string name="settings_full_screen">Full Screen Mode.\nHave a larger view area for pages.</string>
<string name="settings_show_clock">Show Clock in full screen mode.</string>
Expand Down
24 changes: 12 additions & 12 deletions src/com/quran/labs/androidquran/QuranMenuListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
jumpTo(lastPage);
break;
case ApplicationConstants.SETTINGS_CODE:
if (activity instanceof QuranActivity) {
((QuranActivity)activity).showSuras();
}
else {
lastPage = QuranSettings.getInstance().getLastPage();
if (lastPage != null)
jumpTo(lastPage);
}
((QuranActivity)activity).showSuras();
break;
case ApplicationConstants.SETTINGS_CODE_VIEW:
lastPage = QuranSettings.getInstance().getLastPage();
if (lastPage != null)
jumpTo(lastPage);
break;
case ApplicationConstants.BOOKMARKS_CODE:
if (resultCode == Activity.RESULT_OK) {
Expand All @@ -42,7 +40,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
case ApplicationConstants.QURAN_VIEW_CODE:
if (resultCode == Activity.RESULT_OK) {
boolean openSettings = data.getBooleanExtra("openSettings", false);
if (openSettings) startSettingsActivity();
if (openSettings) startSettingsActivity(true);
}
break;
}
Expand Down Expand Up @@ -75,7 +73,7 @@ public boolean onMenuItemSelected(int featureId, MenuItem item) {
activity.setResult(Activity.RESULT_OK, data);
activity.finish();
} else {
startSettingsActivity();
startSettingsActivity(false);
}
break;
case R.id.menu_item_bookmarks:
Expand All @@ -86,8 +84,10 @@ public boolean onMenuItemSelected(int featureId, MenuItem item) {
return true;
}

private void startSettingsActivity() {
private void startSettingsActivity(boolean returnToView) {
Intent intent = new Intent(activity.getApplicationContext(), SettingsActivity.class);
activity.startActivityForResult(intent, ApplicationConstants.SETTINGS_CODE);

int whereToGo = ((returnToView)? ApplicationConstants.SETTINGS_CODE_VIEW : ApplicationConstants.SETTINGS_CODE);
activity.startActivityForResult(intent, whereToGo);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class ApplicationConstants {
public static final int SETTINGS_CODE = DATA_CHECK_CODE + 1;
public static final int BOOKMARKS_CODE = SETTINGS_CODE + 1;
public static final int QURAN_VIEW_CODE = BOOKMARKS_CODE + 1;
public static final int SETTINGS_CODE_VIEW = QURAN_VIEW_CODE + 1;

// Pages
public static final int PAGES_FIRST = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/com/quran/labs/androidquran/common/QuranInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class QuranInfo {
"النور", "الفرقان", "الشعراء", "النمل", "القصص",
"العنكبوت", "الروم", "لقمان", "السجدة", "اﻷحزاب", "سبأ",
"فاطر", "يس", "الصافات", "ص", "الزمر", "غافر",
"فصلت", "الشعراء", "الزخرف", "الدخان", "الجاثية",
"فصلت", "الشورى", "الزخرف", "الدخان", "الجاثية",
"الحاقة", "محمد", "الفتح", "الحجرات", "ق",
"الذاريات", "الطور", "النجم", "القمر", "الرحمن",
"الواقعة", "الحديد", "المجادلة", "الحشر", "الممتحنة",
Expand Down

0 comments on commit 99915bd

Please sign in to comment.