From 0bff6d1f3aa446dd7945ae88cbec19f0614c3828 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Mon, 27 Apr 2020 00:38:15 +0530 Subject: [PATCH] Add colors in About page --- app/src/main/assets/retro-changelog.html | 70 ++++++++++++++++++- .../activities/WhatsNewActivity.java | 16 ++--- app/src/main/res/layout/card_credit.xml | 8 ++- app/src/main/res/layout/card_other.xml | 7 +- app/src/main/res/layout/card_retro_info.xml | 11 +-- app/src/main/res/layout/card_social.xml | 7 +- app/src/main/res/values/dimens.xml | 1 + .../res/values/colors_material_design.xml | 18 ++--- 8 files changed, 103 insertions(+), 35 deletions(-) diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index c3771c48..742042f0 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1,69 @@ -

v3.5.010

v3.4.970

v3.4.900

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file + + + + + + + +

v3.5.100

+ Internal version +

What's new?

+ +

Improvements and fixed issues

+ +

*If you face any UI related issues you clear app data and cache, if itsnot working try to uninstall and install + again.

+ \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java b/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java index 631db15c..450d17b4 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java @@ -19,6 +19,7 @@ import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import java.util.Locale; import code.name.monkey.appthemehelper.ThemeStore; import code.name.monkey.appthemehelper.util.ATHUtil; @@ -37,8 +38,8 @@ public class WhatsNewActivity extends AbsBaseActivity { WebView webView; private static String colorToCSS(int color) { - return String.format("rgb(%d, %d, %d)", Color.red(color), Color.green(color), - Color.blue(color)); // on API 29, WebView doesn't load with hex colors + return String.format(Locale.getDefault(),"rgba(%d, %d, %d, %d)", Color.red(color), Color.green(color), + Color.blue(color), Color.alpha(color)); // on API 29, WebView doesn't load with hex colors } private static void setChangelogRead(@NonNull Context context) { @@ -83,16 +84,13 @@ public class WhatsNewActivity extends AbsBaseActivity { // Inject color values for WebView body background and links final boolean isDark = ATHUtil.INSTANCE.isWindowBackgroundDark(this); - final String backgroundColor = colorToCSS(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface, - Color.parseColor(isDark ? "#424242" : "#ffffff"))); + final String backgroundColor = colorToCSS(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface, Color.parseColor(isDark ? "#424242" : "#ffffff"))); final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000")); + final String textColor = colorToCSS(Color.parseColor(isDark ? "#60FFFFFF" : "#80000000")); final String changeLog = buf.toString() - .replace("{style-placeholder}", - String.format("body { background-color: %s; color: %s; }", backgroundColor, contentColor)) + .replace("{style-placeholder}", String.format("body { background-color: %s; color: %s; } li {color: %s;}", backgroundColor, contentColor, textColor)) .replace("{link-color}", colorToCSS(ThemeStore.Companion.accentColor(this))) - .replace("{link-color-active}", - colorToCSS(ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this)))); - + .replace("{link-color-active}", colorToCSS(ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this)))); webView.loadData(changeLog, "text/html", "UTF-8"); } catch (Throwable e) { webView.loadData("

Unable to load

" + e.getLocalizedMessage() + "

", "text/html", "UTF-8"); diff --git a/app/src/main/res/layout/card_credit.xml b/app/src/main/res/layout/card_credit.xml index 1d4533f0..84ad5916 100644 --- a/app/src/main/res/layout/card_credit.xml +++ b/app/src/main/res/layout/card_credit.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - app:cardCornerRadius="8dp" + app:cardBackgroundColor="@color/md_blue_100" + app:cardCornerRadius="@dimen/about_card_radius" app:cardUseCompatPadding="true"> - - - - 3dp 48dp 12dp + 16dp diff --git a/appthemehelper/src/main/res/values/colors_material_design.xml b/appthemehelper/src/main/res/values/colors_material_design.xml index 7f6dd2e4..71802a27 100755 --- a/appthemehelper/src/main/res/values/colors_material_design.xml +++ b/appthemehelper/src/main/res/values/colors_material_design.xml @@ -7,15 +7,10 @@ #F44336 #FF1744 - - - #FFD600 - - - #651FFF + #9575CD #7E57C2 #5E35B1 @@ -24,15 +19,12 @@ #673AB7 #7C4DFF - - - + #BBDEFB #2196F3 #448AFF #2979FF - #69F0AE #00C853 #4CAF50 @@ -44,11 +36,15 @@ #424242 #212121 - #000000 #FFFFFF #40FFFFFF + #C8E6C9 + #DCEDC8 + #C5CAE9 + #E1BEE7 + #D1C4E9 #1DE9B6 #FF3D00