[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
This commit is contained in:
Zoey Chen
2023-05-26 17:15:30 +00:00
parent cc9c278168
commit e2a9ee2f35

View File

@@ -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;
}