diff --git a/app/src/main/java/org/lineageos/glimpse/fragments/SearchFragment.kt b/app/src/main/java/org/lineageos/glimpse/fragments/LibraryFragment.kt similarity index 90% rename from app/src/main/java/org/lineageos/glimpse/fragments/SearchFragment.kt rename to app/src/main/java/org/lineageos/glimpse/fragments/LibraryFragment.kt index 327a756..e29d7bd 100644 --- a/app/src/main/java/org/lineageos/glimpse/fragments/SearchFragment.kt +++ b/app/src/main/java/org/lineageos/glimpse/fragments/LibraryFragment.kt @@ -25,15 +25,15 @@ import org.lineageos.glimpse.utils.MediaStoreBuckets /** * A fragment showing a search bar with categories. - * Use the [SearchFragment.newInstance] factory method to + * Use the [LibraryFragment.newInstance] factory method to * create an instance of this fragment. */ -class SearchFragment : Fragment(R.layout.fragment_search) { +class LibraryFragment : Fragment(R.layout.fragment_library) { // Views private val appBarLayout by getViewProperty(R.id.appBarLayout) private val favoritesAlbumListItem by getViewProperty(R.id.favoritesAlbumListItem) private val photosAlbumListItem by getViewProperty(R.id.photosAlbumListItem) - private val searchNestedScrollView by getViewProperty(R.id.searchNestedScrollView) + private val libraryNestedScrollView by getViewProperty(R.id.libraryNestedScrollView) private val searchBar by getViewProperty(R.id.searchBar) private val trashAlbumListItem by getViewProperty(R.id.trashAlbumListItem) private val videosAlbumListItem by getViewProperty(R.id.videosAlbumListItem) @@ -60,7 +60,7 @@ class SearchFragment : Fragment(R.layout.fragment_search) { rightMargin = insets.right } - searchNestedScrollView.updateLayoutParams { + libraryNestedScrollView.updateLayoutParams { leftMargin = insets.left rightMargin = insets.right } @@ -103,7 +103,7 @@ class SearchFragment : Fragment(R.layout.fragment_search) { * * @return A new instance of fragment SearchFragment. */ - fun newInstance() = SearchFragment().apply { + fun newInstance() = LibraryFragment().apply { arguments = createBundle() } } diff --git a/app/src/main/res/drawable/ic_library.xml b/app/src/main/res/drawable/ic_library.xml new file mode 100644 index 0000000..836d2e0 --- /dev/null +++ b/app/src/main/res/drawable/ic_library.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_library.xml similarity index 96% rename from app/src/main/res/layout/fragment_search.xml rename to app/src/main/res/layout/fragment_library.xml index fe03199..67c6923 100644 --- a/app/src/main/res/layout/fragment_search.xml +++ b/app/src/main/res/layout/fragment_library.xml @@ -14,7 +14,7 @@ android:layout_height="wrap_content" android:fitsSystemWindows="true" android:paddingHorizontal="16dp" - app:liftOnScrollTargetViewId="@+id/searchNestedScrollView"> + app:liftOnScrollTargetViewId="@+id/libraryNestedScrollView"> + android:id="@+id/libraryFragment" + android:icon="@drawable/ic_library" + android:title="@string/library_title" /> diff --git a/app/src/main/res/navigation/main_fragment_navigation.xml b/app/src/main/res/navigation/main_fragment_navigation.xml index 888c9ab..65165cf 100644 --- a/app/src/main/res/navigation/main_fragment_navigation.xml +++ b/app/src/main/res/navigation/main_fragment_navigation.xml @@ -22,9 +22,9 @@ tools:layout="@layout/fragment_albums" /> + android:id="@+id/libraryFragment" + android:name="org.lineageos.glimpse.fragments.LibraryFragment" + android:label="@string/library_title" + tools:layout="@layout/fragment_library" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 78f18f9..d8f80ad 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -14,6 +14,7 @@ Albums Search Categories + Library Favorites