Newly created profile set active on Save
This commit is contained in:
parent
b2f84d502e
commit
e91ef8babe
3 changed files with 4 additions and 4 deletions
|
@ -534,6 +534,4 @@ public class ApplicationMode {
|
||||||
ApplicationMode.saveCustomModeToSettings(app.getSettings());
|
ApplicationMode.saveCustomModeToSettings(app.getSettings());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -42,9 +42,11 @@ public class ProfileMenuAdapter extends RecyclerView.Adapter<ProfileViewHolder>
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateItemsList(List<ApplicationMode> newList) {
|
public void updateItemsList(List<ApplicationMode> newList, Set<ApplicationMode> selectedItems) {
|
||||||
items.clear();
|
items.clear();
|
||||||
|
this.selectedItems.clear();
|
||||||
items.addAll(newList);
|
items.addAll(newList);
|
||||||
|
this.selectedItems.addAll(selectedItems);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ public class SettingsProfileFragment extends BaseOsmAndFragment {
|
||||||
allAppModes = ApplicationMode.allPossibleValues();
|
allAppModes = ApplicationMode.allPossibleValues();
|
||||||
allAppModes.remove(ApplicationMode.DEFAULT);
|
allAppModes.remove(ApplicationMode.DEFAULT);
|
||||||
|
|
||||||
adapter.updateItemsList(allAppModes);
|
adapter.updateItemsList(allAppModes, new LinkedHashSet<>(ApplicationMode.values(getMyApplication())));
|
||||||
}
|
}
|
||||||
|
|
||||||
static ArrayList<BaseProfile> getBaseProfiles(Context ctx) {
|
static ArrayList<BaseProfile> getBaseProfiles(Context ctx) {
|
||||||
|
|
Loading…
Reference in a new issue