diff --git a/android/res/layout/add_or_edit_bookmark.xml b/android/res/layout/add_or_edit_bookmark.xml
index 3b7153a453..96fd1bee27 100644
--- a/android/res/layout/add_or_edit_bookmark.xml
+++ b/android/res/layout/add_or_edit_bookmark.xml
@@ -16,7 +16,8 @@
+ android:layout_height="wrap_content"
+ android:layout_weight="1" >
+ android:focusable="false" />
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/res/layout/bookmarks_list.xml b/android/res/layout/bookmarks_list.xml
index 9a68bf9e17..708d173c33 100644
--- a/android/res/layout/bookmarks_list.xml
+++ b/android/res/layout/bookmarks_list.xml
@@ -23,12 +23,14 @@
android:layout_height="wrap_content"
android:text="@string/bookmarks" />
-
+ android:text="@string/share_by_email" />
+ -->
+ android:layout_height="wrap_content"
+ android:layout_weight="1" >
+
+
\ 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 022e1a5fd2..4b2b0d60e6 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BookmarkActivity.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkActivity.java
@@ -11,7 +11,9 @@ import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
+import android.view.ViewGroup;
import android.view.View.OnClickListener;
+import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
@@ -61,6 +63,57 @@ public class BookmarkActivity extends AbstractBookmarkActivity
setTitle(mPin.getName());
setUpViews();
+
+ adaptUiForOsVersion();
+ }
+
+ private void adaptUiForOsVersion()
+ {
+ ViewGroup compatBtns = (ViewGroup) findViewById(R.id.compat_btns_bar);
+ if (Utils.apiLowerThan(11))
+ {
+
+ Button shareEmailBtn = (Button) compatBtns.findViewById(R.id.btn_share_email);
+ if (ShareAction.getEmailShare().isSupported(this))
+ {
+ shareEmailBtn.setOnClickListener(new OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ assignPinParams();
+ ShareAction.getEmailShare().shareBookmark(BookmarkActivity.this, mPin);
+ }
+ });
+ }
+ else
+ {
+ shareEmailBtn.setVisibility(View.GONE);
+ }
+
+ Button shareAnyBtn = (Button) compatBtns.findViewById(R.id.btn_share_any);
+ if (ShareAction.getAnyShare().isSupported(this))
+ {
+ shareAnyBtn.setOnClickListener(new OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ assignPinParams();
+ ShareAction.getAnyShare().shareBookmark(BookmarkActivity.this, mPin);
+ }
+ });
+ }
+ else
+ {
+ shareAnyBtn.setVisibility(View.GONE);
+ }
+
+ }
+ else
+ {
+ compatBtns.setVisibility(View.GONE);
+ }
}
private void updateColorChooser(Icon icon)
diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkListActivity.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkListActivity.java
index 0615297809..a33cb4b831 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BookmarkListActivity.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkListActivity.java
@@ -13,8 +13,10 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
+import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
+import android.widget.Button;
import android.widget.EditText;
import com.mapswithme.maps.MWMActivity;
@@ -66,6 +68,23 @@ public class BookmarkListActivity extends AbstractBookmarkListActivity
}
});
registerForContextMenu(getListView());
+
+ adaptUiForOsVersion();
+ }
+
+ private void adaptUiForOsVersion()
+ {
+ final Button shareButton = (Button) findViewById(R.id.btn_share);
+ if (Utils.apiLowerThan(11))
+ {
+ shareButton.setOnClickListener(new OnClickListener()
+ {
+ @Override
+ public void onClick(View v) { onSendEMail(shareButton); }
+ });
+ }
+ else
+ shareButton.setVisibility(View.GONE);
}
private void createListAdapter()
diff --git a/android/src/com/mapswithme/util/Utils.java b/android/src/com/mapswithme/util/Utils.java
index 299bf9421e..4e3494b8c2 100644
--- a/android/src/com/mapswithme/util/Utils.java
+++ b/android/src/com/mapswithme/util/Utils.java
@@ -120,6 +120,11 @@ public class Utils
return Build.VERSION.SDK_INT >= api;
}
+ public static boolean apiLowerThan(int api)
+ {
+ return Build.VERSION.SDK_INT < api;
+ }
+
public static void checkNotNull(Object object)
{
if (null == object) throw new NullPointerException("Argument here must not be NULL");