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
+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>