subscribe button now match service's main color

This commit is contained in:
bopol 2020-05-11 19:29:34 +02:00
parent 80cc8a8e02
commit 375e18bec8
6 changed files with 5 additions and 34 deletions

View File

@ -47,6 +47,7 @@ import org.schabi.newpipe.util.ImageDisplayConstants;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ShareUtils;
import org.schabi.newpipe.util.ThemeHelper;
import java.util.ArrayList;
import java.util.Iterator;
@ -374,8 +375,8 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
int backgroundDuration = isButtonVisible ? 300 : 0;
int textDuration = isButtonVisible ? 200 : 0;
int subscribeBackground = ContextCompat
.getColor(activity, R.color.subscribe_background_color);
int subscribeBackground = ThemeHelper
.resolveColorFromAttr(activity, R.attr.colorPrimary);
int subscribeText = ContextCompat.getColor(activity, R.color.subscribe_text_color);
int subscribedBackground = ContextCompat
.getColor(activity, R.color.subscribed_background_color);

View File

@ -313,18 +313,6 @@
tools:text="Uploader" />
</LinearLayout>
<!--<Button
android:id="@+id/detail_uploader_subscribe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:layout_marginRight="12dp"
android:text="@string/rss_button_title"
android:textSize="12sp"
android:theme="@style/RedButton"
android:drawableLeft="@drawable/ic_rss_feed_white_24dp"
tools:ignore="RtlHardcoded"
android:visibility="gone"/>-->
</LinearLayout>
<!-- VIEW & THUMBS -->

View File

@ -108,7 +108,7 @@
android:layout_marginRight="2dp"
android:text="@string/subscribe_button_title"
android:textSize="@dimen/channel_rss_title_size"
android:theme="@style/RedButton"
android:theme="@style/ServiceColoredButton"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />

View File

@ -308,18 +308,6 @@
</LinearLayout>
<!--<Button
android:id="@+id/detail_uploader_subscribe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:layout_marginRight="12dp"
android:text="@string/rss_button_title"
android:textSize="12sp"
android:theme="@style/RedButton"
android:drawableLeft="@drawable/ic_rss_feed_white_24dp"
tools:ignore="RtlHardcoded"
android:visibility="gone"/>-->
</LinearLayout>
<!-- VIEW & THUMBS -->

View File

@ -56,7 +56,6 @@
<color name="background_title_color">#ffffff</color>
<color name="background_subtext_color">#999999</color>
<color name="subscribe_background_color">#e53935</color>
<color name="subscribe_text_color">#fff</color>
<color name="subscribed_background_color">#d6d6d6</color>
<color name="subscribed_text_color">#717171</color>

View File

@ -1,12 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="RedButton" parent="Widget.AppCompat.Button.Colored">
<item name="colorButtonNormal">@color/subscribe_background_color</item>
<item name="android:textColor">@color/subscribe_text_color</item>
<item name="colorControlHighlight">@color/dark_ripple_color</item>
</style>
<!-- Follows service's primary color -->
<style name="ServiceColoredButton" parent="Widget.AppCompat.Button.Colored">
<item name="colorButtonNormal">?attr/colorPrimary</item>
<item name="android:textColor">@color/subscribe_text_color</item>