From 1f76872d780f64d87a2a923d9fd10f487fb15f41 Mon Sep 17 00:00:00 2001 From: Zoey Chen Date: Fri, 26 May 2023 17:15:30 +0000 Subject: [PATCH] [Panlingual] Remove the large space when searching language Don't expand the tool bar when users search the language because they will see a large space on the top. Bug: 284480214 Test: local test Change-Id: Ie8653536117a999bd420ccfce961b17fe9349d35 Merged-In: Ie8653536117a999bd420ccfce961b17fe9349d35 --- .../settings/localepicker/AppLocalePickerActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/localepicker/AppLocalePickerActivity.java b/src/com/android/settings/localepicker/AppLocalePickerActivity.java index 9efaf63c687..092207bdcf5 100644 --- a/src/com/android/settings/localepicker/AppLocalePickerActivity.java +++ b/src/com/android/settings/localepicker/AppLocalePickerActivity.java @@ -29,6 +29,8 @@ import android.view.View; import android.widget.FrameLayout; import android.widget.ListView; +import androidx.core.view.ViewCompat; + import com.android.internal.app.LocalePickerWithRegion; import com.android.internal.app.LocaleStore; import com.android.settings.R; @@ -105,12 +107,16 @@ public class AppLocalePickerActivity extends SettingsBaseActivity @Override public boolean onMenuItemActionCollapse(MenuItem item) { mAppBarLayout.setExpanded(false /*expanded*/, false /*animate*/); + ViewCompat.setNestedScrollingEnabled(mAppLocaleDetails.getListView(), true); + ViewCompat.setNestedScrollingEnabled(mLocalePickerWithRegion.getListView(), true); return true; } @Override public boolean onMenuItemActionExpand(MenuItem item) { mAppBarLayout.setExpanded(false /*expanded*/, false /*animate*/); + ViewCompat.setNestedScrollingEnabled(mAppLocaleDetails.getListView(), false); + ViewCompat.setNestedScrollingEnabled(mLocalePickerWithRegion.getListView(), false); return true; } @@ -171,4 +177,4 @@ public class AppLocalePickerActivity extends SettingsBaseActivity return false; } -} \ No newline at end of file +}