home: add tab customization

Finally add tab customization. This implementation is a
bit ugly, but I had to futureproof it for playlists and I'm
planning to clean up a lot of the duplicate code across the app.

This addition notably allows a default tab to be set, which is
something that was widely requested in #12. This UI rework finally
allows it to be added.
This commit is contained in:
OxygenCobalt
2021-10-17 20:27:16 -06:00
parent a253cfccc4
commit 23d1be8ebc
39 changed files with 687 additions and 203 deletions
@@ -11,7 +11,6 @@
android:paddingTop="@dimen/spacing_medium"
android:paddingStart="@dimen/spacing_small"
android:paddingEnd="@dimen/spacing_small"
android:paddingBottom="@dimen/spacing_small"
app:layoutManager="org.oxycblt.auxio.accent.AutoGridLayoutManager"
app:layout_constraintBottom_toTopOf="@+id/accent_cancel"
app:layout_constraintTop_toBottomOf="@+id/accent_header"
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/tab_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:paddingTop="@dimen/spacing_medium"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="@+id/accent_cancel"
app:layout_constraintTop_toBottomOf="@+id/accent_header"
tools:itemCount="5"
tools:listitem="@layout/item_tab" />
</layout>
+2 -2
View File
@@ -15,7 +15,7 @@
app:liftOnScroll="true"
app:liftOnScrollTargetViewId="@id/search_recycler">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/search_toolbar"
style="@style/Widget.Auxio.Toolbar.Icon"
app:menu="@menu/menu_search">
@@ -43,7 +43,7 @@
</com.google.android.material.textfield.TextInputLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.MaterialToolbar>
</org.oxycblt.auxio.ui.LiftAppBarLayout>
+1 -1
View File
@@ -91,7 +91,7 @@
android:src="@drawable/ic_handle"
app:layout_constraintBottom_toBottomOf="@+id/album_cover"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/song_name" />
app:layout_constraintTop_toTopOf="@+id/album_cover" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
style="@style/Widget.Auxio.ItemLayout"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:padding="0dp">
<ImageView
android:id="@+id/tab_icon"
android:scaleType="fitCenter"
android:padding="@dimen/spacing_small"
android:layout_width="@dimen/size_btn_small"
android:layout_height="@dimen/size_btn_small"
android:layout_margin="@dimen/spacing_small"
android:src="@drawable/ic_artist"
app:tint="@color/sel_accented"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="contentDescription" />
<TextView
android:id="@+id/tab_name"
style="@style/Widget.Auxio.TextView.Item.Primary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_medium"
android:gravity="center"
android:maxLines="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/tab_icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="Artist" />
<ImageView
android:id="@+id/tab_drag_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:contentDescription="@string/desc_tab_handle"
android:focusable="true"
android:minWidth="@dimen/size_btn_small"
android:minHeight="@dimen/size_btn_small"
android:paddingStart="@dimen/spacing_medium"
android:paddingEnd="@dimen/spacing_medium"
android:scaleType="center"
android:src="@drawable/ic_handle"
app:layout_constraintBottom_toBottomOf="@+id/tab_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tab_icon" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
+2 -2
View File
@@ -8,7 +8,7 @@
android:theme="@style/Theme.Widget"
tools:ignore="Overdraw">
<ImageView
<android.widget.ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.3"
@@ -16,7 +16,7 @@
android:scaleType="centerCrop"
android:src="@drawable/ic_song" />
<TextView
<android.widget.TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
+12 -12
View File
@@ -7,7 +7,7 @@
android:background="?attr/colorSurface"
android:theme="@style/Theme.Widget">
<ImageView
<android.widget.ImageView
android:id="@+id/widget_cover"
android:layout_width="match_parent"
android:layout_height="0dp"
@@ -16,29 +16,29 @@
android:scaleType="centerCrop"
android:src="@drawable/ic_song" />
<LinearLayout style="@style/Widget.Auxio.AppWidget.Panel">
<android.widget.LinearLayout style="@style/Widget.Auxio.AppWidget.Panel">
<TextView
<android.widget.TextView
android:id="@+id/widget_song"
style="@style/Widget.Auxio.TextView.Primary.AppWidget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/def_widget_song" />
<TextView
<android.widget.TextView
android:id="@+id/widget_artist"
style="@style/Widget.Auxio.TextView.Secondary.AppWidget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/def_widget_artist" />
<LinearLayout
<android.widget.LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_medium"
android:orientation="horizontal">
<ImageButton
<android.widget.ImageButton
android:id="@+id/widget_loop"
style="@style/Widget.Auxio.Button.AppWidget"
android:layout_weight="1"
@@ -47,7 +47,7 @@
android:contentDescription="@string/desc_change_loop"
android:src="@drawable/ic_loop" />
<ImageButton
<android.widget.ImageButton
android:id="@+id/widget_skip_prev"
android:layout_weight="1"
style="@style/Widget.Auxio.Button.AppWidget"
@@ -56,7 +56,7 @@
android:contentDescription="@string/desc_skip_prev"
android:src="@drawable/ic_skip_prev" />
<ImageButton
<android.widget.ImageButton
android:id="@+id/widget_play_pause"
android:layout_weight="1"
style="@style/Widget.Auxio.Button.AppWidget"
@@ -65,7 +65,7 @@
android:contentDescription="@string/desc_play_pause"
android:src="@drawable/sel_playing_state" />
<ImageButton
<android.widget.ImageButton
android:id="@+id/widget_skip_next"
android:layout_weight="1"
style="@style/Widget.Auxio.Button.AppWidget"
@@ -74,7 +74,7 @@
android:contentDescription="@string/desc_skip_next"
android:src="@drawable/ic_skip_next" />
<ImageButton
<android.widget.ImageButton
android:id="@+id/widget_shuffle"
style="@style/Widget.Auxio.Button.AppWidget"
android:layout_weight="1"
@@ -83,8 +83,8 @@
android:contentDescription="@string/desc_shuffle"
android:src="@drawable/ic_shuffle" />
</LinearLayout>
</android.widget.LinearLayout>
</LinearLayout>
</android.widget.LinearLayout>
</LinearLayout>
+10 -10
View File
@@ -7,7 +7,7 @@
android:background="?attr/colorSurface"
android:theme="@style/Theme.Widget">
<ImageView
<android.widget.ImageView
android:id="@+id/widget_cover"
android:layout_width="match_parent"
android:layout_height="0dp"
@@ -16,28 +16,28 @@
android:scaleType="centerCrop"
android:src="@drawable/ic_song" />
<LinearLayout style="@style/Widget.Auxio.AppWidget.Panel">
<android.widget.LinearLayout style="@style/Widget.Auxio.AppWidget.Panel">
<TextView
<android.widget.TextView
android:id="@+id/widget_song"
style="@style/Widget.Auxio.TextView.Primary.AppWidget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/def_widget_song" />
<TextView
<android.widget.TextView
android:id="@+id/widget_artist"
style="@style/Widget.Auxio.TextView.Secondary.AppWidget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/def_widget_artist" />
<LinearLayout
<android.widget.LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_medium">
<ImageButton
<android.widget.ImageButton
android:id="@+id/widget_skip_prev"
style="@style/Widget.Auxio.Button.AppWidget"
android:layout_weight="1"
@@ -46,7 +46,7 @@
android:contentDescription="@string/desc_skip_prev"
android:src="@drawable/ic_skip_prev" />
<ImageButton
<android.widget.ImageButton
android:id="@+id/widget_play_pause"
style="@style/Widget.Auxio.Button.AppWidget"
android:layout_weight="1"
@@ -55,7 +55,7 @@
android:contentDescription="@string/desc_play_pause"
android:src="@drawable/ic_play" />
<ImageButton
<android.widget.ImageButton
android:id="@+id/widget_skip_next"
style="@style/Widget.Auxio.Button.AppWidget"
android:layout_weight="1"
@@ -64,8 +64,8 @@
android:contentDescription="@string/desc_skip_next"
android:src="@drawable/ic_skip_next" />
</LinearLayout>
</android.widget.LinearLayout>
</LinearLayout>
</android.widget.LinearLayout>
</LinearLayout>