ui: create viewmodel for navigation
Create a ViewModel for the more complicated navigation pathways. Normally, navigation was fragmented along a complicated stretch of fragment hacks and DetailViewModel's navToItem attitbute, both of which were not really that ideal. Dumpster them for a single, unified viewmodel for the more complicated navigation situations. This removes much of the duplicate navigation logic and is likely much more maintainable for future situations.
This commit is contained in:
@@ -94,6 +94,7 @@
|
||||
app:thumbRadius="@dimen/slider_thumb_radius" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_position"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
@@ -105,6 +106,7 @@
|
||||
tools:text="11:38" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_small_inv"
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
app:thumbRadius="@dimen/slider_thumb_radius" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_position"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
@@ -103,6 +104,7 @@
|
||||
tools:text="11:38" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_small_inv"
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
app:thumbRadius="@dimen/slider_thumb_radius" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_position"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
@@ -92,6 +93,7 @@
|
||||
tools:text="11:38" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_small_inv"
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
app:thumbRadius="@dimen/slider_thumb_radius" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_position"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
@@ -105,6 +106,7 @@
|
||||
tools:text="11:38" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_small_inv"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<androidx.recyclerview.widget.RecyclerView 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"
|
||||
android:id="@+id/accent_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/spacing_small">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/excluded_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
@@ -19,6 +19,7 @@
|
||||
tools:listitem="@layout/item_excluded_dir" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/excluded_empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/spacing_medium"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<androidx.recyclerview.widget.RecyclerView 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"
|
||||
android:id="@+id/tab_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
|
||||
@@ -8,16 +8,19 @@
|
||||
tools:context=".settings.AboutFragment">
|
||||
|
||||
<org.oxycblt.auxio.ui.EdgeAppBarLayout
|
||||
android:id="@+id/about_appbar"
|
||||
style="@style/Widget.Auxio.AppBarLayout"
|
||||
app:liftOnScroll="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/about_toolbar"
|
||||
style="@style/Widget.Auxio.Toolbar.Icon"
|
||||
app:title="@string/lbl_about" />
|
||||
|
||||
</org.oxycblt.auxio.ui.EdgeAppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/about_contents"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<org.oxycblt.auxio.detail.DetailAppBarLayout
|
||||
android:id="@+id/detail_appbar"
|
||||
style="@style/Widget.Auxio.AppBarLayout"
|
||||
app:liftOnScroll="true"
|
||||
app:liftOnScrollTargetViewId="@id/detail_recycler">
|
||||
|
||||
@@ -6,15 +6,18 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<org.oxycblt.auxio.ui.EdgeAppBarLayout
|
||||
android:id="@+id/home_appbar"
|
||||
style="@style/Widget.Auxio.AppBarLayout"
|
||||
app:liftOnScroll="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/home_toolbar"
|
||||
style="@style/Widget.Auxio.Toolbar"
|
||||
app:menu="@menu/menu_home"
|
||||
app:title="@string/info_app_name" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/home_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
@@ -40,6 +43,7 @@
|
||||
app:layout_anchorGravity="bottom|end">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/home_fab"
|
||||
style="@style/Widget.Auxio.FloatingActionButton.Adaptive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<org.oxycblt.auxio.home.fastscroll.FastScrollRecyclerView 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"
|
||||
style="@style/Widget.Auxio.RecyclerView.WithAdaptiveFab"
|
||||
android:id="@+id/home_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<org.oxycblt.auxio.ui.BottomSheetLayout
|
||||
android:id="@+id/bottom_sheet_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -32,6 +33,7 @@
|
||||
</org.oxycblt.auxio.ui.BottomSheetLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_too_small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurface"
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
app:thumbRadius="@dimen/slider_thumb_radius" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_position"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/spacing_medium"
|
||||
@@ -89,6 +90,7 @@
|
||||
tools:text="11:38" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/playback_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_small_inv"
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
app:liftOnScrollTargetViewId="@id/queue_recycler">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/queue_toolbar"
|
||||
style="@style/Widget.Auxio.Toolbar.Icon.Down"
|
||||
android:elevation="0dp"
|
||||
app:navigationIcon="@drawable/ic_down"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
app:liftOnScrollTargetViewId="@id/search_recycler">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/search_toolbar"
|
||||
style="@style/Widget.Auxio.Toolbar.Icon"
|
||||
app:menu="@menu/menu_search">
|
||||
|
||||
@@ -25,6 +26,7 @@
|
||||
app:hintEnabled="false">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/search_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
|
||||
@@ -7,12 +7,14 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.oxycblt.auxio.ui.EdgeAppBarLayout
|
||||
android:id="@+id/settings_appbar"
|
||||
style="@style/Widget.Auxio.AppBarLayout"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:liftOnScroll="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/settings_toolbar"
|
||||
style="@style/Widget.Auxio.Toolbar.Icon"
|
||||
app:title="@string/set_title" />
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
android:theme="@style/ThemeOverlay.Accent">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/accent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
view. The way we do this is odd, but it's designed this way-->
|
||||
|
||||
<org.oxycblt.auxio.coil.StyledImageView
|
||||
android:id="@+id/song_track_bg"
|
||||
style="@style/Widget.Auxio.Image.Small"
|
||||
android:src="@drawable/ic_song"
|
||||
android:scaleType="matrix"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
android:padding="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/excluded_path"
|
||||
style="@style/Widget.Auxio.TextView.Item.Primary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:id="@+id/background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorPrimary"
|
||||
@@ -21,6 +22,7 @@
|
||||
app:tint="?attr/colorSurface" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/body"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorSurface">
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/header_title"
|
||||
style="@style/Widget.Auxio.TextView.Header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -16,6 +17,7 @@
|
||||
tools:text="Songs" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/header_button"
|
||||
style="@style/Widget.AppCompat.Button.Borderless"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user