Fix deleting basic tags in offline mode
This commit is contained in:
parent
aecf98195c
commit
1ae6e344b1
1 changed files with 5 additions and 2 deletions
|
@ -47,6 +47,8 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment
|
|||
private EditText descriptionEditText;
|
||||
OpeningHoursAdapter mOpeningHoursAdapter;
|
||||
|
||||
private boolean basicTagsInitialized = false;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
@ -130,7 +132,7 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment
|
|||
if (data != null && !data.isInEdit()) {
|
||||
if (!TextUtils.isEmpty(s)) {
|
||||
data.putTag(tag, s.toString());
|
||||
} else {
|
||||
} else if (basicTagsInitialized && isResumed()) {
|
||||
data.removeTag(tag);
|
||||
}
|
||||
}
|
||||
|
@ -178,6 +180,7 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment
|
|||
}
|
||||
mOpeningHoursAdapter.replaceOpeningHours(openingHours);
|
||||
mOpeningHoursAdapter.updateViews();
|
||||
basicTagsInitialized = true;
|
||||
}
|
||||
|
||||
private class OpeningHoursAdapter {
|
||||
|
@ -223,7 +226,7 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment
|
|||
data.putTag(OSMSettings.OSMTagKey.OPENING_HOURS.getValue(),
|
||||
openingHoursString);
|
||||
}
|
||||
} else {
|
||||
} else if (basicTagsInitialized && isResumed()) {
|
||||
data.removeTag(OSMSettings.OSMTagKey.OPENING_HOURS.getValue());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue