From e178c280e0e71347038fb5d5417f9de286d6595f Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Wed, 13 May 2020 15:14:50 +0300 Subject: [PATCH] small fixes p.2 --- .../SelectMultipleProfilesBottomSheet.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/profiles/SelectMultipleProfilesBottomSheet.java b/OsmAnd/src/net/osmand/plus/profiles/SelectMultipleProfilesBottomSheet.java index a97fa7dfde..b0cffe7c0c 100644 --- a/OsmAnd/src/net/osmand/plus/profiles/SelectMultipleProfilesBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/profiles/SelectMultipleProfilesBottomSheet.java @@ -34,14 +34,12 @@ public class SelectMultipleProfilesBottomSheet extends BasePreferenceBottomSheet public static final String DISABLED_KEYS = "disabled_keys"; private List profiles = new ArrayList<>(); - private Map compoundButtons = new HashMap<>(); private List selectedProfiles; private List disabledProfiles; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - compoundButtons.clear(); Bundle args = getArguments(); if (savedInstanceState != null) { readBundle(savedInstanceState); @@ -66,19 +64,6 @@ public class SelectMultipleProfilesBottomSheet extends BasePreferenceBottomSheet } } - @Override - public void onResume() { - super.onResume(); - for (ProfileDataObject profile : profiles) { - String key = profile.getStringKey(); - boolean selected = selectedProfiles.contains(key); - CompoundButton cb = compoundButtons.get(key); - if (cb != null) { - cb.setChecked(selected); - } - } - } - @Override public void createMenuItems(Bundle savedInstanceState) { items.add(new TitleItem(getString(R.string.application_profiles))); @@ -118,7 +103,8 @@ public class SelectMultipleProfilesBottomSheet extends BasePreferenceBottomSheet ivIcon.setImageDrawable(drawableIcon); UiUtilities.setupCompoundButton(nightMode, ContextCompat.getColor(app, enable ? activeColorId : disableColorId), compoundButton); - compoundButtons.put(profile.getStringKey(), compoundButton); + compoundButton.setSaveEnabled(false); + compoundButton.setChecked(profile.isSelected()); View.OnClickListener l = !enable ? null : new View.OnClickListener() { @Override