Trim favorite name
This commit is contained in:
parent
4b5cf87d34
commit
5feaaa8485
2 changed files with 3 additions and 3 deletions
|
@ -241,7 +241,7 @@ public class FavouritesActivity extends OsmandExpandableListActivity {
|
||||||
builder.setPositiveButton(R.string.default_buttons_apply, new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(R.string.default_buttons_apply, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
boolean editied = helper.editFavouriteName(point, editText.getText().toString(), cat.getText().toString());
|
boolean editied = helper.editFavouriteName(point, editText.getText().toString().trim(), cat.getText().toString());
|
||||||
if (editied) {
|
if (editied) {
|
||||||
favouritesAdapter.synchronizeGroups();
|
favouritesAdapter.synchronizeGroups();
|
||||||
favouritesAdapter.sort(favoritesComparator);
|
favouritesAdapter.sort(favoritesComparator);
|
||||||
|
|
|
@ -180,8 +180,8 @@ public class MapActivityActions implements DialogProvider {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
FavouritePoint point = (FavouritePoint) args.getSerializable(KEY_FAVORITE);
|
FavouritePoint point = (FavouritePoint) args.getSerializable(KEY_FAVORITE);
|
||||||
final FavouritesDbHelper helper = ((OsmandApplication) activity.getApplication()).getFavorites();
|
final FavouritesDbHelper helper = ((OsmandApplication) activity.getApplication()).getFavorites();
|
||||||
point.setName(editText.getText().toString());
|
point.setName(editText.getText().toString().trim());
|
||||||
point.setCategory(cat.getText().toString());
|
point.setCategory(cat.getText().toString().trim());
|
||||||
boolean added = helper.addFavourite(point);
|
boolean added = helper.addFavourite(point);
|
||||||
if (added) {
|
if (added) {
|
||||||
AccessibleToast.makeText(activity, MessageFormat.format(
|
AccessibleToast.makeText(activity, MessageFormat.format(
|
||||||
|
|
Loading…
Reference in a new issue