Browse Source

android: Allow search bar to scroll offscreen

nce_cpp
Charles Lombardo 3 years ago
committed by bunnei
parent
commit
1684d4905f
  1. 1
      src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt
  2. 8
      src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt
  3. 14
      src/android/app/src/main/res/layout/fragment_games.xml

1
src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt

@ -125,6 +125,7 @@ class GamesFragment : Fragment() {
TransitionState.HIDING -> {
gamesViewModel.setSearchedGames(emptyList())
searchHidden()
binding.appBarSearch.setExpanded(true)
}
}
}

8
src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt

@ -75,11 +75,9 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
setUpNavigation(navHostFragment.navController)
binding.statusBarShade.setBackgroundColor(
ThemeHelper.getColorWithOpacity(
MaterialColors.getColor(
binding.root,
R.attr.colorSurface
), ThemeHelper.SYSTEM_BAR_ALPHA
MaterialColors.getColor(
binding.root,
R.attr.colorSurface
)
)

14
src/android/app/src/main/res/layout/fragment_games.xml

@ -44,20 +44,14 @@
android:id="@+id/app_bar_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:liftOnScrollTargetViewId="@id/grid_games">
<FrameLayout
<com.google.android.material.search.SearchBar
android:id="@+id/search_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.search.SearchBar
android:id="@+id/search_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/home_search_games" />
</FrameLayout>
android:hint="@string/home_search_games" />
</com.google.android.material.appbar.AppBarLayout>

Loading…
Cancel
Save