Create dedicated search tab
Move all searching to a tab of its own.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
|
||||
</vector>
|
||||
@@ -2,10 +2,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z"/>
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z" />
|
||||
</vector>
|
||||
@@ -46,9 +46,9 @@
|
||||
android:id="@+id/about_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_small"
|
||||
android:paddingStart="@dimen/padding_small"
|
||||
android:paddingEnd="@dimen/padding_small"
|
||||
android:layout_marginTop="@dimen/margin_small"
|
||||
android:text="@string/app_desc"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/search_appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/background"
|
||||
android:elevation="@dimen/elevation_normal">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/search_toolbar"
|
||||
style="@style/Toolbar.Style"
|
||||
android:elevation="@dimen/elevation_normal"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:menu="@menu/menu_search"
|
||||
app:title="@string/label_search" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/search_text_layout"
|
||||
style="@style/Theme.MaterialComponents.DayNight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:boxBackgroundMode="filled"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:endIconContentDescription="@string/description_search_clear"
|
||||
app:endIconDrawable="@drawable/ic_close"
|
||||
app:endIconMode="clear_text"
|
||||
app:errorEnabled="false">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/search_edit_text"
|
||||
style="@style/Widget.AppCompat.EditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="@string/hint_search_library"
|
||||
android:imeOptions="actionSearch|flagNoExtractUi"
|
||||
android:inputType="textFilter"
|
||||
android:padding="@dimen/padding_medium"
|
||||
android:textCursorDrawable="@drawable/ui_cursor" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/search_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_song" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?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">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/action_play"
|
||||
android:title="@string/label_play" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?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">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/action_play_albums"
|
||||
android:title="@string/label_play" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?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">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/action_play"
|
||||
android:icon="@drawable/ic_play"
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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/label_search"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
app:showAsAction="collapseActionView|always"
|
||||
tools:ignore="AlwaysShowAction" />
|
||||
|
||||
<!--
|
||||
This action has to be always shown since otherwise android mangles this action when I make '
|
||||
it invisible and then visible again.
|
||||
@@ -18,8 +9,8 @@
|
||||
-->
|
||||
<item
|
||||
android:id="@+id/submenu_sorting"
|
||||
android:title="@string/label_sort"
|
||||
android:icon="@drawable/ic_sort_none"
|
||||
android:title="@string/label_sort"
|
||||
app:showAsAction="always">
|
||||
<menu>
|
||||
<group android:id="@+id/group_sorting">
|
||||
@@ -38,32 +29,4 @@
|
||||
</group>
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@+id/submenu_filtering"
|
||||
android:title="@string/label_filter"
|
||||
android:icon="@drawable/ic_filter"
|
||||
android:visible="false"
|
||||
app:showAsAction="always">
|
||||
<menu>
|
||||
<group android:id="@+id/group_filtering">
|
||||
<item
|
||||
android:id="@+id/option_filter_all"
|
||||
android:title="@string/label_filter_all"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/option_filter_albums"
|
||||
android:title="@string/label_albums"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/option_filter_artists"
|
||||
android:title="@string/label_artists"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/option_filter_genres"
|
||||
android:title="@string/label_genres"
|
||||
app:showAsAction="never" />
|
||||
</group>
|
||||
</menu>
|
||||
</item>
|
||||
</menu>
|
||||
@@ -8,6 +8,10 @@
|
||||
android:id="@+id/songs_fragment"
|
||||
android:icon="@drawable/ic_song"
|
||||
android:title="@string/label_songs" />
|
||||
<item
|
||||
android:id="@+id/search_fragment"
|
||||
android:icon="@drawable/ic_search"
|
||||
android:title="@string/label_search" />
|
||||
<item
|
||||
android:id="@+id/settings_fragment"
|
||||
android:icon="@drawable/ic_settings"
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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/submenu_filtering"
|
||||
android:icon="@drawable/ic_filter"
|
||||
android:title="@string/label_filter"
|
||||
app:showAsAction="ifRoom">
|
||||
<menu>
|
||||
<group
|
||||
android:id="@+id/group_filtering"
|
||||
android:checkableBehavior="single">
|
||||
<item
|
||||
android:id="@+id/option_filter_all"
|
||||
android:title="@string/label_filter_all"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/option_filter_songs"
|
||||
android:title="@string/label_songs"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/option_filter_albums"
|
||||
android:title="@string/label_albums"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/option_filter_artists"
|
||||
android:title="@string/label_artists"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/option_filter_genres"
|
||||
android:title="@string/label_genres"
|
||||
app:showAsAction="never" />
|
||||
</group>
|
||||
</menu>
|
||||
</item>
|
||||
</menu>
|
||||
@@ -1,15 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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/label_search"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
app:showAsAction="collapseActionView|always"
|
||||
tools:ignore="AlwaysShowAction" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_shuffle"
|
||||
android:icon="@drawable/ic_shuffle"
|
||||
|
||||
@@ -100,4 +100,31 @@
|
||||
android:name="org.oxycblt.auxio.settings.SettingsFragment"
|
||||
android:label="SettingsFragment"
|
||||
tools:layout="@layout/fragment_settings" />
|
||||
<fragment
|
||||
android:id="@+id/search_fragment"
|
||||
android:name="org.oxycblt.auxio.search.SearchFragment"
|
||||
android:label="SearchFragment"
|
||||
tools:layout="@layout/fragment_search">
|
||||
<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>
|
||||
@@ -136,6 +136,7 @@
|
||||
<string name="description_shuffle_off">Turn shuffle off</string>
|
||||
<string name="description_change_loop">Change Repeat Mode</string>
|
||||
<string name="description_auxio_icon">Auxio icon</string>
|
||||
<string name="description_search_clear">Clear search query</string>
|
||||
|
||||
<!-- Placeholder Namespace | Placeholder values -->
|
||||
<string name="placeholder_genre">Unknown Genre</string>
|
||||
|
||||
Reference in New Issue
Block a user