Recalculate view's height when tab is selected

Viewpager2 created view based on the first tab height, when tab is
selected, viewpager2 should recalculate height.

But this solution may not suitable for App list, so we only enable
for Location Settings which have different items in personal & work
profile.

Bug: 224521665
Test: manual
Change-Id: Ib19b30cb82b8b4f13f651795906289da53ded4ed
This commit is contained in:
Edgar Wang
2022-04-21 11:44:10 +08:00
parent 27aa5f9d94
commit f3270e5c1c
8 changed files with 61 additions and 74 deletions

View File

@@ -22,12 +22,8 @@ import android.content.Context;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.search.SearchIndexable;
import java.util.ArrayList;
import java.util.List;
/**
* A page that configures the Location Services settings including Wi-Fi scanning, Bluetooth
* scanning, and injected location services.
@@ -51,11 +47,6 @@ public class LocationServices extends DashboardFragment {
return TAG;
}
@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
@@ -63,23 +54,9 @@ public class LocationServices extends DashboardFragment {
use(LocationInjectedServicesPreferenceController.class).init(this);
}
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new WifiScanningPreferenceController(context));
controllers.add(new BluetoothScanningPreferenceController(context));
return controllers;
}
/**
* For Search.
*/
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.location_services) {
@Override
public List<AbstractPreferenceController> createPreferenceControllers(Context
context) {
return buildPreferenceControllers(context);
}
};
new BaseSearchIndexProvider(R.xml.location_services);
}