view_toolbar_search: Switch to native toolbar for search
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960">
|
||||
<path
|
||||
android:pathData="M480,800q-33,0 -56.5,-23.5T400,720q0,-33 23.5,-56.5T480,640q33,0 56.5,23.5T560,720q0,33 -23.5,56.5T480,800ZM480,560q-33,0 -56.5,-23.5T400,480q0,-33 23.5,-56.5T480,400q33,0 56.5,23.5T560,480q0,33 -23.5,56.5T480,560ZM480,320q-33,0 -56.5,-23.5T400,240q0,-33 23.5,-56.5T480,160q33,0 56.5,23.5T560,240q0,33 -23.5,56.5T480,320Z"
|
||||
android:fillColor="#e8eaed"/>
|
||||
</vector>
|
||||
@@ -24,18 +24,35 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/layout_toolbar_native"
|
||||
layout="@layout/view_toolbar_search" />
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarTheme"
|
||||
app:navigationIcon="@drawable/ic_arrow_back">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/searchBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:background="@null"
|
||||
android:hint="@string/search_hint"
|
||||
android:imeOptions="flagNoExtractUi|actionSearch"
|
||||
android:inputType="text"
|
||||
android:paddingStart="@dimen/padding_large"
|
||||
android:paddingEnd="@dimen/padding_normal"
|
||||
android:singleLine="true" />
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<com.airbnb.epoxy.EpoxyRecyclerView
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/layout_toolbar_native"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:clipToPadding="true"
|
||||
android:paddingBottom="@dimen/height_bottom_adj"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:stackFromEnd="false"
|
||||
tools:listitem="@layout/view_app_list" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -30,15 +30,33 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/layout_view_toolbar"
|
||||
layout="@layout/view_toolbar_search" />
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarTheme"
|
||||
app:menu="@menu/menu_search"
|
||||
app:navigationIcon="@drawable/ic_arrow_back">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/searchBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:background="@null"
|
||||
android:hint="@string/search_hint"
|
||||
android:imeOptions="flagNoExtractUi|actionSearch"
|
||||
android:inputType="text"
|
||||
android:paddingStart="@dimen/padding_large"
|
||||
android:paddingEnd="@dimen/padding_normal"
|
||||
android:singleLine="true" />
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/layout_view_toolbar" />
|
||||
android:layout_below="@id/toolbar" />
|
||||
|
||||
<com.airbnb.epoxy.EpoxyRecyclerView
|
||||
android:id="@+id/recycler"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -29,15 +30,33 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/layout_toolbar_search"
|
||||
layout="@layout/view_toolbar_search" />
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="?attr/actionBarTheme"
|
||||
app:menu="@menu/menu_search"
|
||||
app:navigationIcon="@drawable/ic_arrow_back">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/searchBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:background="@null"
|
||||
android:hint="@string/search_hint"
|
||||
android:imeOptions="flagNoExtractUi|actionSearch"
|
||||
android:inputType="text"
|
||||
android:paddingStart="@dimen/padding_large"
|
||||
android:paddingEnd="@dimen/padding_normal"
|
||||
android:singleLine="true" />
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/layout_toolbar_search" />
|
||||
android:layout_below="@id/toolbar" />
|
||||
|
||||
<com.airbnb.epoxy.EpoxyRecyclerView
|
||||
android:id="@+id/recycler"
|
||||
@@ -46,4 +65,4 @@
|
||||
android:layout_below="@+id/divider"
|
||||
tools:listitem="@layout/view_search_suggestion" />
|
||||
</RelativeLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Aurora Store
|
||||
~ Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
|
||||
~
|
||||
~ Aurora Store is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 2 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ Aurora Store is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with Aurora Store. If not, see <http://www.gnu.org/licenses/>.
|
||||
~
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:paddingStart="@dimen/padding_large"
|
||||
android:paddingEnd="@dimen/padding_large">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_action_primary"
|
||||
android:layout_width="@dimen/icon_size_default"
|
||||
android:layout_height="@dimen/icon_size_default"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/margin_small"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/action_back"
|
||||
app:srcCompat="@drawable/ic_arrow_back"
|
||||
app:tint="?colorControlNormal" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@id/clearButton"
|
||||
android:layout_toEndOf="@id/img_action_primary"
|
||||
android:background="@null"
|
||||
android:hint="@string/search_hint"
|
||||
android:imeOptions="flagNoExtractUi|actionSearch"
|
||||
android:inputType="text"
|
||||
android:paddingStart="@dimen/padding_large"
|
||||
android:paddingEnd="@dimen/padding_normal"
|
||||
android:singleLine="true" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/clearButton"
|
||||
style="@style/Widget.Material3.Button.IconButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@id/img_action_secondary"
|
||||
android:contentDescription="@string/details_changelog"
|
||||
android:visibility="gone"
|
||||
app:icon="@drawable/ic_cancel"
|
||||
app:iconTint="?attr/colorControlNormal" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_action_secondary"
|
||||
android:layout_width="@dimen/icon_size_default"
|
||||
android:layout_height="@dimen/icon_size_default"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/margin_small"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_download_manager"
|
||||
app:srcCompat="@drawable/ic_arrow_download"
|
||||
app:tint="?colorControlNormal" />
|
||||
</RelativeLayout>
|
||||
15
app/src/main/res/menu/menu_search.xml
Normal file
15
app/src/main/res/menu/menu_search.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?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_clear"
|
||||
android:icon="@drawable/ic_cancel"
|
||||
android:title="@string/action_clear"
|
||||
android:visible="false"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_download"
|
||||
android:icon="@drawable/ic_download_manager"
|
||||
android:title="@string/title_download_manager"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
@@ -5,6 +5,5 @@
|
||||
<item name="chipStyle">@style/Chip.Filter</item>
|
||||
<item name="preferenceTheme">@style/AppTheme.PreferenceThemeOverlay</item>
|
||||
<item name="android:statusBarColor">@color/colorTransparent</item>
|
||||
<item name="popupMenuStyle">@style/AppTheme.PopupMenu</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
<item name="preferenceTheme">@style/AppTheme.PreferenceThemeOverlay</item>
|
||||
<item name="bottomSheetStyle">@style/AppTheme.BottomSheetStyle</item>
|
||||
<item name="android:statusBarColor">@color/colorTransparent</item>
|
||||
<item name="popupMenuStyle">@style/AppTheme.PopupMenu</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Translucent" parent="Theme.Material3.DynamicColors.DayNight.NoActionBar">
|
||||
@@ -48,12 +47,6 @@
|
||||
<item name="widgetLayout">@layout/preference_material_switch</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.PopupMenu" parent="Widget.Material3.PopupMenu">
|
||||
<item name="android:popupBackground">?attr/colorSurfaceContainer</item>
|
||||
<item name="android:textColor">?attr/colorOnSurface</item>
|
||||
<item name="android:elevation">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Chip.Filter" parent="@style/Widget.Material3.Chip.Filter" />
|
||||
|
||||
<style name="Chip.TopChart" parent="@style/Widget.Material3.Chip.Filter">
|
||||
|
||||
Reference in New Issue
Block a user