Skip to content

Commit

Permalink
Merge Conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussein Maher committed Oct 16, 2011
2 parents 39dceec + fd6a702 commit 22ca03f
Show file tree
Hide file tree
Showing 28 changed files with 503 additions and 236 deletions.
5 changes: 2 additions & 3 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.quran.labs.androidquran" android:versionCode="8"
android:versionName="1.5.1" android:installLocation="preferExternal">
package="com.quran.labs.androidquran" android:versionCode="9" android:versionName="1.5.2" android:installLocation="preferExternal">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="false">
<activity android:name=".QuranActivity" android:label="@string/app_name"
Expand Down Expand Up @@ -50,4 +49,4 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
</manifest>
</manifest>
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ code by [@ahmedre](http://twitter.com/ahmedre),
and [@wnafee](http://twitter.com/wnafee). graphics by
[@somaiagabr](http://twitter.com/somaiagabr).

contributors include [@afarra](http://github.com/afarra) and [@mahmoudhossam](http://github.com/mahmoudhossam).

Terms of use
------------
you are free to use parts of (or all of) the Quran Android code in your
Expand All @@ -39,6 +41,19 @@ Project dependecies

Changelog
---------
**version 1.5.2**

- fix crash on android 1.5.
- rub3/7izb/juz2 notifications while reading
- autoscroll to ayah if it is not visible on the screen
- audio options to resume from last played ayah, start of the page, or start
of any of the suras on that page.
- apps2sd support.
- plethora of bugfixes (arabic fixes, seekbar not refreshing after jump, page
resets when orientation changes in translation view, page navigated to in
translation not retained when returning to quran view, and warning if the
sd card is filled).

**version 1.5**

- audio support
Expand Down
Binary file removed lib/gson-1.4.jar
Binary file not shown.
Binary file added lib/gson-1.7.1.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion res/layout/about_us.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Button android:layout_width="300dip" android:id="@+id/btnEmailUs"
android:layout_height="wrap_content" android:text="Email Quran Android"
android:layout_centerHorizontal="true" android:layout_above="@id/txtCopyRights"
android:visibility="visible" />
android:visibility="visible" android:onClick="onEmailClick"/>

<TextView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:visibility="visible"
Expand Down
31 changes: 19 additions & 12 deletions res/layout/dialog_download.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:entries="@array/quran_readers_name"
/>
<RadioGroup android:id="@+id/radioGroupDownload"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:text="@string/radio_download_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"/>
<RadioButton android:id="@+id/radioDownloadPage" android:text="Current Page" android:checked="true"/>
<RadioButton android:id="@+id/radioDownloadSura" android:text="Current Sura"/>
<RadioButton android:id="@+id/radioDownloadJuza" android:text="Current Juza"/>
</RadioGroup>
android:prompt="@string/prompt_select_reciter"
android:entries="@array/quran_readers_name"/>
<ScrollView
android:id="@+id/scrollViewDownload"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<RadioGroup
android:id="@+id/radioGroupDownload"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:text="@string/download_dialog_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"/>
<RadioButton android:id="@+id/radioDownloadPage" android:text="Current Page" android:checked="true"/>
<RadioButton android:id="@+id/radioDownloadSura" android:text="Current Sura"/>
<RadioButton android:id="@+id/radioDownloadJuza" android:text="Current Juza"/>
</RadioGroup>
</ScrollView>
</LinearLayout>
23 changes: 23 additions & 0 deletions res/layout/dialog_play.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView
android:id="@+id/scrollViewPlay"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<RadioGroup android:id="@+id/radioGroupPlay"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:isScrollContainer="true">
<TextView android:text="@string/play_dialog_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"/>
<RadioButton android:id="@+id/radioPlayPage" android:text="Start of Page" android:checked="true"/>
<RadioButton android:id="@+id/radioPlayLast" android:text="Last Played Ayah"/>
</RadioGroup>
</ScrollView>
</LinearLayout>
4 changes: 2 additions & 2 deletions res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
</string>
<string name="help_title">مساعد قران اندرويد </string>
<string name="help">- ضع الشاشه في الوضع الافقي للتكبير في هذا الاصدار..
\n- لتغير الصفحة انقر يمين او يسار الشاشة،او باستخدام اصبعك لتحريك الصفحة
\n- اضغط على وسط الشاشة للحصول على التمرير لتحويل صفحات.
\n- لتغير الصفحة استخدم اصبعك لتحريك الصفحة
\n- اضغط على الشاشة للحصول على التمرير لتحويل صفحات و امكانية الاستماع و امكانية حفظ الصفحة.
\n- يمكنك تحديد الاتجاه في وضع افقي أو رأسي.
\n- تصفح و حمل الترجمة المتاحة (اختر القايمة حصول على لاترجمة(
\n-يمكنك تحميل العديد من الترجمات كما تريد، ولكن ترجمة واحدة فقط
Expand Down
3 changes: 2 additions & 1 deletion res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="actionbar_separator">#0f2d4d</color>
<color name="actionbar_separator">#0f2d4d</color>
<color name="page_border_color">#802A2A</color>
</resources>
18 changes: 13 additions & 5 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@
<string name="email_to">[email protected]</string>
<string name="aboutUs">Quran Android is a free, open source Quran
application for Android. The images used are from the quran.com
project, and the data used in the translations and Arabic comes from
project, the audio comes from everyayah.com,
the data used in the translations and Arabic comes from
tanzil.net.
\n\nCredits:
\n Ahmed Farra - bugfixes and many contributions.
\n Mahmoud Hossam - bugfixes.
\n @fo2ad - audio recitation support
\n @wnafee - page flip animation (based on android-page-curl project)
\n @hams_rrr - arabic support for non-arabic phones
Expand All @@ -62,9 +65,8 @@
</string>
<string name="help_title">Quran Android Help</string>
<string name="help">- Flip your screen to landscape mode for a zoomed in version.
\n- Change pages by tapping the right or left side of the screen, or by
swiping your finger across the screen.
\n- Tap the center of the screen to get a slider for switching pages.
\n- Change pages by swiping your finger across the screen.
\n- Tap the screen to get a bookmark button, a slider for switching pages and audio.
\n- You can fix the orientation in either landscape or portrait modes.
\n- Browse and download available translations (choose Menu > Get Translations).
\n- You can download as many translations as you want, yet only one translation
Expand All @@ -83,6 +85,7 @@
<string name="prefs_use_arabic_names">useArabicNames</string>
<string name="prefs_keep_screen_on">keepScreenOn</string>
<string name="prefs_display_marker_popup">displayMarkerPopup</string>
<string name="prefs_auto_scroll">autoScroll</string>
<string name="prefs_lock_orientation">lockOrientation</string>
<string name="prefs_landscape_orientation">landscapeOrientation</string>
<string name="prefs_translation_text_size">translationTextSize</string>
Expand Down Expand Up @@ -118,5 +121,10 @@
<string name="set_active">Set Active</string>
<string name="prompt_select_ayah">Select Ayah</string>
<string name="prompt_select_sura">Select Sura</string>
<string name="radio_download_message">Choose download option</string>
<string name="prompt_select_reciter">Select Reciter</string>
<string name="play_dialog_message">Start playing from...</string>
<string name="play_dialog_page">Current Page (%s)</string>
<string name="play_dialog_resume">Resume %1$s : %2$s</string>
<string name="download_dialog_message">Choose download option</string>
<string name="download_dialog_page">Current Page (%s)</string>
</resources>
7 changes: 6 additions & 1 deletion res/xml/quran_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
<CheckBoxPreference
android:title="Display Marker Popups"
android:summaryOn="Display popup when reaching Juz', Hizb, etc." android:summaryOff="Don't display popup when reaching Juz', Hizb, etc."
android:persistent="true" android:key="@string/prefs_display_marker_popup">
android:persistent="true" android:key="@string/prefs_display_marker_popup" android:defaultValue="true">
</CheckBoxPreference>
<CheckBoxPreference
android:title="Auto Scroll"
android:summaryOn="Auto scroll to highlighted ayah while playing (in landscape)" android:summaryOff="Don't auto scroll to highlighted ayah while playing (in landscape)"
android:persistent="true" android:key="@string/prefs_auto_scroll" android:defaultValue="true">
</CheckBoxPreference>
</PreferenceCategory>
<PreferenceCategory android:title="@string/prefs_category_translation">
Expand Down
41 changes: 13 additions & 28 deletions src/com/quran/labs/androidquran/AboutUsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,23 @@
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class AboutUsActivity extends Activity implements OnClickListener {
protected Button btnEmailUs;
protected TextView txtAbout;
public class AboutUsActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about_us);

btnEmailUs = (Button)findViewById(R.id.btnEmailUs);
btnEmailUs.setOnClickListener(this);

txtAbout = (TextView)findViewById(R.id.txtAbout);
txtAbout.setVerticalScrollBarEnabled(true);
txtAbout.setMovementMethod(new ScrollingMovementMethod());
super.onCreate(savedInstanceState);
setContentView(R.layout.about_us);
TextView txtAbout = (TextView) findViewById(R.id.txtAbout);
txtAbout.setVerticalScrollBarEnabled(true);
txtAbout.setMovementMethod(new ScrollingMovementMethod());
}

@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnEmailUs:
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.email_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{getString(R.string.email_to)});
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
break;
default:
break;
}

public void onEmailClick(View v) {
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.email_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { getString(R.string.email_to) });
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
}
}
5 changes: 3 additions & 2 deletions src/com/quran/labs/androidquran/BookmarksActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import com.quran.labs.androidquran.common.BaseQuranActivity;
import com.quran.labs.androidquran.data.QuranInfo;
import com.quran.labs.androidquran.util.ArabicStyle;
import com.quran.labs.androidquran.util.BookmarksManager;

public class BookmarksActivity extends BaseQuranActivity {
Expand All @@ -39,8 +40,8 @@ private void showBookmarks() {
ArrayList<Integer> bookmarks = BookmarksManager.getInstance().getBookmarks();
for (int i = 0; i < bookmarks.size(); i++) {
int page = bookmarks.get(i);
String title = QuranInfo.getSuraNameString(page);
String info = QuranInfo.getSuraDetailsForBookmark(page);
String title = ArabicStyle.reshape(QuranInfo.getSuraNameString(page));
String info = ArabicStyle.reshape(QuranInfo.getSuraDetailsForBookmark(page));
Map<String, String> map = new HashMap<String, String>();
map.put("suraname", title);
map.put("info", info);
Expand Down
34 changes: 20 additions & 14 deletions src/com/quran/labs/androidquran/QuranActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
import static com.quran.labs.androidquran.data.ApplicationConstants.*;

import com.markupartist.android.widget.ActionBar;
import com.markupartist.android.widget.ActionBar.IntentAction;
import com.quran.labs.androidquran.common.BaseQuranActivity;
import com.quran.labs.androidquran.data.ApplicationConstants;
import com.quran.labs.androidquran.data.QuranInfo;
import com.quran.labs.androidquran.service.QuranDataService;
import com.quran.labs.androidquran.util.ArabicStyle;
Expand All @@ -42,15 +42,21 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.quran_list);
QuranSettings.load(prefs);

// set the asset manager to define the Arabic font
ArabicStyle.setAssetManager(getAssets());
Intent i = new Intent(this, QuranDataActivity.class);
startActivityForResult(i, ApplicationConstants.DATA_CHECK_CODE);

setArabicFont();
actionBar = (ActionBar) findViewById(R.id.actionbar);
addActions();
}

/**
* set the asset manager to define the Arabic font
*/

public void setArabicFont(){
ArabicStyle.setAssetManager(getAssets());
Intent i = new Intent(this, QuranDataActivity.class);
startActivityForResult(i, DATA_CHECK_CODE);
}

/**
* Sets up the action bar.
*/
Expand All @@ -65,7 +71,7 @@ protected void onNewIntent(Intent intent) {
String action = intent.getAction();
if (ACTION_BOOKMARK.equals(action)) {
Intent i = new Intent(getApplicationContext(), BookmarksActivity.class);
startActivityForResult(i, ApplicationConstants.BOOKMARKS_CODE);
startActivityForResult(i, BOOKMARKS_CODE);
} else if (ACTION_RESUME.equals(action)) {
jumpTo(QuranSettings.getInstance().getLastPage());
}
Expand Down Expand Up @@ -96,12 +102,12 @@ public void onConfigurationChanged(Configuration newConfig) {
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

if (requestCode == ApplicationConstants.DATA_CHECK_CODE){
if (requestCode == DATA_CHECK_CODE){
showSuras();
Integer lastPage = QuranSettings.getInstance().getLastPage();
if (lastPage != null && lastPage != ApplicationConstants.NO_PAGE_SAVED)
if (lastPage != null && lastPage != NO_PAGE_SAVED)
jumpTo(lastPage);
} else if (requestCode == ApplicationConstants.SETTINGS_CODE) {
} else if (requestCode == SETTINGS_CODE) {
QuranSettings.load(prefs);
showSuras();
}
Expand All @@ -118,12 +124,12 @@ public void showSuras() {
int pos = 0;
int sura = 1;
int next = 1;
QuranElement[] elements = new QuranElement[114+30];
QuranElement[] elements = new QuranElement[SURAS_COUNT + JUZ2_COUNT];

for (int juz=1; juz <= ApplicationConstants.JUZ2_COUNT; juz++){
for (int juz=1; juz <= JUZ2_COUNT; juz++){
elements[pos++] = new QuranElement(QuranInfo.getJuzTitle() + " " + juz, true, juz, QuranInfo.JUZ_PAGE_START[juz-1]);
next = (juz == ApplicationConstants.JUZ2_COUNT) ? ApplicationConstants.PAGES_LAST+1 : QuranInfo.JUZ_PAGE_START[juz];
while ((sura <= ApplicationConstants.SURAS_COUNT) && (QuranInfo.SURA_PAGE_START[sura-1] < next)) {
next = (juz == JUZ2_COUNT) ? PAGES_LAST+1 : QuranInfo.JUZ_PAGE_START[juz];
while ((sura <= SURAS_COUNT) && (QuranInfo.SURA_PAGE_START[sura-1] < next)) {
String title = QuranInfo.getSuraTitle() + " " + QuranInfo.getSuraName(sura-1);
elements[pos++] = new QuranElement(title, false, sura, QuranInfo.SURA_PAGE_START[sura-1]);
sura++;
Expand Down
Loading

0 comments on commit 22ca03f

Please sign in to comment.