Skip to content

Commit

Permalink
subscribe button now match service's main color
Browse files Browse the repository at this point in the history
  • Loading branch information
B0pol committed May 11, 2020
1 parent 80cc8a8 commit 375e18b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
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;
Expand Down Expand Up @@ -374,8 +375,8 @@ private void updateSubscribeButton(final boolean isSubscribed) {
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);
Expand Down
12 changes: 0 additions & 12 deletions app/src/main/res/layout-large-land/fragment_video_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/channel_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
12 changes: 0 additions & 12 deletions app/src/main/res/layout/fragment_video_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 1 addition & 6 deletions app/src/main/res/values/styles_misc.xml
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit 375e18b

Please sign in to comment.