Skip to content

Commit

Permalink
patch 2.4.3 :S
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre committed Jun 18, 2013
1 parent aed9d93 commit 0a023a6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 28 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ Open Source Projects Used

Changelog
---------
**version 2.4.2** (released 6/18/2013)
**version 2.4.2 and 2.4.3** (released 6/18/2013)
- critical bugfix for night mode font issue
- changed default font to white for night mode
- patch download for 1920 resolution images to fix 3 incomplete images
- patch download for people who recently downloaded page 270

**version 2.4.1** (released 6/16/2013)
- option to disable tablet mode
Expand Down
4 changes: 2 additions & 2 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.quran.labs.androidquran" android:versionCode="242"
android:versionName="2.4.2"
package="com.quran.labs.androidquran" android:versionCode="243"
android:versionName="2.4.3"
android:installLocation="auto">

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,37 @@ public void onCreate(Bundle savedInstanceState) {
mSharedPreferences = PreferenceManager
.getDefaultSharedPreferences(getApplicationContext());

// one time upgrade to v2.4.2
if (!mSharedPreferences.contains(Constants.PREF_UPGRADE_TO_242)){
// one time upgrade to v2.4.3
if (!mSharedPreferences.contains(Constants.PREF_UPGRADE_TO_243)){
String baseDir = QuranFileUtils.getQuranBaseDirectory(this);
if (baseDir != null){
// one time delete of partial downloads since the
// contents of these zip files has changed
String[] partials = new String[]{ "images_1920_1024.zip.part",
"images_1920_512.zip.part",
"images_1920.zip.part" };
for (String p : partials){
try {
File f = new File(baseDir + File.separator + p);
if (f.exists()){
f.delete();
baseDir = baseDir + File.separator;
try {
File f = new File(baseDir);
if (f.exists() && f.isDirectory()){
String[] files = f.list();
if (files != null){
for (String file : files){
if (file.endsWith(".part")){
try {
new File(baseDir + file).delete();
}
catch (Exception e){}
}
}
}
}
catch (Exception e){
}
}

// update night mode preference and mark that we upgraded to 2.4.2
mSharedPreferences.edit()
.putInt(Constants.PREF_NIGHT_MODE_TEXT_BRIGHTNESS,
Constants.DEFAULT_NIGHT_MODE_TEXT_BRIGHTNESS)
.putBoolean(Constants.PREF_UPGRADE_TO_242, true).commit();
catch (Exception e){
}
}

// update night mode preference and mark that we upgraded to 2.4.2
mSharedPreferences.edit()
.putInt(Constants.PREF_NIGHT_MODE_TEXT_BRIGHTNESS,
Constants.DEFAULT_NIGHT_MODE_TEXT_BRIGHTNESS)
.remove(Constants.PREF_UPGRADE_TO_242)
.putBoolean(Constants.PREF_UPGRADE_TO_243, true).commit();
}
}

Expand Down Expand Up @@ -260,13 +265,27 @@ else if (mSharedPreferences.getBoolean(
}
}
else {
// force a check for the 1920 images version 3, if it's not
// force a check for the images version 3, if it's not
// there, download the patch.
QuranScreenInfo qsi = QuranScreenInfo.getInstance();
if ("_1920".equals(qsi.getWidthParam()) &&
!QuranFileUtils.isVersion(QuranDataActivity.this, "_1920", 3)){
// explicitly check whether we need to fix the 1920 images
mPatchUrl = QuranFileUtils.getPatchFileUrl("_1920", 3);
String widthParam = qsi.getWidthParam();
if (qsi.isTablet(QuranDataActivity.this)){
String tabletWidth = qsi.getTabletWidthParam();
if ((!QuranFileUtils.isVersion(QuranDataActivity.this,
widthParam, 3)) ||
(!QuranFileUtils.isVersion(QuranDataActivity.this,
tabletWidth, 3))){
widthParam += tabletWidth;
// get patch for both landscape/portrait tablet images
mPatchUrl = QuranFileUtils.getPatchFileUrl(widthParam, 3);
promptForDownload();
return;
}
}
else if (!QuranFileUtils.isVersion(QuranDataActivity.this,
widthParam, 3)){
// explicitly check whether we need to fix the images
mPatchUrl = QuranFileUtils.getPatchFileUrl(widthParam, 3);
promptForDownload();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ public class Constants {
public static final String PREF_DISPLAY_CATEGORY = "displayCategoryKey";
public static final String PREF_TABLET_ENABLED = "useTabletMode";
public static final String PREF_UPGRADE_TO_242 = "upgradeTo242";
public static final String PREF_UPGRADE_TO_243 = "upgradeTo243";
}

0 comments on commit 0a023a6

Please sign in to comment.