diff options
author | vng <viktor.govako@gmail.com> | 2013-02-14 14:20:50 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:50:54 +0300 |
commit | 4d959157bde964c1c603ce585ff93de69168e98b (patch) | |
tree | 9603730f28c0d6f68c8b6aa3fb82bd6952cb8cbe /android | |
parent | 0e80bdc3601b083768a8416db082cbda1aea0cb7 (diff) |
[android] [bookmarks] Add "OK" button in the bookmark's activity.
Diffstat (limited to 'android')
-rw-r--r-- | android/res/layout/pin.xml | 19 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/bookmarks/BookmarkActivity.java | 10 |
2 files changed, 19 insertions, 10 deletions
diff --git a/android/res/layout/pin.xml b/android/res/layout/pin.xml index 940c41d4c9..3b7153a453 100644 --- a/android/res/layout/pin.xml +++ b/android/res/layout/pin.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" @@ -11,15 +11,12 @@ android:id="@+id/bmk_hack_view" android:layout_width="0dp" android:layout_height="0dp" - android:layout_alignParentTop="true" android:focusable="true" android:focusableInTouchMode="true" /> <ScrollView android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_above="@+id/bmk_delete" - android:layout_below="@id/bmk_hack_view" > + android:layout_height="wrap_content"> <LinearLayout android:layout_width="fill_parent" @@ -133,14 +130,20 @@ android:background="@android:drawable/divider_horizontal_dark" /> <Button - android:id="@+id/bmk_delete" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:layout_alignParentBottom="true" + android:layout_margin="5dp" + android:onClick="onOkClick" + android:text="@string/ok" /> + + <Button + android:layout_width="fill_parent" + android:layout_height="wrap_content" android:layout_margin="5dp" android:onClick="onDeleteClick" android:text="@string/remove_pin" /> + </LinearLayout> </ScrollView> -</RelativeLayout>
\ No newline at end of file +</LinearLayout>
\ No newline at end of file diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkActivity.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkActivity.java index 74bb1326f5..eff57ca445 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarkActivity.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkActivity.java @@ -119,8 +119,9 @@ public class BookmarkActivity extends AbstractBookmarkActivity @Override public void onTextChanged(CharSequence s, int start, int before, int count) { - mPin.setName(s.toString()); - setTitle(s.toString()); + final String str = s.toString(); + mPin.setName(str); + setTitle(str); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) @@ -252,6 +253,11 @@ public class BookmarkActivity extends AbstractBookmarkActivity super.onActivityResult(requestCode, resultCode, data); } + public void onOkClick(View v) + { + onBackPressed(); + } + public void onDeleteClick(View v) { showDialog(CONFIRMATION_DIALOG); |