Settings: Set key order during rebind

When the activity is resumed, injected preferences were losing their
order. This could potentially lead to two bottom preferences in a
given category. Ensure the order is retained during key rebind to
prevent such issues.

Follow up to change I666ebd7f90c11f1836bac10f7fca38baa5aedf93

Change-Id: I1dc0148c5595f20daf026970d6514e63776b0499
Signed-off-by: AnierinB <anierin@evolution-x.org>
This commit is contained in:
AnierinB 2024-11-16 17:06:55 +00:00 committed by Michael Bestas
parent d117f53b77
commit ed77d8bd20
No known key found for this signature in database

View file

@ -638,6 +638,10 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
observers = mDashboardFeatureProvider.bindPreferenceToTileAndGetObservers(
getActivity(), this, forceRoundedIcons, preference, tile, key,
mPlaceholderPreferenceController.getOrder());
// Order the prefs within their respective category
if (KEY_ORDER.containsKey(key)) {
preference.setOrder(KEY_ORDER.get(key));
}
} else {
// Don't have this key, add it.
final Preference pref = createPreference(tile);