From 413e3fd414fd846b5a649c27b716ad365f7653e9 Mon Sep 17 00:00:00 2001 From: rajput2122 Date: Tue, 3 Sep 2019 00:34:57 +0530 Subject: [PATCH 1/2] Kiwix banner is now under scrollable region and All --- .../res/drawable-hdpi/ic_pause_black_24dp.png | Bin 102 -> 0 bytes .../res/drawable-hdpi/ic_stop_black_24dp.png | Bin 91 -> 0 bytes .../res/drawable-mdpi/ic_pause_black_24dp.png | Bin 81 -> 0 bytes .../res/drawable-mdpi/ic_stop_black_24dp.png | Bin 82 -> 0 bytes .../drawable-xhdpi/ic_pause_black_24dp.png | Bin 101 -> 0 bytes .../res/drawable-xhdpi/ic_stop_black_24dp.png | Bin 99 -> 0 bytes .../res/drawable-xxhdpi/ic_action_back.png | Bin 556 -> 0 bytes .../res/drawable-xxhdpi/ic_action_delete.png | Bin 853 -> 0 bytes .../res/drawable-xxhdpi/ic_action_forward.png | Bin 537 -> 0 bytes .../res/drawable-xxhdpi/ic_action_plus.png | Bin 267 -> 0 bytes .../drawable-xxhdpi/ic_pause_black_24dp.png | Bin 109 -> 0 bytes .../drawable-xxhdpi/ic_stop_black_24dp.png | Bin 111 -> 0 bytes .../drawable-xxxhdpi/ic_pause_black_24dp.png | Bin 111 -> 0 bytes .../drawable-xxxhdpi/ic_stop_black_24dp.png | Bin 112 -> 0 bytes app/src/main/res/drawable/ic_action_back.xml | 9 ++ .../main/res/drawable/ic_action_delete.xml | 9 ++ .../main/res/drawable/ic_action_forward.xml | 9 ++ app/src/main/res/drawable/ic_action_plus.xml | 9 ++ .../main/res/drawable/ic_pause_black_24dp.xml | 9 ++ .../main/res/drawable/ic_stop_black_24dp.xml | 9 ++ app/src/main/res/layout/content_main.xml | 95 +++++++++--------- app/src/main/res/layout/download_item.xml | 5 +- 22 files changed, 105 insertions(+), 49 deletions(-) delete mode 100644 app/src/main/res/drawable-hdpi/ic_pause_black_24dp.png delete mode 100644 app/src/main/res/drawable-hdpi/ic_stop_black_24dp.png delete mode 100644 app/src/main/res/drawable-mdpi/ic_pause_black_24dp.png delete mode 100644 app/src/main/res/drawable-mdpi/ic_stop_black_24dp.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_pause_black_24dp.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_stop_black_24dp.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_back.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_delete.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_forward.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_plus.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_pause_black_24dp.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_stop_black_24dp.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/ic_pause_black_24dp.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/ic_stop_black_24dp.png create mode 100644 app/src/main/res/drawable/ic_action_back.xml create mode 100644 app/src/main/res/drawable/ic_action_delete.xml create mode 100644 app/src/main/res/drawable/ic_action_forward.xml create mode 100644 app/src/main/res/drawable/ic_action_plus.xml create mode 100644 app/src/main/res/drawable/ic_pause_black_24dp.xml create mode 100644 app/src/main/res/drawable/ic_stop_black_24dp.xml diff --git a/app/src/main/res/drawable-hdpi/ic_pause_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_pause_black_24dp.png deleted file mode 100644 index 3539b4ef1f0ea5dff36c9521d9fbed0fa0600d6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;uBVG*NCjiE1MA`h5fcRkyTU^c x?3o@3F5mCCn5|dJB|k0wldT1B8K;lBbJfNCjiE#G3?>o~HjT4^J3n oTv-sOV diff --git a/app/src/main/res/drawable-mdpi/ic_pause_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_pause_black_24dp.png deleted file mode 100644 index 6145664b4ba3f2b0009bd20d8226e6468746e658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 81 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7~Txo-U3d6^zLetp61S=GqrXxtaE4 cNxWoWkeZM`asBSlc%T{vPgg&ebxsLQ0ES)@KL7v# diff --git a/app/src/main/res/drawable-mdpi/ic_stop_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_stop_black_24dp.png deleted file mode 100644 index 0588f0b4cf92eca1c16aa65c47550dddf8a39099..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1NlzEYkP60R1<9VK{}u{-2CEW7 em^%|h7#LjB`wN$O|Lg=RV(@hJb6Mw<&;$UT`4g=G diff --git a/app/src/main/res/drawable-xhdpi/ic_pause_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_pause_black_24dp.png deleted file mode 100644 index 74068eae0d0121441c8c15b9437c91b3faa012df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}t9Zwg>kP61PXBGJv7&w>>|NYOr vpwSdtHCcG=3ze_;ezP+$lmnFk!KFziX4m!waNe;`1aUoG{an^LB{Ts5hM^k< diff --git a/app/src/main/res/drawable-xhdpi/ic_stop_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_stop_black_24dp.png deleted file mode 100644 index b002ab78c9e23934f3efb6077312bbb948e21c8c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 99 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tEl(H6kP61PXB~MN7&wj?{F%+h syXV2AGN!OSY+sC+A)xuoLE8q#b^mSedpm4T2kK(*boFyt=akR{06NMVRR910 diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_back.png b/app/src/main/res/drawable-xxhdpi/ic_action_back.png deleted file mode 100644 index 149909437b15c8e0ded28c7ad60a4dc54a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(2MM7>;`1dju?EJ2#ECOqnGs6h-Pjv|C{_-`D&6G!_&W?WQNb?GNb;uD|v z9k2N=%*wdiacN@Seg4kHxdWMS4O!v^;-f?HWjnH+)7j_8!AZ7b!X-ZOi7(rc?IeyD z+B96*&hhv8vYi~bZDmiEA2)98xe3JYD0Xo3?##sI8h1Fdos9SchaTWBOaK4?00000 bU?}_mfJpu|+TpSZ00000NkvXXu0mjfN$Tz7 diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_plus.png b/app/src/main/res/drawable-xxhdpi/ic_action_plus.png deleted file mode 100644 index 75402a9f445f6b4f461276bc32bf355f8ce7a5bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGompok@Ln>~)y?cC~b3?D?{J$~h*$M@~ICd`oC{=MqIQ^6ezD+G&hH zhd{vr4hFNNx#mfIN^@9|gkjQP8r@)X#y^K#Aa0vfcayKzXj_PdP}Me&T2EI$mvv4F FO#nZEMK1sV diff --git a/app/src/main/res/drawable-xxhdpi/ic_pause_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_pause_black_24dp.png deleted file mode 100644 index bb707eab97b3d48167a29bb8c21fc02cf582ffac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 109 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xf3?%cF6 + + diff --git a/app/src/main/res/drawable/ic_action_delete.xml b/app/src/main/res/drawable/ic_action_delete.xml new file mode 100644 index 000000000..39e64d698 --- /dev/null +++ b/app/src/main/res/drawable/ic_action_delete.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_action_forward.xml b/app/src/main/res/drawable/ic_action_forward.xml new file mode 100644 index 000000000..cf9e208e6 --- /dev/null +++ b/app/src/main/res/drawable/ic_action_forward.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_action_plus.xml b/app/src/main/res/drawable/ic_action_plus.xml new file mode 100644 index 000000000..0258249cc --- /dev/null +++ b/app/src/main/res/drawable/ic_action_plus.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_pause_black_24dp.xml b/app/src/main/res/drawable/ic_pause_black_24dp.xml new file mode 100644 index 000000000..bb28a6c41 --- /dev/null +++ b/app/src/main/res/drawable/ic_pause_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_stop_black_24dp.xml b/app/src/main/res/drawable/ic_stop_black_24dp.xml new file mode 100644 index 000000000..c428d728d --- /dev/null +++ b/app/src/main/res/drawable/ic_stop_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index f54ac79f1..03add67ef 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -1,63 +1,64 @@ - + + + android:layout_height="match_parent"> + android:id="@+id/content_main_card" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="8dp" + app:cardCornerRadius="4dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:id="@+id/content_main_card_image" + android:layout_width="0dp" + android:layout_height="144dp" + android:contentDescription="@string/kiwi" + android:scaleType="fitXY" + android:src="@drawable/ic_home_kiwix_banner" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:id="@+id/content_main_card_download_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="@dimen/activity_horizontal_margin" + android:text="@string/download_books" + android:textColor="@android:color/white" + app:backgroundTint="#1565c0" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintRight_toRightOf="parent" /> - + android:id="@+id/recycler_view" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/content_main_card" /> + + + diff --git a/app/src/main/res/layout/download_item.xml b/app/src/main/res/layout/download_item.xml index 6c1f14ea1..47734aaa7 100644 --- a/app/src/main/res/layout/download_item.xml +++ b/app/src/main/res/layout/download_item.xml @@ -1,6 +1,7 @@ From fc9f150987cb0f981afc9305eef9aaab4f6b2d7d Mon Sep 17 00:00:00 2001 From: Justin Biggs Date: Wed, 4 Sep 2019 20:07:15 -0500 Subject: [PATCH 2/2] #563 moved play store variables to isolate them within their only used class. --- .../kiwix/kiwixmobile/main/MainActivity.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/kiwix/kiwixmobile/main/MainActivity.java b/app/src/main/java/org/kiwix/kiwixmobile/main/MainActivity.java index 1bbb24dcc..f8c906329 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/main/MainActivity.java +++ b/app/src/main/java/org/kiwix/kiwixmobile/main/MainActivity.java @@ -164,8 +164,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback, public static boolean refresh; public static boolean wifiOnly; public static boolean nightMode; - private static Uri KIWIX_LOCAL_MARKET_URI; - private static Uri KIWIX_BROWSER_MARKET_URI; private final ArrayList bookmarks = new ArrayList<>(); private final List webViewList = new ArrayList<>(); @BindView(R.id.activity_main_root) @@ -351,7 +349,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback, checkForRateDialog(); - initPlayStoreUri(); isHideToolbar = sharedPreferenceUtil.getPrefHideToolbar(); addFileReader(); @@ -591,12 +588,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback, drawerLayout.openDrawer(GravityCompat.END); } - private void initPlayStoreUri() { - KIWIX_LOCAL_MARKET_URI = Uri.parse("market://details?id=" + getPackageName()); - KIWIX_BROWSER_MARKET_URI = - Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName()); - } - private void checkForRateDialog() { isFirstRun = sharedPreferenceUtil.getPrefIsFirstRun(); visitCounterPref = new RateAppCounter(this); @@ -648,8 +639,12 @@ public class MainActivity extends BaseActivity implements WebViewCallback, } private void goToRateApp() { + Uri kiwixLocalMarketUri = Uri.parse("market://details?id=" + getPackageName()); + Uri kiwixBrowserMarketUri = + Uri.parse("http://play.google.com/store/apps/details?id=" + getPackageName()); - Intent goToMarket = new Intent(Intent.ACTION_VIEW, KIWIX_LOCAL_MARKET_URI); + + Intent goToMarket = new Intent(Intent.ACTION_VIEW, kiwixLocalMarketUri); goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | @@ -659,7 +654,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback, startActivity(goToMarket); } catch (ActivityNotFoundException e) { startActivity(new Intent(Intent.ACTION_VIEW, - KIWIX_BROWSER_MARKET_URI)); + kiwixBrowserMarketUri)); } }