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

Commit 420404f9 authored by tom hsu's avatar tom hsu Committed by Tom Hsu
Browse files

[Panlingual][Settings] Fix when tap search bar, will leave a big blank.

 - Close blank layout after title disappear when search bar is expanded.

Bug: b/227287277
Test: local, see b/227287277#6
Change-Id: I1a61bab9a046aa52e22c4ef2292c7ae703deab1e
parent afe6d302
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ import com.android.settings.applications.appinfo.AppLocaleDetails;
import com.android.settings.core.SettingsBaseActivity;

public class AppLocalePickerActivity extends SettingsBaseActivity
        implements LocalePickerWithRegion.LocaleSelectedListener {
        implements LocalePickerWithRegion.LocaleSelectedListener, MenuItem.OnActionExpandListener {
    private static final String TAG = AppLocalePickerActivity.class.getSimpleName();

    private String mPackageName;
@@ -75,9 +75,10 @@ public class AppLocalePickerActivity extends SettingsBaseActivity

        mLocalePickerWithRegion = LocalePickerWithRegion.createLanguagePicker(
                mContextAsUser,
                AppLocalePickerActivity.this,
                this,
                false /* translate only */,
                mPackageName);
                mPackageName,
                this);
        mAppLocaleDetails = AppLocaleDetails.newInstance(mPackageName);
        mAppLocaleDetailContainer = launchAppLocaleDetailsPage();
        // Launch Locale picker part.
@@ -103,6 +104,18 @@ public class AppLocalePickerActivity extends SettingsBaseActivity
        finish();
    }

    @Override
    public boolean onMenuItemActionCollapse(MenuItem item) {
        mAppBarLayout.setExpanded(false /*expanded*/, false /*animate*/);
        return true;
    }

    @Override
    public boolean onMenuItemActionExpand(MenuItem item) {
        mAppBarLayout.setExpanded(false /*expanded*/, false /*animate*/);
        return true;
    }

    /** Sets the app's locale to the supplied language tag */
    private void setAppDefaultLocale(String languageTag) {
        LocaleManager localeManager = mContextAsUser.getSystemService(LocaleManager.class);