diff options
author | Mill Chen <millchen@google.com> | 2022-01-14 15:51:31 +0800 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2022-03-02 18:17:46 -0800 |
commit | 589f88b9a9a58959ab77b5375aa4346724f2f2f0 (patch) | |
tree | f923b71b9e09217f7b9eb646d331d96eb5a1235a | |
parent | e86dacf6ea2543c0f19bfcb01dd05fe4a4c1a7d1 (diff) | |
download | base-589f88b9a9a58959ab77b5375aa4346724f2f2f0.tar.gz |
Enable nested scrolling for locale picker
This change is to make the locale picker list enable the nested
scrolling feature. It is necessay to enable this feature to be able to
work with CollapsingToolbarLayout.
Fixes: 207318265
Fixes: 213036789
Test: manual test
1. Verify the locale picker works with Activity
2. Verify the locale picker works with SettingsBaseActivity
(cherry picked from commit fa861a6b5d87bae55319f5d92897d26ef490929f)
(cherry picked from commit 7f4b8b17841de170cdc30bbad19d3bee1cc8ce06)
Merged-In: Iaf90211da640cd265fc2b23dd34b3149c4406891
Change-Id: Iaf90211da640cd265fc2b23dd34b3149c4406891
-rw-r--r-- | core/java/com/android/internal/app/LocalePickerWithRegion.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/com/android/internal/app/LocalePickerWithRegion.java b/core/java/com/android/internal/app/LocalePickerWithRegion.java index d0719eeca04e..b4ae56f23443 100644 --- a/core/java/com/android/internal/app/LocalePickerWithRegion.java +++ b/core/java/com/android/internal/app/LocalePickerWithRegion.java @@ -159,6 +159,14 @@ public class LocalePickerWithRegion extends ListFragment implements SearchView.O } @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + // In order to make the list view work with CollapsingToolbarLayout, + // we have to enable the nested scrolling feature of the list view. + getListView().setNestedScrollingEnabled(true); + } + + @Override public boolean onOptionsItemSelected(MenuItem menuItem) { int id = menuItem.getItemId(); switch (id) { |