Merge pull request #9502 from osmandapp/QA_add_POI_empty_value

Fix #7065
This commit is contained in:
vshcherb 2020-07-27 10:48:20 +02:00 committed by GitHub
commit 4f280ccb39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.osmedit.AddPOIAction;
import java.util.List;
@ -232,6 +233,10 @@ public class CreateEditActionDialog extends DialogFragment
@Override
public void onClick(View view) {
if (action instanceof AddPOIAction) {
saveFirstTagWithEmptyValue();
}
if (action.fillParams(((ViewGroup) root.findViewById(R.id.container)).getChildAt(0), (MapActivity) getActivity())) {
if (quickActionRegistry.isNameUnique(action, getContext())) {
@ -272,6 +277,10 @@ public class CreateEditActionDialog extends DialogFragment
Toast.makeText(getContext(), R.string.quick_action_empty_param_error, Toast.LENGTH_SHORT).show();
}
}
private void saveFirstTagWithEmptyValue() {
((ViewGroup) root.findViewById(R.id.container)).getChildAt(0).requestFocus();
}
});
}