diff options
author | Dmitry Donskoy <donskdmitry@mail.ru> | 2018-08-08 11:11:36 +0300 |
---|---|---|
committer | Aleksey Belousov <beloal@users.noreply.github.com> | 2018-08-10 20:16:14 +0300 |
commit | 9281f35d728e033ae73d800cf4a04c3c2cf1f43f (patch) | |
tree | 665f36237e0e1734941c1340217b8d9a8a682920 /android/src/com/mapswithme/maps | |
parent | b97924f14b79c3ca66037746f3170c6aff11b778 (diff) |
[android] Added smart deal flag supporting
Diffstat (limited to 'android/src/com/mapswithme/maps')
-rw-r--r-- | android/src/com/mapswithme/maps/widget/placepage/HotelPriceInfo.java | 5 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/android/src/com/mapswithme/maps/widget/placepage/HotelPriceInfo.java b/android/src/com/mapswithme/maps/widget/placepage/HotelPriceInfo.java index cccb70791e..b87104473a 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/HotelPriceInfo.java +++ b/android/src/com/mapswithme/maps/widget/placepage/HotelPriceInfo.java @@ -46,6 +46,11 @@ public class HotelPriceInfo return 20; } + public boolean hasSmartDeal() + { + return mHasSmartDeal; + } + @Override public String toString() { diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 13d9f3e86c..4f02299bc2 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -1474,11 +1474,13 @@ public class PlacePageView extends RelativeLayout @Nullable private String getHotelDiscount() { - boolean hasDiscount = mPriceInfo != null && mPriceInfo.getDiscount() > 0; - return hasDiscount ? new StringBuilder().append(DISCOUNT_PREFIX) - .append(mPriceInfo.getDiscount()) - .append(DISCOUNT_SUFFIX).toString() - : null; + boolean hasPercentsDiscount = mPriceInfo != null && mPriceInfo.getDiscount() > 0; + if (hasPercentsDiscount) + return new StringBuilder().append(DISCOUNT_PREFIX) + .append(mPriceInfo.getDiscount()) + .append(DISCOUNT_SUFFIX).toString(); + + return mPriceInfo != null && mPriceInfo.hasSmartDeal() ? DISCOUNT_SUFFIX : null; } private boolean isSponsored() |