From ef90a431d4d3e54b1102029b3b615bb8f6fd8e6b Mon Sep 17 00:00:00 2001 From: Dmitry Donskoy Date: Fri, 12 Jul 2019 19:01:27 +0300 Subject: [PATCH] [android] Removed per month/year views - subscription screens, adjusted views' heights --- .../res/layout/subscription_offer_card.xml | 78 ++++++------------- android/res/values/dimens.xml | 2 + .../BookmarkSubscriptionFragment.java | 7 +- .../maps/widget/placepage/PlacePageView.java | 2 +- 4 files changed, 27 insertions(+), 62 deletions(-) diff --git a/android/res/layout/subscription_offer_card.xml b/android/res/layout/subscription_offer_card.xml index 001ff00519..4037524532 100644 --- a/android/res/layout/subscription_offer_card.xml +++ b/android/res/layout/subscription_offer_card.xml @@ -17,7 +17,9 @@ android:layout_weight="1" android:orientation="vertical" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:minHeight="@dimen/subs_card_min_height" + android:minWidth="@dimen/subs_card_min_width" app:cardBackgroundColor="?attr/bookmarkSubscriptionCardBg" app:cardCornerRadius="@dimen/margin_half_plus_eight" @@ -74,6 +76,8 @@ android:textAppearance="?android:attr/textAppearance" android:fontFamily="@string/robotoRegular" android:duplicateParentState="true" + android:lines="2" + android:ellipsize="middle" android:textStyle="normal" android:textColor="?attr/bookmarkSubscriptionCardTextColor" android:text="@string/annual_subscription_message" @@ -100,39 +104,18 @@ android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center" android:duplicateParentState="true" - android:lines="1" android:text="3.99$" tools:text="3.99$" tools:ignore="UnusedAttribute"/> - - + @@ -225,38 +212,17 @@ android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center" android:duplicateParentState="true" - android:lines="1" android:text="3.99$" tools:text="3.99$" tools:ignore="UnusedAttribute"/> - - + diff --git a/android/res/values/dimens.xml b/android/res/values/dimens.xml index 33e1346d2a..33324333c6 100644 --- a/android/res/values/dimens.xml +++ b/android/res/values/dimens.xml @@ -266,4 +266,6 @@ 288dp + 226dp + 164dp diff --git a/android/src/com/mapswithme/maps/purchase/BookmarkSubscriptionFragment.java b/android/src/com/mapswithme/maps/purchase/BookmarkSubscriptionFragment.java index 174272159c..66cf7b9500 100644 --- a/android/src/com/mapswithme/maps/purchase/BookmarkSubscriptionFragment.java +++ b/android/src/com/mapswithme/maps/purchase/BookmarkSubscriptionFragment.java @@ -16,7 +16,6 @@ import com.mapswithme.maps.R; import com.mapswithme.maps.base.BaseMwmFragment; import com.mapswithme.maps.bookmarks.data.BookmarkManager; import com.mapswithme.maps.dialog.AlertDialogCallback; -import com.mapswithme.maps.widget.placepage.PlacePageView; import com.mapswithme.util.Utils; import com.mapswithme.util.log.Logger; import com.mapswithme.util.log.LoggerFactory; @@ -185,9 +184,7 @@ public class BookmarkSubscriptionFragment extends BaseMwmFragment TextView priceView = getViewOrThrow().findViewById(R.id.annual_price); priceView.setText(price); TextView savingView = getViewOrThrow().findViewById(R.id.sale); - String text = getString(R.string.annual_save_component, - String.valueOf(calculateYearlySavingInPercents())) - + PlacePageView.DISCOUNT_SUFFIX; + String text = getString(R.string.annual_save_component, calculateYearlySaving()); savingView.setText(text); } @@ -199,7 +196,7 @@ public class BookmarkSubscriptionFragment extends BaseMwmFragment priceView.setText(price); } - private int calculateYearlySavingInPercents() + private int calculateYearlySaving() { float pricePerMonth = getProductDetailsForPeriod(PurchaseUtils.Period.P1M).getPrice(); float pricePerYear = getProductDetailsForPeriod(PurchaseUtils.Period.P1Y).getPrice(); diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 5ffa141280..d059dac913 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -138,7 +138,7 @@ public class PlacePageView extends NestedScrollView private static final String TAG = PlacePageView.class.getSimpleName(); private static final String PREF_USE_DMS = "use_dms"; private static final String DISCOUNT_PREFIX = "-"; - public static final String DISCOUNT_SUFFIX = "%"; + private static final String DISCOUNT_SUFFIX = "%"; private boolean mIsDocked; private boolean mIsFloating;