Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f76872d authored by Zoey Chen's avatar Zoey Chen
Browse files

[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
parent b98d6644
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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;
    }