diff --git a/OsmAnd/res/drawable/bg_card_orange.xml b/OsmAnd/res/drawable/bg_card_orange.xml
new file mode 100644
index 0000000000..1eac7a0dfe
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_card_orange.xml
@@ -0,0 +1,14 @@
+
+
+ -
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/btn_round_shade.xml b/OsmAnd/res/drawable/btn_round_shade.xml
new file mode 100644
index 0000000000..24d01d3f77
--- /dev/null
+++ b/OsmAnd/res/drawable/btn_round_shade.xml
@@ -0,0 +1,13 @@
+
+
+
+ -
+
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/live_updates_header.xml b/OsmAnd/res/layout/live_updates_header.xml
index 673ef3052a..89423ff74c 100644
--- a/OsmAnd/res/layout/live_updates_header.xml
+++ b/OsmAnd/res/layout/live_updates_header.xml
@@ -13,7 +13,7 @@
android:id="@+id/subscription_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@color/osmand_orange"
+ android:background="@drawable/bg_card_orange"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingLeft="24dp"
@@ -60,7 +60,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/color_white"
- android:background="@drawable/btn_round_transparent"
+ android:background="@drawable/btn_round_shade"
android:text="@string/shared_string_read_more"/>
diff --git a/OsmAnd/res/layout/subscription_fragment.xml b/OsmAnd/res/layout/subscription_fragment.xml
index a2f7195c49..778c7314fc 100644
--- a/OsmAnd/res/layout/subscription_fragment.xml
+++ b/OsmAnd/res/layout/subscription_fragment.xml
@@ -63,6 +63,7 @@
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
+ android:paddingLeft="2dp"
android:hint="@string/shared_string_email_address"
android:inputType="textEmailAddress"/>
@@ -72,6 +73,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:paddingLeft="2dp"
android:layout_marginLeft="72dp"
android:layout_marginRight="16dp"
android:text="@string/osm_live_email_desc"
@@ -103,6 +105,7 @@
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
+ android:paddingLeft="2dp"
android:hint="@string/osm_live_user_public_name"
android:inputType="text"/>
@@ -117,6 +120,7 @@
android:layout_marginLeft="72dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
+ android:paddingLeft="2dp"
android:text="@string/osm_live_hide_user_name"
android:textColor="?android:attr/textColorPrimary"/>
@@ -148,6 +152,8 @@
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
+ android:paddingLeft="2dp"
+ android:paddingRight="0dp"
android:drawableRight="@drawable/ic_action_arrow_drop_down"
android:editable="false"
android:hint="@string/osm_live_support_region"/>
diff --git a/OsmAnd/src/net/osmand/plus/inapp/InAppHelper.java b/OsmAnd/src/net/osmand/plus/inapp/InAppHelper.java
index 9237a22a1c..0b489fd85c 100644
--- a/OsmAnd/src/net/osmand/plus/inapp/InAppHelper.java
+++ b/OsmAnd/src/net/osmand/plus/inapp/InAppHelper.java
@@ -41,14 +41,9 @@ public class InAppHelper {
private static boolean mSubscribedToLiveUpdates = false;
private static String mLiveUpdatesPrice;
- public static final String SKU_LIVE_UPDATES = "osm_live_subscription_1";
-
- // Static test
- //public static final String SKU_LIVE_UPDATES = "android.test.purchased";
- //public static final String SKU_LIVE_UPDATES = "android.test.canceled";
- //public static final String SKU_LIVE_UPDATES = "android.test.refunded";
- //public static final String SKU_LIVE_UPDATES = "android.test.item_unavailable";
-
+ private static final String SKU_LIVE_UPDATES_FULL = "osm_live_subscription_2";
+ private static final String SKU_LIVE_UPDATES_FREE = "osm_free_live_subscription_2";
+ private static String SKU_LIVE_UPDATES;
// (arbitrary) request code for the purchase flow
private static final int RC_REQUEST = 10001;
@@ -80,9 +75,20 @@ public class InAppHelper {
return mLiveUpdatesPrice;
}
+ public static String getSkuLiveUpdates() {
+ return SKU_LIVE_UPDATES;
+ }
+
public InAppHelper(OsmandApplication ctx, InAppCallbacks callbacks) {
this.ctx = ctx;
this.callbacks = callbacks;
+ if (SKU_LIVE_UPDATES == null) {
+ if (Version.isFreeVersion(ctx)) {
+ SKU_LIVE_UPDATES = SKU_LIVE_UPDATES_FREE;
+ } else {
+ SKU_LIVE_UPDATES = SKU_LIVE_UPDATES_FULL;
+ }
+ }
}
public void start(final boolean stopAfterResult) {
@@ -110,7 +116,7 @@ public class InAppHelper {
mHelper = new IabHelper(ctx, base64EncodedPublicKey);
// enable debug logging (for a production application, you should set this to false).
- mHelper.enableDebugLogging(true);
+ mHelper.enableDebugLogging(false);
// Start setup. This is asynchronous and the specified listener
// will be called once setup completes.
@@ -401,7 +407,7 @@ public class InAppHelper {
}
private String sendRequest(String url, Map parameters, String userOperation) {
- Log.d(TAG, "Sending request " + url); //$NON-NLS-1$
+ Log.d(TAG, "Sending request " + url);
HttpURLConnection connection = null;
try {
connection = NetworkUtils.getHttpURLConnection(url);
diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java
index 81f561ad28..eb9d47de7f 100644
--- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java
@@ -78,7 +78,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment {
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_live_updates, container, false);
listView = (ExpandableListView) view.findViewById(android.R.id.list);
-// View header = inflater.inflate(R.layout.live_updates_header, listView, false);
View bottomShadowView = inflater.inflate(R.layout.shadow_bottom, listView, false);
listView.addFooterView(bottomShadowView);
diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java
index 03201a876e..fe895a1e4a 100644
--- a/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java
+++ b/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java
@@ -172,7 +172,7 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In
@Override
public void onItemPurchased(String sku) {
- if (InAppHelper.SKU_LIVE_UPDATES.equals(sku)) {
+ if (InAppHelper.getSkuLiveUpdates().equals(sku)) {
Fragment parentFragment = getParentFragment();
if (parentFragment instanceof LiveUpdatesFragment) {
((LiveUpdatesFragment) parentFragment).updateSubscriptionBanner();
@@ -190,6 +190,7 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In
dlg = new ProgressDialog(getActivity());
dlg.setTitle("");
dlg.setMessage(getString(R.string.wait_current_task_finished));
+ dlg.setCancelable(false);
dlg.show();
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
index 3a295e79de..d6aea8dd3f 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
@@ -76,6 +76,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
private int menuBottomViewHeight;
private int menuFullHeight;
private int menuFullHeightMax;
+ private int menuTopViewHeightExcludingTitle;
+ private int menuTitleTopBottomPadding;
private int screenHeight;
private int viewHeight;
@@ -717,8 +719,19 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
menuFullHeight = view.findViewById(R.id.context_menu_main).getHeight();
int dy = 0;
- if (!menu.isLandscapeLayout() && menuTopViewHeight != 0) {
- dy = Math.max(0, newMenuTopViewHeight - menuTopViewHeight - (newMenuTopShadowAllHeight - menuTopShadowAllHeight));
+ if (!menu.isLandscapeLayout()) {
+ TextView line1 = (TextView) view.findViewById(R.id.context_menu_line1);
+ if (menuTopViewHeight != 0) {
+ int titleHeight = line1.getLineCount() * line1.getLineHeight() + menuTitleTopBottomPadding;
+ if (titleHeight < line1.getMeasuredHeight()) {
+ titleHeight = line1.getMeasuredHeight();
+ }
+ newMenuTopViewHeight = menuTopViewHeightExcludingTitle + titleHeight;
+ dy = Math.max(0, newMenuTopViewHeight - menuTopViewHeight - (newMenuTopShadowAllHeight - menuTopShadowAllHeight));
+ } else {
+ menuTopViewHeightExcludingTitle = newMenuTopViewHeight - line1.getMeasuredHeight();
+ menuTitleTopBottomPadding = line1.getMeasuredHeight() - line1.getLineCount() * line1.getLineHeight();
+ }
}
menuTopViewHeight = newMenuTopViewHeight;
menuTopShadowAllHeight = newMenuTopShadowAllHeight;