Make colors more consistent

This commit is contained in:
ByteHamster 2020-04-10 11:21:57 +02:00
parent a35ecaa74b
commit cc946f44d7
17 changed files with 56 additions and 75 deletions

View File

@ -109,7 +109,7 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@id/butNavUp"
android:background="@color/holo_blue_light" />
android:background="?android:attr/dividerHorizontal" />
</RelativeLayout>
<ListView

View File

@ -37,7 +37,7 @@
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
app:backgroundColor="@color/antennapod_blue"
app:backgroundColor="?attr/colorAccent"
app:corner="rightTop"
app:primaryText="Test"
app:primaryTextColor="@color/white"

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:background="?android:attr/listDivider"
tools:background="@android:color/holo_red_dark" />

View File

@ -12,7 +12,7 @@ a {
font-style: normal;
text-decoration: none;
font-weight: normal;
color: #00A8DF;
color: %s;
}
a.timecode {
color: #669900;

View File

@ -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;
}
/**

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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">

View File

@ -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>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#008AB8</color>
</resources>

View File

@ -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>