Merge "Set initialExpandedChildrenCount dynamically in location settings"
This commit is contained in:
@@ -72,6 +72,16 @@ public class LocationSettings extends DashboardFragment {
|
||||
|
||||
private LocationSwitchBarController mSwitchBarController;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
final RecentLocationApps recentLocationApps = new RecentLocationApps(getActivity());
|
||||
int locationRequestsApps = recentLocationApps.getAppList().size();
|
||||
int locationRequestsPrefs = locationRequestsApps == 0 ? 1 : locationRequestsApps;
|
||||
getPreferenceScreen().setInitialExpandedChildrenCount(locationRequestsPrefs + 2);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.LOCATION;
|
||||
|
||||
Reference in New Issue
Block a user