diff options
author | ByteHamster <info@bytehamster.com> | 2020-02-21 19:16:00 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-02-21 19:16:00 +0100 |
commit | 9d31cdc32f63859a61ea1b63728a95a7ea546f6e (patch) | |
tree | 3823bd7c3acb290ec1c785ecfa9d1b3be9b3b3db | |
parent | b3ea96e7b3d3409a02da64f9e93511cc3400709a (diff) | |
download | AntennaPod-9d31cdc32f63859a61ea1b63728a95a7ea546f6e.zip |
Respect app theme
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/view/PlaybackSpeedIndicatorView.java | 17 | ||||
-rw-r--r-- | core/src/main/res/values/attrs.xml | 1 | ||||
-rw-r--r-- | core/src/main/res/values/styles.xml | 3 |
3 files changed, 14 insertions, 7 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/view/PlaybackSpeedIndicatorView.java b/app/src/main/java/de/danoeh/antennapod/view/PlaybackSpeedIndicatorView.java index 4b20cc0de..54731a412 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/PlaybackSpeedIndicatorView.java +++ b/app/src/main/java/de/danoeh/antennapod/view/PlaybackSpeedIndicatorView.java @@ -1,14 +1,15 @@ package de.danoeh.antennapod.view; import android.content.Context; +import android.content.res.TypedArray; import android.graphics.Canvas; -import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; import android.util.AttributeSet; import android.view.View; import androidx.annotation.Nullable; +import de.danoeh.antennapod.R; public class PlaybackSpeedIndicatorView extends View { private static final float DEG_2_RAD = (float) (Math.PI / 180); @@ -39,13 +40,17 @@ public class PlaybackSpeedIndicatorView extends View { } private void setup() { + int[] colorAttrs = new int[] {R.attr.action_icon_color }; + TypedArray a = getContext().obtainStyledAttributes(colorAttrs); + arcPaint.setColor(a.getColor(0, 0xffffffff)); + indicatorPaint.setColor(a.getColor(0, 0xffffffff)); + a.recycle(); + arcPaint.setAntiAlias(true); - arcPaint.setColor(Color.GRAY); arcPaint.setStyle(Paint.Style.STROKE); arcPaint.setStrokeCap(Paint.Cap.ROUND); indicatorPaint.setAntiAlias(true); - indicatorPaint.setColor(Color.GRAY); indicatorPaint.setStyle(Paint.Style.FILL); trianglePath.setFillType(Path.FillType.EVEN_ODD); @@ -67,15 +72,15 @@ public class PlaybackSpeedIndicatorView extends View { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); - paddingArc = getMeasuredHeight() / 5f; - paddingIndicator = getMeasuredHeight() / 10f; + paddingArc = getMeasuredHeight() / 4.5f; + paddingIndicator = getMeasuredHeight() / 6f; } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); - float radiusInnerCircle = getWidth() / 8f; + float radiusInnerCircle = getWidth() / 10f; canvas.drawCircle(getWidth() / 2f, getHeight() / 2f, radiusInnerCircle, indicatorPaint); trianglePath.rewind(); diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index aa93398f5..deeb0fa10 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -61,6 +61,7 @@ <attr name="nav_drawer_background" format="color"/> <attr name="drawer_activated_color" format="color"/> <attr name="batch_edit_fab_icon" format="reference"/> + <attr name="action_icon_color" format="color"/> <declare-styleable name="SquareImageView"> <attr name="useMinimum" format="boolean" /> diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 9f72c9f6f..03309b523 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -70,8 +70,8 @@ <item name="ic_volume_adaption">@drawable/ic_volume_adaption_grey</item> <item name="master_switch_background">@color/master_switch_background_light</item> <item name="currently_playing_background">@color/highlight_light</item> - <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> + <item name="action_icon_color">#FF757575</item> </style> <style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark"> @@ -146,6 +146,7 @@ <item name="master_switch_background">@color/master_switch_background_dark</item> <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> </style> <style name="Theme.AntennaPod.TrueBlack" parent="Theme.Base.AntennaPod.TrueBlack"> |