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

View File

@@ -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;
}
@@ -171,4 +177,4 @@ public class AppLocalePickerActivity extends SettingsBaseActivity
return false;
}
}
}