diff options
| author | JosJuice <josjuice@gmail.com> | 2026-08-23 12:19:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-23 12:19:09 +0200 |
| commit | 474fa6e6f21d05e27d8e33bbf069ecbeed58b60a (patch) | |
| tree | 9cd21bf47890af648988f1c86131985b3fa3daae /Source/Android/app/src/main/res | |
| parent | b3d74ab6022457bef29c08c26156a9ee145c0d76 (diff) | |
| parent | 93706022d5d6974c96b75a129bf278b693b99a6e (diff) | |
Merge pull request #14742 from Simonx22/android/settings-search-next
Android: Add global settings search
Diffstat (limited to 'Source/Android/app/src/main/res')
8 files changed, 197 insertions, 30 deletions
diff --git a/Source/Android/app/src/main/res/anim/anim_settings_search_pop_in.xml b/Source/Android/app/src/main/res/anim/anim_settings_search_pop_in.xml new file mode 100644 index 0000000000..338676f504 --- /dev/null +++ b/Source/Android/app/src/main/res/anim/anim_settings_search_pop_in.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<alpha xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="180" + android:fromAlpha="0" + android:interpolator="@android:anim/decelerate_interpolator" + android:startOffset="60" + android:toAlpha="1" /> diff --git a/Source/Android/app/src/main/res/anim/anim_settings_search_pop_out.xml b/Source/Android/app/src/main/res/anim/anim_settings_search_pop_out.xml new file mode 100644 index 0000000000..f131732c71 --- /dev/null +++ b/Source/Android/app/src/main/res/anim/anim_settings_search_pop_out.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<alpha xmlns:android="http://schemas.android.com/apk/res/android" + android:duration="90" + android:fromAlpha="1" + android:interpolator="@android:anim/accelerate_interpolator" + android:toAlpha="0" /> diff --git a/Source/Android/app/src/main/res/color/settings_search_outline.xml b/Source/Android/app/src/main/res/color/settings_search_outline.xml new file mode 100644 index 0000000000..5a4a93e941 --- /dev/null +++ b/Source/Android/app/src/main/res/color/settings_search_outline.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:alpha="0.45" android:color="?attr/colorOutline" /> +</selector> diff --git a/Source/Android/app/src/main/res/drawable/ic_search.xml b/Source/Android/app/src/main/res/drawable/ic_search.xml new file mode 100644 index 0000000000..c85c3c5e61 --- /dev/null +++ b/Source/Android/app/src/main/res/drawable/ic_search.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@android:color/white" + android:pathData="M9.5,3a6.5,6.5 0,1 0,0 13a6.5,6.5 0,0 0,0 -13zM9.5,5a4.5,4.5 0,1 1,0 9a4.5,4.5 0,0 1,0 -9zM14.65,13.24l5.56,5.56l-1.41,1.41l-5.56,-5.56z" /> +</vector> diff --git a/Source/Android/app/src/main/res/layout/activity_settings.xml b/Source/Android/app/src/main/res/layout/activity_settings.xml index 533893df12..fbecfd3886 100644 --- a/Source/Android/app/src/main/res/layout/activity_settings.xml +++ b/Source/Android/app/src/main/res/layout/activity_settings.xml @@ -1,22 +1,50 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.coordinatorlayout.widget.CoordinatorLayout +<androidx.coordinatorlayout.widget.CoordinatorLayout android:id="@+id/coordinator_main" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" - android:id="@+id/coordinator_main" android:layout_width="match_parent" android:layout_height="match_parent" android:background="?attr/colorSurface"> + <FrameLayout + android:id="@+id/frame_content_settings" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> + + <TextView + android:id="@+id/old_controller_settings_warning" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:background="?attr/colorErrorContainer" + android:clickable="true" + android:focusable="false" + android:text="@string/old_controller_settings" + android:textColor="?attr/colorOnErrorContainer" + android:visibility="invisible" /> + + <View + android:id="@+id/workaround_view" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_gravity="bottom" + android:background="@android:color/transparent" + android:clickable="true" + android:focusable="false" /> + <com.google.android.material.appbar.AppBarLayout android:id="@+id/appbar_settings" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" + android:background="@android:color/transparent" + app:backgroundTint="@android:color/transparent" app:elevation="0dp"> <com.google.android.material.appbar.CollapsingToolbarLayout - style="?attr/collapsingToolbarLayoutMediumStyle" android:id="@+id/toolbar_settings_layout" + style="?attr/collapsingToolbarLayoutMediumStyle" android:layout_width="match_parent" android:layout_height="?attr/collapsingToolbarLayoutMediumSize" app:contentScrim="@android:color/transparent" @@ -31,33 +59,94 @@ </com.google.android.material.appbar.CollapsingToolbarLayout> - </com.google.android.material.appbar.AppBarLayout> + <FrameLayout + android:id="@+id/settings_search_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?attr/colorSurface" + android:paddingBottom="@dimen/spacing_medlarge"> - <FrameLayout - android:id="@+id/frame_content_settings" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:layout_behavior="@string/appbar_scrolling_view_behavior"/> + <com.google.android.material.card.MaterialCardView + android:id="@+id/settings_search_preview" + android:layout_width="match_parent" + android:layout_height="56dp" + android:clickable="true" + android:focusable="true" + android:foreground="?android:attr/selectableItemBackground" + android:layout_marginEnd="@dimen/spacing_large" + android:layout_marginStart="@dimen/spacing_large" + app:cardBackgroundColor="?attr/colorSurfaceVariant" + app:cardCornerRadius="28dp" + app:cardElevation="0dp" + app:strokeColor="@color/settings_search_outline" + app:strokeWidth="1dp"> - <TextView - android:id="@+id/old_controller_settings_warning" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="bottom" - android:background="?attr/colorErrorContainer" - android:text="@string/old_controller_settings" - android:textColor="?attr/colorOnErrorContainer" - android:visibility="invisible" - android:clickable="true" - android:focusable="false" /> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingEnd="@dimen/spacing_large" + android:paddingStart="20dp"> - <View - android:id="@+id/workaround_view" - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_gravity="bottom" - android:clickable="true" - android:focusable="false" - android:background="@android:color/transparent" /> + <ImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:contentDescription="@null" + app:srcCompat="@drawable/ic_search" + app:tint="?android:attr/textColorSecondary" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/spacing_large" + android:text="@string/search_settings" + android:textColor="?android:attr/textColorSecondary" + android:textSize="18sp" /> + + </LinearLayout> + + </com.google.android.material.card.MaterialCardView> + + </FrameLayout> + + <LinearLayout + android:id="@+id/settings_search_mode_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?attr/colorSurface" + android:orientation="vertical" + android:visibility="gone"> + + <com.google.android.material.appbar.MaterialToolbar + android:id="@+id/settings_search_toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:background="?attr/colorSurface" + app:navigationContentDescription="@string/search_settings_back" + app:navigationIcon="?attr/homeAsUpIndicator"> + + <androidx.appcompat.widget.SearchView + android:id="@+id/settings_search" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@android:color/transparent" + android:imeOptions="actionSearch" + android:inputType="text" + app:iconifiedByDefault="false" + app:queryBackground="@android:color/transparent" + app:queryHint="@string/search_settings" + app:searchIcon="@null" /> + + </com.google.android.material.appbar.MaterialToolbar> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="@color/settings_search_outline" /> + + </LinearLayout> + + </com.google.android.material.appbar.AppBarLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout> diff --git a/Source/Android/app/src/main/res/layout/fragment_settings.xml b/Source/Android/app/src/main/res/layout/fragment_settings.xml index 77b673b53c..5b8896d9f7 100644 --- a/Source/Android/app/src/main/res/layout/fragment_settings.xml +++ b/Source/Android/app/src/main/res/layout/fragment_settings.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> @@ -11,4 +10,16 @@ android:layout_height="match_parent" android:clipToPadding="false" /> + <TextView + android:id="@+id/text_no_search_results" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center" + android:padding="@dimen/spacing_xtralarge" + android:text="@string/search_settings_no_results" + android:textAlignment="center" + android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" + android:textColor="?android:attr/textColorSecondary" + android:visibility="gone" /> + </FrameLayout> diff --git a/Source/Android/app/src/main/res/layout/list_item_search_result.xml b/Source/Android/app/src/main/res/layout/list_item_search_result.xml new file mode 100644 index 0000000000..237fc46c04 --- /dev/null +++ b/Source/Android/app/src/main/res/layout/list_item_search_result.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:minHeight="64dp" + android:orientation="vertical" + android:paddingBottom="@dimen/spacing_large" + android:paddingEnd="@dimen/spacing_large" + android:paddingStart="@dimen/spacing_large" + android:paddingTop="@dimen/spacing_large"> + + <TextView + android:id="@+id/text_setting_name" + style="@style/TextAppearance.MaterialComponents.Headline5" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAlignment="viewStart" + android:textSize="16sp" + tools:text="Internal Resolution" /> + + <TextView + android:id="@+id/text_setting_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/spacing_small" + android:ellipsize="end" + android:maxLines="1" + android:textAlignment="viewStart" + android:textColor="?android:attr/textColorSecondary" + tools:text="Graphics Settings › Enhancements" /> + +</LinearLayout> diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index a6419ec83b..2f41de8fc7 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -62,6 +62,10 @@ <!-- Main Preference Fragment --> <string name="settings">Settings</string> + <string name="search_settings">Search settings</string> + <string name="search_settings_back">Back to settings</string> + <string name="search_settings_no_results">No settings found for “%1$s”</string> + <string name="search_settings_category_path">%1$s › %2$s</string> <string name="game_settings">Game Settings: %1$s</string> <string name="config">Config</string> <string name="graphics_settings">Graphics Settings</string> |
