From e2a9ee2f355e424428784940ca05a62e77180296 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 --- .../settings/localepicker/AppLocalePickerActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/settings/localepicker/AppLocalePickerActivity.java b/src/com/android/settings/localepicker/AppLocalePickerActivity.java index 332f6256522..491f1a462a6 100644 --- a/src/com/android/settings/localepicker/AppLocalePickerActivity.java +++ b/src/com/android/settings/localepicker/AppLocalePickerActivity.java @@ -34,6 +34,7 @@ import android.widget.ListView; import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; +import androidx.core.view.ViewCompat; import com.android.internal.app.LocalePickerWithRegion; import com.android.internal.app.LocaleStore; @@ -117,12 +118,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; }