diff --git a/README.md b/README.md index 8287a69d25..579dff4420 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,11 @@ Open Source Projects Used Changelog --------- +**version 2.4.2** (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 + **version 2.4.1** (released 6/16/2013) - option to disable tablet mode - many bugfixes diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml index 7721ca3f24..39807f24dc 100644 --- a/app/AndroidManifest.xml +++ b/app/AndroidManifest.xml @@ -1,7 +1,7 @@ diff --git a/app/res/values-ar/strings.xml b/app/res/values-ar/strings.xml index 3a74c9c16c..62f6f0d902 100644 --- a/app/res/values-ar/strings.xml +++ b/app/res/values-ar/strings.xml @@ -5,6 +5,7 @@ لأداء أفضل، بعض الملفات في حاجه للتحميل على بطاقة الذاكرة الرقمية. إذا لم تقم بذلك الاختيار فإن الصفحات ستستغرق وقت أطول للتحميل. هل ترغب في تحميل الملفات الآن؟ + هناك تحديث هام صغير على ملفات الصور على هاتفكم. هل تود تحميل الملف حالا؟ نعم لا جاري التحميل.... diff --git a/app/res/values/strings.xml b/app/res/values/strings.xml index 7fba2683a5..571bf2a3cf 100644 --- a/app/res/values/strings.xml +++ b/app/res/values/strings.xml @@ -9,6 +9,9 @@ We recently added improved images for tablets. Would you like to download these images now? + There is a small yet important update + for the Quran images you have on your device. Would you like to download this + patch now? Yes No Downloading… diff --git a/app/res/xml/quran_preferences.xml b/app/res/xml/quran_preferences.xml index 49c859481f..a196e79723 100644 --- a/app/res/xml/quran_preferences.xml +++ b/app/res/xml/quran_preferences.xml @@ -64,7 +64,7 @@ 0) - ostream.write(buf, 0, size); - is.close(); - ostream.close(); + if (f.exists()){ + f.delete(); } + + InputStream is = zip.getInputStream(entry); + FileOutputStream ostream = new FileOutputStream(f); + + int size; + byte[] buf = new byte[BUFFER_SIZE]; + while ((size = is.read(buf)) > 0) + ostream.write(buf, 0, size); + is.close(); + ostream.close(); //android.util.Log.d(TAG, "progress: " + processedFiles + // " from " + numberOfFiles); diff --git a/app/src/main/java/com/quran/labs/androidquran/ui/util/ImageAyahUtils.java b/app/src/main/java/com/quran/labs/androidquran/ui/util/ImageAyahUtils.java index 593ec8b085..94aee833be 100644 --- a/app/src/main/java/com/quran/labs/androidquran/ui/util/ImageAyahUtils.java +++ b/app/src/main/java/com/quran/labs/androidquran/ui/util/ImageAyahUtils.java @@ -41,6 +41,7 @@ public static QuranAyah getAyahFromCoordinates( if (coords == null){ return null; } float[] pageXY = imageView.getPageXY(xc, yc); + if (pageXY == null){ return null; } float x = pageXY[0]; float y = pageXY[1]; diff --git a/app/src/main/java/com/quran/labs/androidquran/util/QuranFileUtils.java b/app/src/main/java/com/quran/labs/androidquran/util/QuranFileUtils.java index efb6044a3f..c9126b45cd 100644 --- a/app/src/main/java/com/quran/labs/androidquran/util/QuranFileUtils.java +++ b/app/src/main/java/com/quran/labs/androidquran/util/QuranFileUtils.java @@ -52,6 +52,22 @@ public static void debugLsDir(String dir) { } } + // check if the images with the given width param have a version + // that we specify (ex if version is 3, check for a .v3 file). + public static boolean isVersion(Context context, + String widthParam, int version){ + String quranDirectory = getQuranDirectory(context, widthParam); + if (quranDirectory == null){ return false; } + try { + File vFile = new File(quranDirectory + + File.separator + ".v" + version); + return vFile.exists(); + } + catch (Exception e){ + return false; + } + } + public static boolean haveAllImages(Context context, String widthParam){ String quranDirectory = getQuranDirectory(context, widthParam); if (quranDirectory == null){ return false; } @@ -270,6 +286,11 @@ public static String getZipFileUrl(String widthParam) { url += "images" + widthParam + ".zip"; return url; } + + public static String getPatchFileUrl(String widthParam, int toVersion){ + return IMG_HOST + "patches/patch" + + widthParam + "_v" + toVersion + ".zip"; + } public static String getAyaPositionFileName(){ QuranScreenInfo qsi = QuranScreenInfo.getInstance(); diff --git a/app/src/main/java/com/quran/labs/androidquran/widgets/HighlightingImageView.java b/app/src/main/java/com/quran/labs/androidquran/widgets/HighlightingImageView.java index 0ff07aceae..4fe3acefa4 100644 --- a/app/src/main/java/com/quran/labs/androidquran/widgets/HighlightingImageView.java +++ b/app/src/main/java/com/quran/labs/androidquran/widgets/HighlightingImageView.java @@ -114,9 +114,11 @@ public AyahBounds getYBoundsForCurrentHighlight() { } @Override - public void setImageBitmap(Bitmap bitmap){ - super.setImageBitmap(bitmap); - adjustNightMode(); + public void setImageDrawable(Drawable bitmap){ + super.setImageDrawable(bitmap); + if (bitmap != null){ + adjustNightMode(); + } } public void adjustNightMode() {