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:
@@ -20,7 +20,6 @@ import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.widget.RestrictedAppPreference;
|
||||
@@ -41,8 +40,6 @@ public class LocationInjectedServicesForWorkPreferenceController extends
|
||||
|
||||
@Override
|
||||
protected void injectLocationServices(PreferenceScreen screen) {
|
||||
final PreferenceCategory categoryLocationServices =
|
||||
screen.findPreference(getPreferenceKey());
|
||||
final Map<Integer, List<Preference>> prefs = getLocationServices();
|
||||
for (Map.Entry<Integer, List<Preference>> entry : prefs.entrySet()) {
|
||||
for (Preference pref : entry.getValue()) {
|
||||
@@ -51,7 +48,7 @@ public class LocationInjectedServicesForWorkPreferenceController extends
|
||||
}
|
||||
}
|
||||
if (entry.getKey() != UserHandle.myUserId()) {
|
||||
LocationSettings.addPreferencesSorted(entry.getValue(), categoryLocationServices);
|
||||
LocationSettings.addPreferencesSorted(entry.getValue(), screen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user