home: merge all library views into home

Merge LibraryFragment, SongsFragment, and others into a new fragment
called HomeFragment. This is the beginning of the Auxio UI overhaul.
This has caused some regressions here and there, but these will be
rectified over time.
This commit is contained in:
OxygenCobalt
2021-08-21 19:49:25 -06:00
parent e83867270b
commit a3e7cb93aa
33 changed files with 528 additions and 1097 deletions
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@android:color/white" />
</shape>
@@ -1,58 +0,0 @@
<?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"
tools:context=".MainFragment">
<LinearLayout
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:fitsSystemWindows="true"
android:orientation="vertical">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/explore_nav_host"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layout_constraintBottom_toTopOf="@+id/controls_container"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/nav_explore"
tools:layout="@layout/fragment_library" />
<LinearLayout
android:id="@+id/controls_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:background="?android:attr/colorBackground"
android:baselineAligned="false"
android:elevation="8dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_bar"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:background="?android:attr/colorBackground"
android:elevation="0dp"
app:elevation="0dp"
app:menu="@menu/menu_nav" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/compact_playback"
android:name="org.oxycblt.auxio.playback.CompactPlaybackFragment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
tools:layout="@layout/fragment_compact_playback" />
</LinearLayout>
</LinearLayout>
</layout>
+1 -2
View File
@@ -36,8 +36,7 @@
<ImageView
android:id="@+id/about_auxio_icon"
android:layout_width="@dimen/size_app_icon"
android:layout_height="@dimen/size_app_icon"
style="@style/Widget.ImageView.Compact"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginTop="@dimen/spacing_medium"
android:contentDescription="@string/desc_auxio_icon"
+50
View File
@@ -0,0 +1,50 @@
<?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"
tools:context=".home.HomeFragment">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/home_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"
app:liftOnScroll="true">
<androidx.appcompat.widget.Toolbar
android:id="@+id/home_toolbar"
style="@style/Widget.Toolbar"
app:menu="@menu/menu_home"
app:layout_scrollFlags="scroll|enterAlways"
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"
app:tabTextAppearance="@style/TextAppearance.TabLayout.Label"
app:tabMode="scrollable"
app:tabContentStart="@dimen/spacing_medium"
app:tabTextColor="?android:attr/textColorPrimary"
app:tabIndicatorColor="?attr/colorAccent" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/home_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
tools:listitem="@layout/item_artist" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
@@ -0,0 +1,13 @@
<?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/home_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
tools:listitem="@layout/item_artist" />
</layout>
@@ -1,41 +0,0 @@
<?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"
tools:context=".library.LibraryFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/library_toolbar"
style="@style/Widget.Toolbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:menu="@menu/menu_library"
app:title="@string/lbl_library" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/library_recycler"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/library_toolbar"
tools:listitem="@layout/item_artist" />
<org.oxycblt.auxio.recycler.FastScrollView
android:id="@+id/library_fast_scroll"
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/library_toolbar" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
+6 -26
View File
@@ -19,35 +19,15 @@
android:layout_height="0dp"
android:layout_weight="1"
app:navGraph="@navigation/nav_explore"
tools:layout="@layout/fragment_library" />
tools:layout="@layout/fragment_home" />
<org.oxycblt.auxio.ui.SlideLinearLayout
android:id="@+id/controls_container"
<androidx.fragment.app.FragmentContainerView
android:id="@+id/main_playback"
android:name="org.oxycblt.auxio.playback.CompactPlaybackFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:background="?android:attr/colorBackground"
android:baselineAligned="false"
android:elevation="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/compact_playback"
android:name="org.oxycblt.auxio.playback.CompactPlaybackFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/fragment_compact_playback" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?attr/colorSurface"
app:elevation="0dp"
app:menu="@menu/menu_nav" />
</org.oxycblt.auxio.ui.SlideLinearLayout>
android:background="?attr/colorSurface"
tools:layout="@layout/fragment_compact_playback" />
</LinearLayout>
</layout>
+1 -1
View File
@@ -16,7 +16,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/search_toolbar"
style="@style/Widget.Toolbar"
style="@style/Widget.Toolbar.Icon"
android:elevation="0dp"
app:layout_scrollFlags="scroll|enterAlways"
app:menu="@menu/menu_search"
@@ -7,11 +7,13 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="?attr/colorSurface"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/settings_toolbar"
style="@style/Widget.Toolbar"
style="@style/Widget.Toolbar.Icon.Down"
app:menu="@menu/menu_settings"
app:title="@string/set_title" />
@@ -1,41 +0,0 @@
<?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"
tools:context=".songs.SongsFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/song_toolbar"
style="@style/Widget.Toolbar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:menu="@menu/menu_songs"
app:title="@string/lbl_all_songs" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/song_recycler"
android:layout_width="0dp"
android:layout_height="0dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/song_toolbar"
tools:listitem="@layout/item_song" />
<org.oxycblt.auxio.recycler.FastScrollView
android:id="@+id/song_fast_scroll"
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/song_toolbar" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
@@ -1,50 +0,0 @@
<?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">
<merge
tools:layout_height="match_parent"
tools:layout_width="match_parent"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<FrameLayout
android:id="@+id/scroll_thumb"
android:layout_width="@dimen/size_scroll_thumb"
android:layout_height="@dimen/size_scroll_thumb"
android:background="@drawable/ui_circle"
android:backgroundTint="?attr/colorAccent"
android:elevation="@dimen/elevation_small"
android:stateListAnimator="@animator/animator_thumb"
app:layout_constraintEnd_toStartOf="@+id/scroll_indicator_text">
<TextView
android:id="@+id/scroll_thumb_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/inter_semibold"
android:gravity="center"
android:textColor="?android:attr/windowBackground"
android:textSize="@dimen/text_size_medium"
tools:text="A" />
</FrameLayout>
<TextView
android:id="@+id/scroll_indicator_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter_semibold"
android:gravity="center"
android:includeFontPadding="false"
android:lineSpacingExtra="@dimen/spacing_tiny"
android:minWidth="@dimen/width_fast_scroll"
android:paddingTop="@dimen/spacing_tiny"
android:paddingBottom="@dimen/spacing_tiny"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="A\nB\n\C\nD\nE" />
</merge>
</layout>
@@ -2,11 +2,17 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search"
android:title="@string/lbl_search"
app:showAsAction="ifRoom" />
<item
android:id="@+id/submenu_sorting"
android:icon="@drawable/ic_sort_none"
android:title="@string/lbl_sort"
app:showAsAction="always">
app:showAsAction="ifRoom">
<menu>
<group android:checkableBehavior="single">
<item
@@ -18,4 +24,10 @@
</group>
</menu>
</item>
<item
android:id="@+id/action_settings"
android:icon="@drawable/ic_settings"
android:title="@string/set_title"
app:showAsAction="ifRoom"/>
</menu>
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/library_fragment"
android:icon="@drawable/ic_library"
android:title="@string/lbl_library" />
<item
android:id="@+id/songs_fragment"
android:icon="@drawable/ic_song"
android:title="@string/lbl_songs" />
<item
android:id="@+id/search_fragment"
android:icon="@drawable/ic_search"
android:title="@string/lbl_search" />
<item
android:id="@+id/settings_fragment"
android:icon="@drawable/ic_settings"
android:title="@string/set_title" />
</menu>
-9
View File
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_shuffle"
android:icon="@drawable/ic_shuffle"
android:title="@string/lbl_shuffle"
app:showAsAction="always" />
</menu>
+34 -37
View File
@@ -2,35 +2,8 @@
<navigation 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"
app:startDestination="@id/library_fragment">
app:startDestination="@id/home_fragment">
<fragment
android:id="@+id/library_fragment"
android:name="org.oxycblt.auxio.library.LibraryFragment"
android:label="fragment_library"
tools:layout="@layout/fragment_library">
<action
android:id="@+id/action_show_genre"
app:destination="@id/genre_detail_fragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
<action
android:id="@+id/action_show_artist"
app:destination="@id/artist_detail_fragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
<action
android:id="@+id/action_show_album"
app:destination="@id/album_detail_fragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
</fragment>
<fragment
android:id="@+id/artist_detail_fragment"
android:name="org.oxycblt.auxio.detail.ArtistDetailFragment"
@@ -100,11 +73,6 @@
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
</fragment>
<fragment
android:id="@+id/songs_fragment"
android:name="org.oxycblt.auxio.songs.SongsFragment"
android:label="fragment_songs"
tools:layout="@layout/fragment_songs" />
<fragment
android:id="@+id/search_fragment"
android:name="org.oxycblt.auxio.search.SearchFragment"
@@ -133,8 +101,37 @@
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
</fragment>
<fragment
android:id="@+id/settings_fragment"
android:name="org.oxycblt.auxio.settings.SettingsFragment"
android:label="SettingsFragment"
tools:layout="@layout/fragment_settings" />
android:id="@+id/home_fragment"
android:name="org.oxycblt.auxio.home.HomeFragment"
android:label="fragment_home"
tools:layout="@layout/fragment_home">
<action
android:id="@+id/action_show_search"
app:destination="@id/search_fragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
<action
android:id="@+id/action_show_genre"
app:destination="@id/genre_detail_fragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
<action
android:id="@+id/action_show_artist"
app:destination="@id/artist_detail_fragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
<action
android:id="@+id/action_show_album"
app:destination="@id/album_detail_fragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
</fragment>
</navigation>
+15 -2
View File
@@ -32,8 +32,8 @@
app:popEnterAnim="@anim/anim_stationary"
app:popExitAnim="@anim/anim_nav_slide_down" />
<action
android:id="@+id/action_show_about"
app:destination="@id/about_fragment"
android:id="@+id/action_show_settings"
app:destination="@id/settings_fragment"
app:enterAnim="@anim/anim_nav_slide_up"
app:exitAnim="@anim/anim_stationary"
app:popEnterAnim="@anim/anim_stationary"
@@ -62,4 +62,17 @@
android:name="org.oxycblt.auxio.settings.AboutFragment"
android:label="dialog_about"
tools:layout="@layout/fragment_about" />
<fragment
android:id="@+id/settings_fragment"
android:name="org.oxycblt.auxio.settings.SettingsFragment"
android:label="fragment_settings"
tools:layout="@layout/fragment_settings">
<action
android:id="@+id/action_show_about"
app:destination="@id/about_fragment"
app:enterAnim="@anim/anim_nav_slide_up"
app:exitAnim="@anim/anim_stationary"
app:popEnterAnim="@anim/anim_stationary"
app:popExitAnim="@anim/anim_nav_slide_down" />
</fragment>
</navigation>
+2 -6
View File
@@ -6,7 +6,6 @@
-->
<!-- Spacing Namespace | Dimens for padding/margin attributes -->
<dimen name="spacing_tiny">4dp</dimen>
<dimen name="spacing_small">8dp</dimen>
<dimen name="spacing_medium">16dp</dimen>
<dimen name="spacing_mid_large">24dp</dimen>
@@ -22,9 +21,6 @@
<dimen name="size_btn_small">48dp</dimen>
<dimen name="size_btn_large">64dp</dimen>
<dimen name="size_small_unb_ripple">20dp</dimen>
<dimen name="size_unb_ripple">24dp</dimen>
<dimen name="size_cover_compact">48dp</dimen>
<dimen name="size_cover_normal">56dp</dimen>
<dimen name="size_cover_huge_land">136dp</dimen>
@@ -33,8 +29,8 @@
<dimen name="size_stroke_small">1dp</dimen>
<dimen name="size_stroke_large">2dp</dimen>
<dimen name="size_app_icon">48dp</dimen>
<dimen name="size_scroll_thumb">48dp</dimen>
<dimen name="size_small_unb_ripple">20dp</dimen>
<dimen name="size_unb_ripple">24dp</dimen>
<!-- Text Size Namespace | Text Sizes -->
<dimen name="text_size_small">16sp</dimen>
+1 -1
View File
@@ -14,7 +14,7 @@
<!-- Colors -->
<item name="colorSurface">@color/surface</item>
<item name="colorAccent">@color/design_default_color_primary</item>
<item name="colorOnSurface">#FFFFFF</item>
<item name="colorOnSurface">#00000000</item>
<item name="colorPrimary">?attr/colorAccent</item>
<item name="colorSecondary">?attr/colorAccent</item>
+5 -1
View File
@@ -7,7 +7,6 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">?android:attr/actionBarSize</item>
<item name="android:background">?attr/colorSurface</item>
<item name="android:elevation">@dimen/elevation_normal</item>
<item name="popupTheme">@style/ThemeOverlay.ToolbarPopup</item>
<item name="titleTextAppearance">@style/TextAppearance.Toolbar.Header</item>
@@ -61,6 +60,10 @@
<item name="android:outlineProvider">bounds</item>
</style>
<style name="TextAppearance.TabLayout.Label" parent="@style/TextAppearance.Design.Tab">
<item name="android:fontFamily">@font/inter_semibold</item>
</style>
<!-- VIEWGROUP STYLES -->
<style name="TextAppearance.Toolbar.Header" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
@@ -78,6 +81,7 @@
</style>
<!-- TEXTVIEW STYLES -->
<style name="Widget.TextView.Item.Base" parent="Widget.AppCompat.TextView">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>