summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2020-04-10 11:21:57 +0200
committerByteHamster <info@bytehamster.com>2020-04-11 11:59:13 +0200
commitcc946f44d739abbdf2160b2588c0bcc510a1823f (patch)
treeb434b3c54bf3475a04c81f6e5106d016370f9515 /core/src
parenta35ecaa74bd9392f9e7e513522aee8e1601e78cf (diff)
downloadAntennaPod-cc946f44d739abbdf2160b2588c0bcc510a1823f.zip
Make colors more consistent
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/assets/shownotes-style.css2
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java20
-rw-r--r--core/src/main/res/drawable/progress_bar_horizontal_dark.xml4
-rw-r--r--core/src/main/res/drawable/progress_bar_horizontal_light.xml4
-rw-r--r--core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml15
-rw-r--r--core/src/main/res/drawable/scrollbar_thumb_dark.xml (renamed from core/src/main/res/drawable/scrollbar_thumb.xml)2
-rw-r--r--core/src/main/res/drawable/scrollbar_thumb_light.xml5
-rw-r--r--core/src/main/res/drawable/scrollbar_thumb_pressed_dark.xml (renamed from core/src/main/res/drawable/scrollbar_thumb_pressed.xml)2
-rw-r--r--core/src/main/res/drawable/scrollbar_thumb_pressed_light.xml14
-rw-r--r--core/src/main/res/values-v21/styles.xml8
-rw-r--r--core/src/main/res/values/attrs.xml1
-rw-r--r--core/src/main/res/values/colors.xml7
-rw-r--r--core/src/main/res/values/ic_launcher_background.xml4
-rw-r--r--core/src/main/res/values/styles.xml30
14 files changed, 54 insertions, 64 deletions
diff --git a/core/src/main/assets/shownotes-style.css b/core/src/main/assets/shownotes-style.css
index d0c8564aa..428945dd6 100644
--- a/core/src/main/assets/shownotes-style.css
+++ b/core/src/main/assets/shownotes-style.css
@@ -12,7 +12,7 @@ a {
font-style: normal;
text-decoration: none;
font-weight: normal;
- color: #00A8DF;
+ color: %s;
}
a.timecode {
color: #669900;
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java
index b59a95cd9..40849a262 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Timeline.java
@@ -53,12 +53,8 @@ public class Timeline {
this.shownotesProvider = shownotesProvider;
noShownotesLabel = context.getString(R.string.no_shownotes_label);
-
- TypedArray res = context.getTheme().obtainStyledAttributes(new int[]{android.R.attr.textColorPrimary});
- @ColorInt int col = res.getColor(0, 0);
- final String colorPrimary = "rgba(" + Color.red(col) + "," + Color.green(col) + ","
- + Color.blue(col) + "," + (Color.alpha(col) / 255.0) + ")";
- res.recycle();
+ final String colorPrimary = colorToHtml(context, android.R.attr.textColorPrimary);
+ final String colorAccent = colorToHtml(context, R.attr.colorAccent);
final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8,
context.getResources().getDisplayMetrics());
String styleString = "";
@@ -68,7 +64,17 @@ public class Timeline {
} catch (IOException e) {
e.printStackTrace();
}
- webviewStyle = String.format(Locale.getDefault(), styleString, colorPrimary, margin, margin, margin, margin);
+ webviewStyle = String.format(Locale.US, styleString, colorPrimary, colorAccent,
+ margin, margin, margin, margin);
+ }
+
+ private String colorToHtml(Context context, int colorAttr) {
+ TypedArray res = context.getTheme().obtainStyledAttributes(new int[]{colorAttr});
+ @ColorInt int col = res.getColor(0, 0);
+ final String color = "rgba(" + Color.red(col) + "," + Color.green(col) + ","
+ + Color.blue(col) + "," + (Color.alpha(col) / 255.0) + ")";
+ res.recycle();
+ return color;
}
/**
diff --git a/core/src/main/res/drawable/progress_bar_horizontal_dark.xml b/core/src/main/res/drawable/progress_bar_horizontal_dark.xml
index 73ad5b37c..7a09fa73f 100644
--- a/core/src/main/res/drawable/progress_bar_horizontal_dark.xml
+++ b/core/src/main/res/drawable/progress_bar_horizontal_dark.xml
@@ -2,13 +2,13 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
- <solid android:color="#33FFFFFF"/>
+ <solid android:color="#19FFFFFF"/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
- <solid android:color="@color/holo_blue_dark"/>
+ <solid android:color="@color/accent_dark"/>
</shape>
</clip>
</item>
diff --git a/core/src/main/res/drawable/progress_bar_horizontal_light.xml b/core/src/main/res/drawable/progress_bar_horizontal_light.xml
index a1a7129e9..b982f522f 100644
--- a/core/src/main/res/drawable/progress_bar_horizontal_light.xml
+++ b/core/src/main/res/drawable/progress_bar_horizontal_light.xml
@@ -2,13 +2,13 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
- <solid android:color="#33212121"/>
+ <solid android:color="#19212121"/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
- <solid android:color="@color/holo_blue_light"/>
+ <solid android:color="@color/accent_light"/>
</shape>
</clip>
</item>
diff --git a/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml b/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml
deleted file mode 100644
index 604bb2655..000000000
--- a/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:id="@android:id/background">
- <shape>
- <solid android:color="#000000"/>
- </shape>
- </item>
- <item android:id="@android:id/progress">
- <clip>
- <shape>
- <solid android:color="@color/holo_blue_dark"/>
- </shape>
- </clip>
- </item>
-</layer-list>
diff --git a/core/src/main/res/drawable/scrollbar_thumb.xml b/core/src/main/res/drawable/scrollbar_thumb_dark.xml
index 4b08668bf..929c03914 100644
--- a/core/src/main/res/drawable/scrollbar_thumb.xml
+++ b/core/src/main/res/drawable/scrollbar_thumb_dark.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true" android:drawable="@drawable/scrollbar_thumb_pressed"/>
+ <item android:state_pressed="true" android:drawable="@drawable/scrollbar_thumb_pressed_dark"/>
<item android:drawable="@drawable/scrollbar_thumb_default"/>
</selector>
diff --git a/core/src/main/res/drawable/scrollbar_thumb_light.xml b/core/src/main/res/drawable/scrollbar_thumb_light.xml
new file mode 100644
index 000000000..a13cfd705
--- /dev/null
+++ b/core/src/main/res/drawable/scrollbar_thumb_light.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true" android:drawable="@drawable/scrollbar_thumb_pressed_light"/>
+ <item android:drawable="@drawable/scrollbar_thumb_default"/>
+</selector>
diff --git a/core/src/main/res/drawable/scrollbar_thumb_pressed.xml b/core/src/main/res/drawable/scrollbar_thumb_pressed_dark.xml
index 4f3ad719e..a1618c5b6 100644
--- a/core/src/main/res/drawable/scrollbar_thumb_pressed.xml
+++ b/core/src/main/res/drawable/scrollbar_thumb_pressed_dark.xml
@@ -7,7 +7,7 @@
</item>
<item android:gravity="end">
<shape android:shape="rectangle">
- <solid android:color="@color/antennapod_blue"/>
+ <solid android:color="@color/accent_dark"/>
<size android:height="4dp" android:width="4dp"/>
</shape>
</item>
diff --git a/core/src/main/res/drawable/scrollbar_thumb_pressed_light.xml b/core/src/main/res/drawable/scrollbar_thumb_pressed_light.xml
new file mode 100644
index 000000000..be684541a
--- /dev/null
+++ b/core/src/main/res/drawable/scrollbar_thumb_pressed_light.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="rectangle">
+ <size android:height="24dp" android:width="24dp"/>
+ </shape>
+ </item>
+ <item android:gravity="end">
+ <shape android:shape="rectangle">
+ <solid android:color="@color/accent_light"/>
+ <size android:height="4dp" android:width="4dp"/>
+ </shape>
+ </item>
+</layer-list>
diff --git a/core/src/main/res/values-v21/styles.xml b/core/src/main/res/values-v21/styles.xml
index 54951b9ec..9f74da348 100644
--- a/core/src/main/res/values-v21/styles.xml
+++ b/core/src/main/res/values-v21/styles.xml
@@ -3,9 +3,11 @@
<style name="Theme.AntennaPod.Light" parent="Theme.Base.AntennaPod.Light">
<item name="android:windowContentTransitions">true</item>
</style>
+
<style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark">
<item name="android:windowContentTransitions">true</item>
</style>
+
<style name="Theme.AntennaPod.TrueBlack" parent="Theme.Base.AntennaPod.TrueBlack">
<item name="android:windowContentTransitions">true</item>
<item name="android:navigationBarColor">@color/black</item>
@@ -13,6 +15,7 @@
<item name="android:colorPrimary">@color/black</item>
<item name="android:colorPrimaryDark">@color/black</item>
</style>
+
<style name="Theme.AntennaPod.TrueBlack.NoTitle" parent="Theme.Base.AntennaPod.TrueBlack.NoTitle">
<item name="android:navigationBarColor">@color/black</item>
<item name="android:colorAccent">@color/white</item>
@@ -20,9 +23,4 @@
<item name="android:colorPrimaryDark">@color/black</item>
</style>
- <style name="Widget.AntennaPod.Button" parent="Widget.AppCompat.Button.Colored">
- <item name="colorButtonNormal">@color/antennapod_blue</item>
- <item name="textAllCaps">true</item>
- </style>
-
</resources> \ No newline at end of file
diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml
index 471e31439..f8b545ac0 100644
--- a/core/src/main/res/values/attrs.xml
+++ b/core/src/main/res/values/attrs.xml
@@ -55,6 +55,7 @@
<attr name="drawer_activated_color" format="color"/>
<attr name="batch_edit_fab_icon" format="reference"/>
<attr name="action_icon_color" format="color"/>
+ <attr name="scrollbar_thumb" format="reference"/>
<declare-styleable name="SquareImageView">
<attr name="direction" format="enum">
diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml
index d3813235f..0937e37e2 100644
--- a/core/src/main/res/values/colors.xml
+++ b/core/src/main/res/values/colors.xml
@@ -6,11 +6,8 @@
<color name="grey600">#757575</color>
<color name="light_gray">#bfbfbf</color>
<color name="black">#000000</color>
- <color name="holo_blue_light">#33B5E5</color>
- <color name="holo_blue_dark">#0099CC</color>
<color name="download_success_green">#248800</color>
<color name="download_failed_red">#B00020</color>
- <color name="new_indicator_green">#669900</color>
<color name="image_readability_tint">#80000000</color>
<color name="feed_image_bg">#50000000</color>
@@ -21,7 +18,9 @@
<color name="highlight_dark">#414141</color>
<color name="highlight_trueblack">#414141</color>
- <color name="antennapod_blue">#147BAF</color>
+ <color name="accent_light">#0078C2</color>
+ <color name="accent_dark">#5C9DFF</color>
+ <color name="ic_launcher_background">#008AB8</color>
<color name="master_switch_background_light">#DDDDDD</color>
<color name="master_switch_background_dark">#191919</color>
diff --git a/core/src/main/res/values/ic_launcher_background.xml b/core/src/main/res/values/ic_launcher_background.xml
deleted file mode 100644
index 3df03b8f4..000000000
--- a/core/src/main/res/values/ic_launcher_background.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <color name="ic_launcher_background">#008AB8</color>
-</resources> \ No newline at end of file
diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml
index 28747df30..3cac01d71 100644
--- a/core/src/main/res/values/styles.xml
+++ b/core/src/main/res/values/styles.xml
@@ -7,11 +7,10 @@
<style name="Theme.Base.AntennaPod.Light" parent="Theme.AppCompat.Light">
<item name="colorPrimary">@color/primary_light</item>
- <item name="colorAccent">@color/holo_blue_light</item>
+ <item name="colorAccent">@color/accent_light</item>
<item name="progressBarTheme">@style/ProgressBarLight</item>
<item name="buttonStyle">@style/Widget.AntennaPod.Button</item>
<item name="android:windowBackground">@color/primary_light</item>
- <item name="alertDialogTheme">@style/AntennaPod.Dialog.Light</item>
<item name="storage">@drawable/ic_storage_black</item>
<item name="ic_network">@drawable/ic_network_black</item>
<item name="statistics">@drawable/ic_statistics_black</item>
@@ -67,6 +66,7 @@
<item name="currently_playing_background">@color/highlight_light</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="action_icon_color">@color/black</item>
+ <item name="scrollbar_thumb">@drawable/scrollbar_thumb_light</item>
</style>
<style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark">
@@ -74,14 +74,13 @@
</style>
<style name="Theme.Base.AntennaPod.Dark" parent="Theme.AppCompat">
- <item name="colorAccent">@color/holo_blue_dark</item>
+ <item name="colorAccent">@color/accent_dark</item>
<item name="colorPrimary">@color/primary_darktheme</item>
<item name="colorPrimaryDark">@color/primary_darktheme</item>
<item name="android:windowBackground">@color/primary_darktheme</item>
<item name="colorControlNormal">@color/white</item>
<item name="buttonStyle">@style/Widget.AntennaPod.Button</item>
<item name="progressBarTheme">@style/ProgressBarDark</item>
- <item name="alertDialogTheme">@style/AntennaPod.Dialog.Dark</item>
<item name="storage">@drawable/ic_storage_white</item>
<item name="ic_network">@drawable/ic_network_white</item>
<item name="statistics">@drawable/ic_statistics_white</item>
@@ -137,6 +136,7 @@
<item name="currently_playing_background">@color/highlight_dark</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="action_icon_color">@color/white</item>
+ <item name="scrollbar_thumb">@drawable/scrollbar_thumb_dark</item>
</style>
<style name="Theme.AntennaPod.TrueBlack" parent="Theme.Base.AntennaPod.TrueBlack">
@@ -144,7 +144,6 @@
</style>
<style name="Theme.Base.AntennaPod.TrueBlack" parent="Theme.Base.AntennaPod.Dark">
- <item name="progressBarTheme">@style/ProgressBarTrueBlack</item>
<item name="batch_edit_fab_icon">@drawable/ic_fab_edit_black</item>
<item name="drawer_activated_color">@color/highlight_trueblack</item>
<item name="android:textColorPrimary">@color/white</item>
@@ -267,24 +266,16 @@
<style name="AntennaPod.TextView.UnreadIndicator" parent="@android:style/TextAppearance.Small">
<item name="android:textSize">@dimen/text_size_micro</item>
- <item name="android:textColor">@color/new_indicator_green</item>
+ <item name="android:textColor">?attr/colorAccent</item>
<item name="android:text">@string/new_label</item>
<item name="android:textAllCaps">true</item>
</style>
<style name="Widget.AntennaPod.Button" parent="Widget.AppCompat.Button.Colored">
- <item name="colorButtonNormal">@color/antennapod_blue</item>
+ <item name="colorButtonNormal">?attr/colorAccent</item>
<item name="textAllCaps">false</item>
</style>
- <style name="AntennaPod.Dialog.Light" parent="Theme.AppCompat.Light.Dialog">
- <item name="colorAccent">@color/holo_blue_light</item>
- </style>
-
- <style name="AntennaPod.Dialog.Dark" parent="Theme.AppCompat.Dialog">
- <item name="colorAccent">@color/holo_blue_dark</item>
- </style>
-
<style name="BigBlurryBackground">
<item name="android:scaleType">centerCrop</item>
<!-- <item name="android:tint">@color/image_readability_tint</item> -->
@@ -303,17 +294,12 @@
<item name="android:progressDrawable">@drawable/progress_bar_horizontal_dark</item>
</style>
- <style name="ProgressBarTrueBlack">
- <item name="android:indeterminateOnly">false</item>
- <item name="android:progressDrawable">@drawable/progress_bar_horizontal_trueblack</item>
- </style>
-
<style name="FastScrollRecyclerView" parent="android:Widget">
<item name="android:scrollbars">none</item>
<item name="fastScrollEnabled">true</item>
- <item name="fastScrollHorizontalThumbDrawable">@drawable/scrollbar_thumb</item>
+ <item name="fastScrollHorizontalThumbDrawable">?attr/scrollbar_thumb</item>
<item name="fastScrollHorizontalTrackDrawable">@drawable/scrollbar_track</item>
- <item name="fastScrollVerticalThumbDrawable">@drawable/scrollbar_thumb</item>
+ <item name="fastScrollVerticalThumbDrawable">?attr/scrollbar_thumb</item>
<item name="fastScrollVerticalTrackDrawable">@drawable/scrollbar_track</item>
</style>