This commit is contained in:
Victor Shcherb 2015-10-21 12:56:04 +02:00
parent 34b3ff41e9
commit e2bc3b9221

View file

@ -514,10 +514,13 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
public void onClick(DialogInterface dialog, int which) {
int clr = list.get(colorSpinner.getSelectedItemPosition());
String name = nameEditText.getText().toString();
if (clr != intColor || group.visible != checkBox.isChecked() ||
!Algorithms.objectEquals(group.name, name)) {
boolean nameChanged = !Algorithms.objectEquals(group.name, name);
if (clr != intColor || group.visible != checkBox.isChecked() || nameChanged) {
getMyApplication().getFavorites().editFavouriteGroup(group, name, clr,
checkBox.isChecked());
if(nameChanged) {
favouritesAdapter.synchronizeGroups();
}
favouritesAdapter.notifyDataSetInvalidated();
}