Skip to content

Commit

Permalink
Merge pull request #6456 from TeamNewPipe/feature/switch-theme
Browse files Browse the repository at this point in the history
Apply theme to switches
  • Loading branch information
Stypox authored Jul 18, 2021
2 parents baa12c7 + 272d589 commit 6c25ce5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
31 changes: 17 additions & 14 deletions app/src/main/res/layout/related_items_header.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/channel_header_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">

<TextView
android:id="@+id/next_stream_title"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/autoplay_switch"
android:layout_marginLeft="12dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@string/exo_controls_next_description"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12sp"
tools:ignore="RtlHardcoded" />
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/autoplay_switch"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Switch
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/autoplay_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:paddingRight="5dp"
android:switchPadding="5dp"
android:layout_marginEnd="16dp"
android:text="@string/auto_queue_toggle"
android:textColor="@android:color/tab_indicator_text"
android:textSize="12sp" />
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
19 changes: 19 additions & 0 deletions app/src/main/res/values-v21/styles_services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,23 @@
<item name="colorAccent">@color/dark_media_ccc_accent_color</item>
</style>

<!-- Bandcamp -->
<style name="LightTheme.Bandcamp" parent="LightTheme">
<item name="colorPrimary">@color/light_bandcamp_primary_color</item>
<item name="colorPrimaryDark">@color/light_bandcamp_statusbar_color</item>
<item name="colorAccent">@color/light_bandcamp_accent_color</item>
</style>

<style name="DarkTheme.Bandcamp" parent="DarkTheme">
<item name="colorPrimary">@color/dark_bandcamp_primary_color</item>
<item name="colorPrimaryDark">@color/dark_bandcamp_statusbar_color</item>
<item name="colorAccent">@color/dark_bandcamp_accent_color</item>
</style>

<style name="BlackTheme.Bandcamp" parent="BlackTheme">
<item name="colorPrimary">@color/dark_bandcamp_primary_color</item>
<item name="colorPrimaryDark">@color/dark_bandcamp_statusbar_color</item>
<item name="colorAccent">@color/dark_bandcamp_accent_color</item>
</style>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<item name="floatingActionButtonStyle">@style/FloatingActionButtonTheme</item>
<item name="toolbarSearchColor">@color/white</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="colorControlActivated">?attr/colorPrimary</item>
</style>
<style name="Base" parent="Base.V19"/>

Expand Down

0 comments on commit 6c25ce5

Please sign in to comment.