Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kunin <dkunin@mapswith.me>2013-09-19 18:33:46 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:02:20 +0300
commit127801a9ebc2847b40e4a67e2b83e4e84c20a2a6 (patch)
treef9c04fecb547d5a17546ee5c0d1269ebf140f6b9
parent962309e9dd99305c1c5167841ef07ce88e865d2b (diff)
[yota] Base for new UI
-rw-r--r--android/res/drawable-xhdpi/ic_ptb_active.pngbin0 -> 9349 bytes
-rw-r--r--android/res/drawable-xhdpi/ic_ptb_normal.pngbin0 -> 6623 bytes
-rw-r--r--android/res/drawable-xhdpi/ptb_selector_map.xml7
-rw-r--r--android/res/layout/fragment_map_object.xml7
-rw-r--r--android/res/layout/map.xml16
-rw-r--r--android/src/com/mapswithme/maps/MapObjectFragment.java40
6 files changed, 27 insertions, 43 deletions
diff --git a/android/res/drawable-xhdpi/ic_ptb_active.png b/android/res/drawable-xhdpi/ic_ptb_active.png
new file mode 100644
index 0000000000..3bca9ff3d8
--- /dev/null
+++ b/android/res/drawable-xhdpi/ic_ptb_active.png
Binary files differ
diff --git a/android/res/drawable-xhdpi/ic_ptb_normal.png b/android/res/drawable-xhdpi/ic_ptb_normal.png
new file mode 100644
index 0000000000..5d92e72521
--- /dev/null
+++ b/android/res/drawable-xhdpi/ic_ptb_normal.png
Binary files differ
diff --git a/android/res/drawable-xhdpi/ptb_selector_map.xml b/android/res/drawable-xhdpi/ptb_selector_map.xml
new file mode 100644
index 0000000000..5c13b4a7d6
--- /dev/null
+++ b/android/res/drawable-xhdpi/ptb_selector_map.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:drawable="@drawable/ic_ptb_active" android:state_pressed="true"/>
+ <item android:drawable="@drawable/ic_ptb_normal"/>
+
+</selector> \ No newline at end of file
diff --git a/android/res/layout/fragment_map_object.xml b/android/res/layout/fragment_map_object.xml
index 407932298c..33dde6237c 100644
--- a/android/res/layout/fragment_map_object.xml
+++ b/android/res/layout/fragment_map_object.xml
@@ -81,13 +81,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_small"
android:text="@string/more_info" />
-
- <Button
- android:id="@+id/p2b"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/margin_small"
- android:text="@string/yopme_show_on_eink" />
</LinearLayout>
</ScrollView> \ No newline at end of file
diff --git a/android/res/layout/map.xml b/android/res/layout/map.xml
index 23809f7ebf..b078d7267c 100644
--- a/android/res/layout/map.xml
+++ b/android/res/layout/map.xml
@@ -52,6 +52,14 @@
android:singleLine="true" />
</LinearLayout>
+ <ImageButton
+ android:id="@+id/yop_it"
+ style="@style/Widget.MapButtonZoom"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|right"
+ android:src="@drawable/ptb_selector_map" />
+
<LinearLayout
android:id="@+id/navigation_buttons_container"
android:layout_width="wrap_content"
@@ -125,14 +133,6 @@
android:contentDescription="@string/bookmarks"
android:onClick="onBookmarksClicked"
android:src="@drawable/bookmarks_button" />
-
- <ImageButton
- android:id="@+id/yop_it"
- style="@style/Widget.MapButtonBottom"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="10dp"
- android:src="@drawable/ic_ptb_white" />
</LinearLayout>
</merge> \ No newline at end of file
diff --git a/android/src/com/mapswithme/maps/MapObjectFragment.java b/android/src/com/mapswithme/maps/MapObjectFragment.java
index ddaf19a637..fd3aec825a 100644
--- a/android/src/com/mapswithme/maps/MapObjectFragment.java
+++ b/android/src/com/mapswithme/maps/MapObjectFragment.java
@@ -50,6 +50,7 @@ public class MapObjectFragment extends Fragment
private static final int MENU_ADD = 0x01;
private static final int MENU_EDIT = 0x02;
private static final int MENU_SHARE = 0x10;
+ private static final int MENU_P2B = 0xFF;
private TextView mNameTV;
private TextView mGroupTV;
@@ -60,7 +61,6 @@ public class MapObjectFragment extends Fragment
private Button mEditBmk;
private Button mShare;
private Button mOpenWith;
- private Button mYotaP2B;
//POI, API
@@ -204,7 +204,6 @@ public class MapObjectFragment extends Fragment
mEditBmk = (Button) view.findViewById(R.id.editBookmark);
mOpenWith = (Button) view.findViewById(R.id.openWith);
mShare = (Button) view.findViewById(R.id.share);
- mYotaP2B = (Button) view.findViewById(R.id.p2b);
// set up listeners, drawables, visibility
mAddToBookmarks.setOnClickListener(this);
@@ -224,29 +223,9 @@ public class MapObjectFragment extends Fragment
UiUtils.show(mShare);
}
- yotaSetup();
-
return view;
}
- private void yotaSetup()
- {
- if (!Yota.isYota())
- UiUtils.hide(mYotaP2B);
- else
- {
- mYotaP2B.setOnClickListener(new OnClickListener()
- {
- @Override
- public void onClick(View v)
- {
- final boolean addLastKnown = MWMApplication.get().getLocationState().hasPosition();
- Yota.showPoi(getActivity(), mLat, mLon, Framework.getDrawScale(), mName, addLastKnown);
- }
- });
- }
- }
-
@Override
public void onResume()
{
@@ -360,12 +339,12 @@ public class MapObjectFragment extends Fragment
Utils.addMenuCompat(menu, MENU_SHARE, MENU_SHARE, R.string.share, R.drawable.share);
-// if (Yota.isYota())
-// {
-// menu.add(Menu.NONE, 0, 999, "Yota")
-// .setIcon(R.drawable.ic_ptb_gray)
-// .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
-// }
+ if (Yota.isYota())
+ {
+ menu.add(Menu.NONE, MENU_P2B, MENU_P2B, getString(R.string.yopme_show_on_eink))
+ .setIcon(R.drawable.ic_ptb_gray)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+ }
}
@Override
@@ -391,6 +370,11 @@ public class MapObjectFragment extends Fragment
onAddBookmarkClicked();
else if (itemId == MENU_EDIT)
onEditBookmarkClicked();
+ else if (itemId == MENU_P2B)
+ {
+ final boolean addLastKnown = MWMApplication.get().getLocationState().hasPosition();
+ Yota.showPoi(getActivity(), mLat, mLon, Framework.getDrawScale(), mName, addLastKnown);
+ }
return super.onOptionsItemSelected(item);
}