Showing
23 changed files
with
301 additions
and
109 deletions
| ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
| 2 | 2 | ||
| 3 | ext { | 3 | ext { |
| 4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
| 5 | - PUBLISH_VERSION = '4.5.4.6rc51' | 5 | + PUBLISH_VERSION = '4.5.4.6rc52' |
| 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
| 7 | } | 7 | } |
| 8 | 8 | ... | ... |
| ... | @@ -107,6 +107,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -107,6 +107,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
| 107 | new Thread(() -> { | 107 | new Thread(() -> { |
| 108 | if (!Thread.currentThread().isInterrupted()) { | 108 | if (!Thread.currentThread().isInterrupted()) { |
| 109 | WarplyManager.getSharingHistory(new WarplySharingHistoryRequest() | 109 | WarplyManager.getSharingHistory(new WarplySharingHistoryRequest() |
| 110 | + .setExcludeFilter("supermarket") | ||
| 110 | , mSharingHistoryCallback); | 111 | , mSharingHistoryCallback); |
| 111 | } | 112 | } |
| 112 | Thread.currentThread().interrupt(); | 113 | Thread.currentThread().interrupt(); | ... | ... |
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyMarketAnalysisActivity.java
0 → 100644
This diff is collapsed. Click to expand it.
| ... | @@ -282,8 +282,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -282,8 +282,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie |
| 282 | analyticsEvent.setEventName("did_tap_market_badge"); | 282 | analyticsEvent.setEventName("did_tap_market_badge"); |
| 283 | analyticsEvent.setParameter("screen", "Loyalty Wallet"); | 283 | analyticsEvent.setParameter("screen", "Loyalty Wallet"); |
| 284 | EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | 284 | EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); |
| 285 | -// Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class); //TODO: uncomment it | 285 | + Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class); |
| 286 | -// startActivity(intent); | 286 | + startActivity(intent); |
| 287 | } | 287 | } |
| 288 | return; | 288 | return; |
| 289 | } | 289 | } |
| ... | @@ -391,7 +391,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -391,7 +391,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie |
| 391 | if (mUnifiedCoupons != null && mUnifiedCoupons.size() > 0) { | 391 | if (mUnifiedCoupons != null && mUnifiedCoupons.size() > 0) { |
| 392 | ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>(); | 392 | ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>(); |
| 393 | for (UnifiedCoupon unicpn : mUnifiedCoupons) { | 393 | for (UnifiedCoupon unicpn : mUnifiedCoupons) { |
| 394 | - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss", Locale.US); | 394 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); |
| 395 | Date newDate = new Date(); | 395 | Date newDate = new Date(); |
| 396 | try { | 396 | try { |
| 397 | newDate = simpleDateFormat.parse(unicpn.getCreated()); | 397 | newDate = simpleDateFormat.parse(unicpn.getCreated()); |
| ... | @@ -401,7 +401,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -401,7 +401,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie |
| 401 | unicpn.setExpirationDate(newDate); | 401 | unicpn.setExpirationDate(newDate); |
| 402 | unilist.add(unicpn); | 402 | unilist.add(unicpn); |
| 403 | } | 403 | } |
| 404 | + | ||
| 404 | Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate())); | 405 | Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate())); |
| 406 | + | ||
| 405 | mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist); | 407 | mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist); |
| 406 | mRvMarketCoupons.setAdapter(mAdapterMarketCoupons); | 408 | mRvMarketCoupons.setAdapter(mAdapterMarketCoupons); |
| 407 | mAdapterMarketCoupons.getPositionClicks() | 409 | mAdapterMarketCoupons.getPositionClicks() | ... | ... |
| ... | @@ -46,6 +46,7 @@ import ly.warp.sdk.io.models.Merchant; | ... | @@ -46,6 +46,7 @@ import ly.warp.sdk.io.models.Merchant; |
| 46 | import ly.warp.sdk.io.models.MerchantList; | 46 | import ly.warp.sdk.io.models.MerchantList; |
| 47 | import ly.warp.sdk.io.request.WarplyMerchantsRequest; | 47 | import ly.warp.sdk.io.request.WarplyMerchantsRequest; |
| 48 | import ly.warp.sdk.utils.WarplyManagerHelper; | 48 | import ly.warp.sdk.utils.WarplyManagerHelper; |
| 49 | +import ly.warp.sdk.utils.WarplyProperty; | ||
| 49 | import ly.warp.sdk.utils.constants.WarpConstants; | 50 | import ly.warp.sdk.utils.constants.WarpConstants; |
| 50 | import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; | 51 | import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; |
| 51 | import ly.warp.sdk.utils.managers.WarplyManager; | 52 | import ly.warp.sdk.utils.managers.WarplyManager; |
| ... | @@ -84,12 +85,14 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -84,12 +85,14 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
| 84 | setContentView(R.layout.activity_shops); | 85 | setContentView(R.layout.activity_shops); |
| 85 | 86 | ||
| 86 | mCouponset = (Couponset) getIntent().getSerializableExtra("couponset"); | 87 | mCouponset = (Couponset) getIntent().getSerializableExtra("couponset"); |
| 88 | + if (mCouponset != null) { | ||
| 87 | for (Merchant merchant : WarplyManagerHelper.getMerchantList()) { | 89 | for (Merchant merchant : WarplyManagerHelper.getMerchantList()) { |
| 88 | if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) { | 90 | if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) { |
| 89 | mMerchant = merchant; | 91 | mMerchant = merchant; |
| 90 | break; | 92 | break; |
| 91 | } | 93 | } |
| 92 | } | 94 | } |
| 95 | + } | ||
| 93 | 96 | ||
| 94 | mIvBack = findViewById(R.id.iv_shops_back); | 97 | mIvBack = findViewById(R.id.iv_shops_back); |
| 95 | mMapView = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops); | 98 | mMapView = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops); |
| ... | @@ -189,6 +192,18 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -189,6 +192,18 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
| 189 | } | 192 | } |
| 190 | Thread.currentThread().interrupt(); | 193 | Thread.currentThread().interrupt(); |
| 191 | }).start(); | 194 | }).start(); |
| 195 | + } else { | ||
| 196 | + ArrayList<String> catuuids = new ArrayList<>(); | ||
| 197 | + catuuids.add(WarplyProperty.getAppUuid(this).equals("0086a2088301440792091b9f814c2267") ? "" : "adcace6cab6049c7b7271bc85bc2b26d"); //TODO: add live cat uuid | ||
| 198 | + new Thread(() -> { | ||
| 199 | + if (!Thread.currentThread().isInterrupted()) { | ||
| 200 | + WarplyManager.getMerchantsMultilingual(new WarplyMerchantsRequest() | ||
| 201 | + .setIsMultilingual(true) | ||
| 202 | + .setCategories(catuuids) | ||
| 203 | + , mMerchantsCallback); | ||
| 204 | + } | ||
| 205 | + Thread.currentThread().interrupt(); | ||
| 206 | + }).start(); | ||
| 192 | } | 207 | } |
| 193 | } | 208 | } |
| 194 | 209 | ||
| ... | @@ -287,7 +302,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe | ... | @@ -287,7 +302,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe |
| 287 | private void openWebsite() { | 302 | private void openWebsite() { |
| 288 | WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite"); | 303 | WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite"); |
| 289 | 304 | ||
| 290 | - if (!TextUtils.isEmpty(mMerchant.getWebsite())) { | 305 | + if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getWebsite())) { |
| 291 | try { | 306 | try { |
| 292 | Intent intent = new Intent(Intent.ACTION_VIEW); | 307 | Intent intent = new Intent(Intent.ACTION_VIEW); |
| 293 | intent.setData(Uri.parse(mMerchant.getWebsite())); | 308 | intent.setData(Uri.parse(mMerchant.getWebsite())); | ... | ... |
| ... | @@ -45,6 +45,7 @@ import ly.warp.sdk.io.models.Merchant; | ... | @@ -45,6 +45,7 @@ import ly.warp.sdk.io.models.Merchant; |
| 45 | import ly.warp.sdk.io.models.MerchantList; | 45 | import ly.warp.sdk.io.models.MerchantList; |
| 46 | import ly.warp.sdk.io.request.WarplyMerchantsRequest; | 46 | import ly.warp.sdk.io.request.WarplyMerchantsRequest; |
| 47 | import ly.warp.sdk.utils.WarplyManagerHelper; | 47 | import ly.warp.sdk.utils.WarplyManagerHelper; |
| 48 | +import ly.warp.sdk.utils.WarplyProperty; | ||
| 48 | import ly.warp.sdk.utils.constants.WarpConstants; | 49 | import ly.warp.sdk.utils.constants.WarpConstants; |
| 49 | import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; | 50 | import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; |
| 50 | import ly.warp.sdk.utils.managers.WarplyManager; | 51 | import ly.warp.sdk.utils.managers.WarplyManager; |
| ... | @@ -83,12 +84,14 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -83,12 +84,14 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
| 83 | setContentView(R.layout.activity_shops_huawei); | 84 | setContentView(R.layout.activity_shops_huawei); |
| 84 | 85 | ||
| 85 | mCouponset = (Couponset) getIntent().getSerializableExtra("couponset"); | 86 | mCouponset = (Couponset) getIntent().getSerializableExtra("couponset"); |
| 87 | + if (mCouponset != null) { | ||
| 86 | for (Merchant merchant : WarplyManagerHelper.getMerchantList()) { | 88 | for (Merchant merchant : WarplyManagerHelper.getMerchantList()) { |
| 87 | if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) { | 89 | if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) { |
| 88 | mMerchant = merchant; | 90 | mMerchant = merchant; |
| 89 | break; | 91 | break; |
| 90 | } | 92 | } |
| 91 | } | 93 | } |
| 94 | + } | ||
| 92 | 95 | ||
| 93 | mIvBack = findViewById(R.id.iv_shops_back); | 96 | mIvBack = findViewById(R.id.iv_shops_back); |
| 94 | mSupportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops_huawei); | 97 | mSupportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops_huawei); |
| ... | @@ -190,6 +193,18 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -190,6 +193,18 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
| 190 | } | 193 | } |
| 191 | Thread.currentThread().interrupt(); | 194 | Thread.currentThread().interrupt(); |
| 192 | }).start(); | 195 | }).start(); |
| 196 | + } else { | ||
| 197 | + ArrayList<String> catuuids = new ArrayList<>(); | ||
| 198 | + catuuids.add(WarplyProperty.getAppUuid(this).equals("0086a2088301440792091b9f814c2267") ? "" : "adcace6cab6049c7b7271bc85bc2b26d"); //TODO: add live cat uuid | ||
| 199 | + new Thread(() -> { | ||
| 200 | + if (!Thread.currentThread().isInterrupted()) { | ||
| 201 | + WarplyManager.getMerchantsMultilingual(new WarplyMerchantsRequest() | ||
| 202 | + .setIsMultilingual(true) | ||
| 203 | + .setCategories(catuuids) | ||
| 204 | + , mMerchantsCallback); | ||
| 205 | + } | ||
| 206 | + Thread.currentThread().interrupt(); | ||
| 207 | + }).start(); | ||
| 193 | } | 208 | } |
| 194 | } | 209 | } |
| 195 | 210 | ||
| ... | @@ -304,7 +319,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic | ... | @@ -304,7 +319,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic |
| 304 | private void openWebsite() { | 319 | private void openWebsite() { |
| 305 | WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite"); | 320 | WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite"); |
| 306 | 321 | ||
| 307 | - if (!TextUtils.isEmpty(mMerchant.getWebsite())) { | 322 | + if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getWebsite())) { |
| 308 | try { | 323 | try { |
| 309 | Intent intent = new Intent(Intent.ACTION_VIEW); | 324 | Intent intent = new Intent(Intent.ACTION_VIEW); |
| 310 | intent.setData(Uri.parse(mMerchant.getWebsite())); | 325 | intent.setData(Uri.parse(mMerchant.getWebsite())); | ... | ... |
| 1 | package ly.warp.sdk.io.request; | 1 | package ly.warp.sdk.io.request; |
| 2 | 2 | ||
| 3 | +import android.text.TextUtils; | ||
| 3 | import android.util.Base64; | 4 | import android.util.Base64; |
| 4 | 5 | ||
| 6 | +import org.json.JSONArray; | ||
| 5 | import org.json.JSONException; | 7 | import org.json.JSONException; |
| 6 | import org.json.JSONObject; | 8 | import org.json.JSONObject; |
| 7 | 9 | ||
| ... | @@ -24,6 +26,10 @@ public class WarplySharingHistoryRequest { | ... | @@ -24,6 +26,10 @@ public class WarplySharingHistoryRequest { |
| 24 | 26 | ||
| 25 | private final String KEY_ACTION = "action"; | 27 | private final String KEY_ACTION = "action"; |
| 26 | private final String KEY_ACTION_VALUE = "sharing_history"; | 28 | private final String KEY_ACTION_VALUE = "sharing_history"; |
| 29 | + private final String KEY_EXCLUDE = "exclude"; | ||
| 30 | + private final String KEY_FIELD = "field"; | ||
| 31 | + private final String KEY_VALUE = "value"; | ||
| 32 | + private final String KEY_TYPE = "couponset_types"; | ||
| 27 | 33 | ||
| 28 | // =========================================================== | 34 | // =========================================================== |
| 29 | // Fields | 35 | // Fields |
| ... | @@ -31,6 +37,8 @@ public class WarplySharingHistoryRequest { | ... | @@ -31,6 +37,8 @@ public class WarplySharingHistoryRequest { |
| 31 | 37 | ||
| 32 | private HashMap<String, String> mFilters; | 38 | private HashMap<String, String> mFilters; |
| 33 | private long mCacheUpdateInterval = 0; | 39 | private long mCacheUpdateInterval = 0; |
| 40 | + private String mExcludeFilter = ""; | ||
| 41 | + private String mType = ""; | ||
| 34 | 42 | ||
| 35 | // =========================================================== | 43 | // =========================================================== |
| 36 | // Constructor | 44 | // Constructor |
| ... | @@ -128,6 +136,16 @@ public class WarplySharingHistoryRequest { | ... | @@ -128,6 +136,16 @@ public class WarplySharingHistoryRequest { |
| 128 | return this; | 136 | return this; |
| 129 | } | 137 | } |
| 130 | 138 | ||
| 139 | + public WarplySharingHistoryRequest setExcludeFilter(String excludeFilter) { | ||
| 140 | + mExcludeFilter = excludeFilter; | ||
| 141 | + return this; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + public WarplySharingHistoryRequest setType(String type) { | ||
| 145 | + mType = type; | ||
| 146 | + return this; | ||
| 147 | + } | ||
| 148 | + | ||
| 131 | /** | 149 | /** |
| 132 | * Call this to build the offers Json object | 150 | * Call this to build the offers Json object |
| 133 | * | 151 | * |
| ... | @@ -137,6 +155,19 @@ public class WarplySharingHistoryRequest { | ... | @@ -137,6 +155,19 @@ public class WarplySharingHistoryRequest { |
| 137 | JSONObject bodyJsonObject = new JSONObject(); | 155 | JSONObject bodyJsonObject = new JSONObject(); |
| 138 | try { | 156 | try { |
| 139 | bodyJsonObject.putOpt(KEY_ACTION, KEY_ACTION_VALUE); | 157 | bodyJsonObject.putOpt(KEY_ACTION, KEY_ACTION_VALUE); |
| 158 | + if (!TextUtils.isEmpty(mExcludeFilter)) { | ||
| 159 | + JSONObject excludesKey = new JSONObject(); | ||
| 160 | + try { | ||
| 161 | + excludesKey.putOpt(KEY_FIELD, "couponset_type"); | ||
| 162 | + excludesKey.putOpt(KEY_VALUE, new JSONArray().put(mExcludeFilter)); | ||
| 163 | + } catch (JSONException e) { | ||
| 164 | + e.printStackTrace(); | ||
| 165 | + } | ||
| 166 | + bodyJsonObject.put(KEY_EXCLUDE, new JSONArray().put(excludesKey)); | ||
| 167 | + } | ||
| 168 | + if (!TextUtils.isEmpty(mType)) { | ||
| 169 | + bodyJsonObject.put(KEY_TYPE, new JSONArray().put(mType)); | ||
| 170 | + } | ||
| 140 | } catch (JSONException e) { | 171 | } catch (JSONException e) { |
| 141 | if (WarpConstants.DEBUG) | 172 | if (WarpConstants.DEBUG) |
| 142 | e.printStackTrace(); | 173 | e.printStackTrace(); | ... | ... |
| ... | @@ -1252,6 +1252,7 @@ public class WarplyManagerHelper { | ... | @@ -1252,6 +1252,7 @@ public class WarplyManagerHelper { |
| 1252 | public static ArrayList<UnifiedCoupon> getMarketCoupons() { | 1252 | public static ArrayList<UnifiedCoupon> getMarketCoupons() { |
| 1253 | return mMarketCoupons; | 1253 | return mMarketCoupons; |
| 1254 | } | 1254 | } |
| 1255 | + | ||
| 1255 | public static void setMarketCoupons( ArrayList<UnifiedCoupon> marketCoupons) { | 1256 | public static void setMarketCoupons( ArrayList<UnifiedCoupon> marketCoupons) { |
| 1256 | mMarketCoupons = marketCoupons; | 1257 | mMarketCoupons = marketCoupons; |
| 1257 | } | 1258 | } | ... | ... |
| ... | @@ -2286,6 +2286,14 @@ public class WarplyManager { | ... | @@ -2286,6 +2286,14 @@ public class WarplyManager { |
| 2286 | jsonParams.put("active", true); | 2286 | jsonParams.put("active", true); |
| 2287 | jsonParams.put("visible", true); | 2287 | jsonParams.put("visible", true); |
| 2288 | jsonParams.put("language", WarplyProperty.getLanguage(Warply.getWarplyContext())); | 2288 | jsonParams.put("language", WarplyProperty.getLanguage(Warply.getWarplyContext())); |
| 2289 | + JSONObject excludesKey = new JSONObject(); | ||
| 2290 | + try { | ||
| 2291 | + excludesKey.putOpt("field", "couponset_type"); | ||
| 2292 | + excludesKey.putOpt("value", new JSONArray().put("supermarket")); | ||
| 2293 | + } catch (JSONException e) { | ||
| 2294 | + e.printStackTrace(); | ||
| 2295 | + } | ||
| 2296 | + jsonParams.put("exclude", new JSONArray().put(excludesKey)); | ||
| 2289 | 2297 | ||
| 2290 | jsonParamsCouponsets.put("coupon", jsonParams); | 2298 | jsonParamsCouponsets.put("coupon", jsonParams); |
| 2291 | RequestBody couponsetsRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsCouponsets)).toString()); | 2299 | RequestBody couponsetsRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsCouponsets)).toString()); | ... | ... |
| 1 | package ly.warp.sdk.views.adapters; | 1 | package ly.warp.sdk.views.adapters; |
| 2 | + | ||
| 2 | import android.content.Context; | 3 | import android.content.Context; |
| 3 | import android.os.Build; | 4 | import android.os.Build; |
| 4 | import android.text.Html; | 5 | import android.text.Html; |
| ... | @@ -9,16 +10,20 @@ import android.view.ViewGroup; | ... | @@ -9,16 +10,20 @@ import android.view.ViewGroup; |
| 9 | import android.widget.ImageView; | 10 | import android.widget.ImageView; |
| 10 | import android.widget.LinearLayout; | 11 | import android.widget.LinearLayout; |
| 11 | import android.widget.TextView; | 12 | import android.widget.TextView; |
| 13 | + | ||
| 12 | import androidx.constraintlayout.widget.ConstraintLayout; | 14 | import androidx.constraintlayout.widget.ConstraintLayout; |
| 13 | import androidx.core.content.ContextCompat; | 15 | import androidx.core.content.ContextCompat; |
| 14 | import androidx.recyclerview.widget.RecyclerView; | 16 | import androidx.recyclerview.widget.RecyclerView; |
| 17 | + | ||
| 15 | import com.bumptech.glide.Glide; | 18 | import com.bumptech.glide.Glide; |
| 16 | import com.bumptech.glide.load.engine.DiskCacheStrategy; | 19 | import com.bumptech.glide.load.engine.DiskCacheStrategy; |
| 20 | + | ||
| 17 | import java.text.ParseException; | 21 | import java.text.ParseException; |
| 18 | import java.text.SimpleDateFormat; | 22 | import java.text.SimpleDateFormat; |
| 19 | import java.util.Date; | 23 | import java.util.Date; |
| 20 | import java.util.Locale; | 24 | import java.util.Locale; |
| 21 | import java.util.concurrent.TimeUnit; | 25 | import java.util.concurrent.TimeUnit; |
| 26 | + | ||
| 22 | import io.reactivex.Observable; | 27 | import io.reactivex.Observable; |
| 23 | import io.reactivex.subjects.PublishSubject; | 28 | import io.reactivex.subjects.PublishSubject; |
| 24 | import ly.warp.sdk.R; | 29 | import ly.warp.sdk.R; |
| ... | @@ -26,33 +31,39 @@ import ly.warp.sdk.io.models.Coupon; | ... | @@ -26,33 +31,39 @@ import ly.warp.sdk.io.models.Coupon; |
| 26 | import ly.warp.sdk.io.models.CouponList; | 31 | import ly.warp.sdk.io.models.CouponList; |
| 27 | import ly.warp.sdk.io.models.Merchant; | 32 | import ly.warp.sdk.io.models.Merchant; |
| 28 | import ly.warp.sdk.utils.WarplyManagerHelper; | 33 | import ly.warp.sdk.utils.WarplyManagerHelper; |
| 34 | + | ||
| 29 | public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapter.ActiveCouponViewHolder> { | 35 | public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapter.ActiveCouponViewHolder> { |
| 30 | private Context mContext; | 36 | private Context mContext; |
| 31 | private CouponList mCoupons; | 37 | private CouponList mCoupons; |
| 32 | private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); | 38 | private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); |
| 33 | private boolean mIsPast = false, mIsCustom = false; | 39 | private boolean mIsPast = false, mIsCustom = false; |
| 40 | + | ||
| 34 | public ActiveCouponAdapter(Context mContext, CouponList campaignList) { | 41 | public ActiveCouponAdapter(Context mContext, CouponList campaignList) { |
| 35 | this.mContext = mContext; | 42 | this.mContext = mContext; |
| 36 | this.mCoupons = campaignList; | 43 | this.mCoupons = campaignList; |
| 37 | this.mIsPast = false; | 44 | this.mIsPast = false; |
| 38 | } | 45 | } |
| 46 | + | ||
| 39 | public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past) { | 47 | public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past) { |
| 40 | this.mContext = mContext; | 48 | this.mContext = mContext; |
| 41 | this.mCoupons = campaignList; | 49 | this.mCoupons = campaignList; |
| 42 | this.mIsPast = past; | 50 | this.mIsPast = past; |
| 43 | } | 51 | } |
| 52 | + | ||
| 44 | public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past, boolean custom) { | 53 | public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past, boolean custom) { |
| 45 | this.mContext = mContext; | 54 | this.mContext = mContext; |
| 46 | this.mCoupons = campaignList; | 55 | this.mCoupons = campaignList; |
| 47 | this.mIsPast = past; | 56 | this.mIsPast = past; |
| 48 | this.mIsCustom = custom; | 57 | this.mIsCustom = custom; |
| 49 | } | 58 | } |
| 59 | + | ||
| 50 | public class ActiveCouponViewHolder extends RecyclerView.ViewHolder { | 60 | public class ActiveCouponViewHolder extends RecyclerView.ViewHolder { |
| 51 | private ImageView ivCouponLogo, ivCouponBackground; | 61 | private ImageView ivCouponLogo, ivCouponBackground; |
| 52 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit, | 62 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit, |
| 53 | tvCouponDescription, tvCouponDateExpired; | 63 | tvCouponDescription, tvCouponDateExpired; |
| 54 | private ConstraintLayout clCustomLayout; | 64 | private ConstraintLayout clCustomLayout; |
| 55 | private LinearLayout lLDateLimit; | 65 | private LinearLayout lLDateLimit; |
| 66 | + | ||
| 56 | public ActiveCouponViewHolder(View view) { | 67 | public ActiveCouponViewHolder(View view) { |
| 57 | super(view); | 68 | super(view); |
| 58 | ivCouponBackground = view.findViewById(R.id.iv_past_coupon_background); | 69 | ivCouponBackground = view.findViewById(R.id.iv_past_coupon_background); |
| ... | @@ -67,6 +78,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -67,6 +78,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
| 67 | lLDateLimit = view.findViewById(R.id.ll_date_limit); | 78 | lLDateLimit = view.findViewById(R.id.ll_date_limit); |
| 68 | } | 79 | } |
| 69 | } | 80 | } |
| 81 | + | ||
| 70 | @Override | 82 | @Override |
| 71 | public int getItemCount() { | 83 | public int getItemCount() { |
| 72 | if (mCoupons == null) | 84 | if (mCoupons == null) |
| ... | @@ -74,14 +86,17 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -74,14 +86,17 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
| 74 | else | 86 | else |
| 75 | return mCoupons.size(); | 87 | return mCoupons.size(); |
| 76 | } | 88 | } |
| 89 | + | ||
| 77 | public Coupon getItem(int id) { | 90 | public Coupon getItem(int id) { |
| 78 | return mCoupons.get(id); | 91 | return mCoupons.get(id); |
| 79 | } | 92 | } |
| 93 | + | ||
| 80 | public void updateData(CouponList couponList) { | 94 | public void updateData(CouponList couponList) { |
| 81 | mCoupons.clear(); | 95 | mCoupons.clear(); |
| 82 | mCoupons.addAll(couponList); | 96 | mCoupons.addAll(couponList); |
| 83 | notifyDataSetChanged(); | 97 | notifyDataSetChanged(); |
| 84 | } | 98 | } |
| 99 | + | ||
| 85 | @Override | 100 | @Override |
| 86 | public ActiveCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | 101 | public ActiveCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
| 87 | View itemView; | 102 | View itemView; |
| ... | @@ -93,6 +108,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -93,6 +108,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
| 93 | itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false); | 108 | itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false); |
| 94 | return new ActiveCouponViewHolder(itemView); | 109 | return new ActiveCouponViewHolder(itemView); |
| 95 | } | 110 | } |
| 111 | + | ||
| 96 | @Override | 112 | @Override |
| 97 | public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) { | 113 | public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) { |
| 98 | Coupon couponItem = mCoupons.get(position); | 114 | Coupon couponItem = mCoupons.get(position); |
| ... | @@ -106,13 +122,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -106,13 +122,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
| 106 | holder.tvCouponTitle.setAlpha(1.0f); | 122 | holder.tvCouponTitle.setAlpha(1.0f); |
| 107 | holder.tvCouponValue.setAlpha(1.0f); | 123 | holder.tvCouponValue.setAlpha(1.0f); |
| 108 | holder.tvCouponDescription.setAlpha(1.0f); | 124 | holder.tvCouponDescription.setAlpha(1.0f); |
| 109 | - holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background); | 125 | + holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new2); |
| 110 | } else { | 126 | } else { |
| 111 | - holder.ivCouponLogo.setAlpha(0.23f); | 127 | + holder.ivCouponLogo.setAlpha(0.29f); |
| 112 | - holder.tvCouponTitle.setAlpha(0.15f); | 128 | + holder.tvCouponTitle.setAlpha(0.29f); |
| 113 | - holder.tvCouponValue.setAlpha(0.15f); | 129 | + holder.tvCouponValue.setAlpha(0.29f); |
| 114 | - holder.tvCouponDescription.setAlpha(0.15f); | 130 | + holder.tvCouponDescription.setAlpha(0.29f); |
| 115 | - holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_gray); | 131 | + holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new2); |
| 116 | } | 132 | } |
| 117 | if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { | 133 | if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { |
| 118 | for (Merchant mer : WarplyManagerHelper.getMerchantList()) { | 134 | for (Merchant mer : WarplyManagerHelper.getMerchantList()) { |
| ... | @@ -197,16 +213,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -197,16 +213,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
| 197 | } | 213 | } |
| 198 | } | 214 | } |
| 199 | if (TextUtils.isEmpty(couponItem.getDiscount_type())) { | 215 | if (TextUtils.isEmpty(couponItem.getDiscount_type())) { |
| 200 | - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); | 216 | + holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro)); |
| 201 | } else { | 217 | } else { |
| 202 | if (couponItem.getDiscount_type().equals("value")) { | 218 | if (couponItem.getDiscount_type().equals("value")) { |
| 203 | - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); | 219 | + holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro)); |
| 204 | } else if (couponItem.getDiscount_type().equals("percentage")) { | 220 | } else if (couponItem.getDiscount_type().equals("percentage")) { |
| 205 | holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.percentage)); | 221 | holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.percentage)); |
| 206 | } else if (couponItem.getDiscount_type().equals("plus_one")) { | 222 | } else if (couponItem.getDiscount_type().equals("plus_one")) { |
| 207 | holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.plus_one)); | 223 | holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.plus_one)); |
| 208 | } else { | 224 | } else { |
| 209 | - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); | 225 | + holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro)); |
| 210 | } | 226 | } |
| 211 | } | 227 | } |
| 212 | holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); | 228 | holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); |
| ... | @@ -295,6 +311,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -295,6 +311,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
| 295 | holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); | 311 | holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); |
| 296 | } | 312 | } |
| 297 | } | 313 | } |
| 314 | + | ||
| 298 | private long getDaysBetweenDates(String start, String end) { | 315 | private long getDaysBetweenDates(String start, String end) { |
| 299 | SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); | 316 | SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); |
| 300 | Date startDate, endDate; | 317 | Date startDate, endDate; |
| ... | @@ -308,13 +325,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -308,13 +325,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
| 308 | } | 325 | } |
| 309 | return numberOfDays; | 326 | return numberOfDays; |
| 310 | } | 327 | } |
| 328 | + | ||
| 311 | private long getUnitBetweenDates(Date startDate, Date endDate, TimeUnit unit) { | 329 | private long getUnitBetweenDates(Date startDate, Date endDate, TimeUnit unit) { |
| 312 | long timeDiff = endDate.getTime() - startDate.getTime(); | 330 | long timeDiff = endDate.getTime() - startDate.getTime(); |
| 313 | return unit.convert(timeDiff, TimeUnit.MILLISECONDS); | 331 | return unit.convert(timeDiff, TimeUnit.MILLISECONDS); |
| 314 | } | 332 | } |
| 333 | + | ||
| 315 | public Observable<Coupon> getPositionClicks() { | 334 | public Observable<Coupon> getPositionClicks() { |
| 316 | return onClickSubject.cache(); | 335 | return onClickSubject.cache(); |
| 317 | } | 336 | } |
| 337 | + | ||
| 318 | private long getDifferenceDays(Date d1, Date d2) { | 338 | private long getDifferenceDays(Date d1, Date d2) { |
| 319 | long diff = d2.getTime() - d1.getTime(); | 339 | long diff = d2.getTime() - d1.getTime(); |
| 320 | return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); | 340 | return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); | ... | ... |
| ... | @@ -32,6 +32,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -32,6 +32,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 32 | private Context mContext; | 32 | private Context mContext; |
| 33 | private /*CouponList*/ ArrayList<Coupon> mCoupons; | 33 | private /*CouponList*/ ArrayList<Coupon> mCoupons; |
| 34 | private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); | 34 | private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); |
| 35 | + private boolean mIsCustom = false; | ||
| 35 | 36 | ||
| 36 | public ExpiredCouponAdapter(Context mContext, CouponList campaignList) { | 37 | public ExpiredCouponAdapter(Context mContext, CouponList campaignList) { |
| 37 | this.mContext = mContext; | 38 | this.mContext = mContext; |
| ... | @@ -43,6 +44,12 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -43,6 +44,12 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 43 | this.mCoupons = /*(CouponList)*/ campaignList; | 44 | this.mCoupons = /*(CouponList)*/ campaignList; |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 47 | + public ExpiredCouponAdapter(Context mContext, ArrayList<Coupon> campaignList, boolean custom) { | ||
| 48 | + this.mContext = mContext; | ||
| 49 | + this.mCoupons = /*(CouponList)*/ campaignList; | ||
| 50 | + this.mIsCustom = custom; | ||
| 51 | + } | ||
| 52 | + | ||
| 46 | public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { | 53 | public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { |
| 47 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate; | 54 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate; |
| 48 | private ImageView ivCouponLogo; | 55 | private ImageView ivCouponLogo; |
| ... | @@ -89,6 +96,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -89,6 +96,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 89 | Merchant merchant = new Merchant(); | 96 | Merchant merchant = new Merchant(); |
| 90 | 97 | ||
| 91 | if (couponItem != null) { | 98 | if (couponItem != null) { |
| 99 | + if (mIsCustom) { | ||
| 92 | if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { | 100 | if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { |
| 93 | for (Merchant mer : WarplyManagerHelper.getMerchantList()) { | 101 | for (Merchant mer : WarplyManagerHelper.getMerchantList()) { |
| 94 | if (mer.getUuid().equals(couponItem.getMerchantUuid())) { | 102 | if (mer.getUuid().equals(couponItem.getMerchantUuid())) { |
| ... | @@ -100,6 +108,16 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -100,6 +108,16 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 100 | 108 | ||
| 101 | if (merchant == null) { | 109 | if (merchant == null) { |
| 102 | holder.tvCouponTitle.setText(couponItem.getName()); | 110 | holder.tvCouponTitle.setText(couponItem.getName()); |
| 111 | + if (!TextUtils.isEmpty(couponItem.getImage())) { | ||
| 112 | + Glide.with(mContext) | ||
| 113 | +// .setDefaultRequestOptions( | ||
| 114 | +// RequestOptions | ||
| 115 | +// .placeholderOf(R.drawable.ic_default_contact_photo) | ||
| 116 | +// .error(R.drawable.ic_default_contact_photo)) | ||
| 117 | + .load(couponItem.getImage()) | ||
| 118 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
| 119 | + .into(holder.ivCouponLogo); | ||
| 120 | + } | ||
| 103 | } else { | 121 | } else { |
| 104 | holder.tvCouponTitle.setText(merchant.getAdminName()); | 122 | holder.tvCouponTitle.setText(merchant.getAdminName()); |
| 105 | if (!TextUtils.isEmpty(merchant.getImgPreview())) { | 123 | if (!TextUtils.isEmpty(merchant.getImgPreview())) { |
| ... | @@ -124,6 +142,48 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -124,6 +142,48 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 124 | simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); | 142 | simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); |
| 125 | holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : "")); | 143 | holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : "")); |
| 126 | 144 | ||
| 145 | + String itemValue = String.format("%.02f", Float.valueOf(couponItem.getDiscount())); | ||
| 146 | + holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro)); | ||
| 147 | + holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); | ||
| 148 | + return; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { | ||
| 152 | + for (Merchant mer : WarplyManagerHelper.getMerchantList()) { | ||
| 153 | + if (mer.getUuid().equals(couponItem.getMerchantUuid())) { | ||
| 154 | + merchant = mer; | ||
| 155 | + break; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + if (merchant == null) { | ||
| 161 | + holder.tvCouponTitle.setText(couponItem.getName()); | ||
| 162 | + } else { | ||
| 163 | + holder.tvCouponTitle.setText(merchant.getAdminName()); | ||
| 164 | + if (!TextUtils.isEmpty(merchant.getImgPreview())) { | ||
| 165 | + Glide.with(mContext) | ||
| 166 | +// .setDefaultRequestOptions( | ||
| 167 | +// RequestOptions | ||
| 168 | +// .placeholderOf(R.drawable.ic_default_contact_photo) | ||
| 169 | +// .error(R.drawable.ic_default_contact_photo)) | ||
| 170 | + .load(merchant.getImgPreview()) | ||
| 171 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
| 172 | + .into(holder.ivCouponLogo); | ||
| 173 | + } | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | ||
| 177 | + Date newDate = new Date(); | ||
| 178 | + try { | ||
| 179 | + newDate = simpleDateFormat.parse(couponItem.getChangesDates().optString("redeemed")); | ||
| 180 | + simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); | ||
| 181 | + holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : "")); | ||
| 182 | + } catch (ParseException e) { | ||
| 183 | + e.printStackTrace(); | ||
| 184 | + holder.tvCouponDate.setVisibility(View.GONE); | ||
| 185 | + } | ||
| 186 | + | ||
| 127 | String itemValue = String.format("%.02f", couponItem.getFinal_price()); | 187 | String itemValue = String.format("%.02f", couponItem.getFinal_price()); |
| 128 | holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro)); | 188 | holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro)); |
| 129 | holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); | 189 | holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); | ... | ... |
5.84 KB
1.66 KB
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | - <solid android:color="#F0E6E6"/> | 3 | + <solid android:color="@color/cos_skyblue4"/> |
| 4 | <corners android:radius="10dp"/> | 4 | <corners android:radius="10dp"/> |
| 5 | <padding android:left="4dp" android:top="2dp" android:right="4dp" android:bottom="2dp" /> | 5 | <padding android:left="4dp" android:top="2dp" android:right="4dp" android:bottom="2dp" /> |
| 6 | </shape> | 6 | </shape> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -30,9 +30,9 @@ | ... | @@ -30,9 +30,9 @@ |
| 30 | android:id="@+id/v_separator" | 30 | android:id="@+id/v_separator" |
| 31 | android:layout_width="1dp" | 31 | android:layout_width="1dp" |
| 32 | android:layout_height="0dp" | 32 | android:layout_height="0dp" |
| 33 | - android:layerType="software" | ||
| 34 | android:layout_marginVertical="16dp" | 33 | android:layout_marginVertical="16dp" |
| 35 | android:layout_marginStart="16dp" | 34 | android:layout_marginStart="16dp" |
| 35 | + android:layerType="software" | ||
| 36 | app:layout_constraintBottom_toBottomOf="parent" | 36 | app:layout_constraintBottom_toBottomOf="parent" |
| 37 | app:layout_constraintStart_toEndOf="@+id/iv_active_coupon" | 37 | app:layout_constraintStart_toEndOf="@+id/iv_active_coupon" |
| 38 | app:layout_constraintTop_toTopOf="parent" | 38 | app:layout_constraintTop_toTopOf="parent" |
| ... | @@ -42,7 +42,6 @@ | ... | @@ -42,7 +42,6 @@ |
| 42 | custom:dashThickness="1dp" | 42 | custom:dashThickness="1dp" |
| 43 | custom:orientation="vertical" /> | 43 | custom:orientation="vertical" /> |
| 44 | 44 | ||
| 45 | -<!-- app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"--> | ||
| 46 | <LinearLayout | 45 | <LinearLayout |
| 47 | android:id="@+id/ll_coupon_info" | 46 | android:id="@+id/ll_coupon_info" |
| 48 | android:layout_width="0dp" | 47 | android:layout_width="0dp" |
| ... | @@ -65,6 +64,17 @@ | ... | @@ -65,6 +64,17 @@ |
| 65 | android:textSize="16sp" | 64 | android:textSize="16sp" |
| 66 | tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" /> | 65 | tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" /> |
| 67 | 66 | ||
| 67 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
| 68 | + android:layout_width="match_parent" | ||
| 69 | + android:layout_height="wrap_content"> | ||
| 70 | + | ||
| 71 | + <androidx.constraintlayout.widget.Guideline | ||
| 72 | + android:id="@+id/gl_vertical_62_percent_inner" | ||
| 73 | + android:layout_width="wrap_content" | ||
| 74 | + android:layout_height="wrap_content" | ||
| 75 | + android:orientation="vertical" | ||
| 76 | + app:layout_constraintGuide_percent="0.62" /> | ||
| 77 | + | ||
| 68 | <TextView | 78 | <TextView |
| 69 | android:id="@+id/tv_active_coupons_value" | 79 | android:id="@+id/tv_active_coupons_value" |
| 70 | fontPath="fonts/BTCosmo-Bold.ttf" | 80 | fontPath="fonts/BTCosmo-Bold.ttf" |
| ... | @@ -72,31 +82,33 @@ | ... | @@ -72,31 +82,33 @@ |
| 72 | android:layout_height="wrap_content" | 82 | android:layout_height="wrap_content" |
| 73 | android:textColor="@color/cos_light_black" | 83 | android:textColor="@color/cos_light_black" |
| 74 | android:textSize="42sp" | 84 | android:textSize="42sp" |
| 85 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 86 | + app:layout_constraintStart_toStartOf="parent" | ||
| 87 | + app:layout_constraintTop_toTopOf="parent" | ||
| 75 | tools:text="10$" /> | 88 | tools:text="10$" /> |
| 76 | 89 | ||
| 77 | <TextView | 90 | <TextView |
| 78 | - android:id="@+id/tv_active_coupons_date" | ||
| 79 | - fontPath="fonts/PeridotPE-Regular.ttf" | ||
| 80 | - android:layout_width="wrap_content" | ||
| 81 | - android:layout_height="wrap_content" | ||
| 82 | - android:textColor="@color/cos_gray" | ||
| 83 | - android:textSize="12sp" | ||
| 84 | - tools:text="@string/cos_active_coupon_date" /> | ||
| 85 | - </LinearLayout> | ||
| 86 | - | ||
| 87 | - <TextView | ||
| 88 | android:id="@+id/tv_active_coupons_description" | 91 | android:id="@+id/tv_active_coupons_description" |
| 89 | fontPath="fonts/PeridotPE-Regular.ttf" | 92 | fontPath="fonts/PeridotPE-Regular.ttf" |
| 90 | android:layout_width="0dp" | 93 | android:layout_width="0dp" |
| 91 | android:layout_height="wrap_content" | 94 | android:layout_height="wrap_content" |
| 92 | - android:layout_marginStart="8dp" | ||
| 93 | - android:layout_marginEnd="32dp" | ||
| 94 | android:maxLines="3" | 95 | android:maxLines="3" |
| 95 | - android:textColor="@color/cos_gray" | 96 | + android:textColor="@color/cos_light_black" |
| 96 | android:textSize="12sp" | 97 | android:textSize="12sp" |
| 97 | app:layout_constraintBottom_toBottomOf="parent" | 98 | app:layout_constraintBottom_toBottomOf="parent" |
| 98 | app:layout_constraintEnd_toEndOf="parent" | 99 | app:layout_constraintEnd_toEndOf="parent" |
| 99 | - app:layout_constraintStart_toEndOf="@+id/gl_vertical_72_percent" | 100 | + app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner" |
| 100 | app:layout_constraintTop_toTopOf="parent" | 101 | app:layout_constraintTop_toTopOf="parent" |
| 101 | tools:text="Εκπτωση με ελάχιστες αγορές 100€" /> | 102 | tools:text="Εκπτωση με ελάχιστες αγορές 100€" /> |
| 103 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
| 104 | + | ||
| 105 | + <TextView | ||
| 106 | + android:id="@+id/tv_active_coupons_date" | ||
| 107 | + fontPath="fonts/PeridotPE-Regular.ttf" | ||
| 108 | + android:layout_width="wrap_content" | ||
| 109 | + android:layout_height="wrap_content" | ||
| 110 | + android:textColor="@color/cos_light_black" | ||
| 111 | + android:textSize="12sp" | ||
| 112 | + tools:text="@string/cos_active_coupon_date" /> | ||
| 113 | + </LinearLayout> | ||
| 102 | </androidx.constraintlayout.widget.ConstraintLayout> | 114 | </androidx.constraintlayout.widget.ConstraintLayout> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -115,6 +115,7 @@ | ... | @@ -115,6 +115,7 @@ |
| 115 | android:layout_height="50dp" | 115 | android:layout_height="50dp" |
| 116 | android:layout_marginHorizontal="32dp" | 116 | android:layout_marginHorizontal="32dp" |
| 117 | android:layout_marginTop="12dp" | 117 | android:layout_marginTop="12dp" |
| 118 | + android:includeFontPadding="false" | ||
| 118 | android:background="@drawable/banner_border_light_grey" | 119 | android:background="@drawable/banner_border_light_grey" |
| 119 | android:gravity="center" | 120 | android:gravity="center" |
| 120 | android:textColor="@color/cos_light_black" | 121 | android:textColor="@color/cos_light_black" |
| ... | @@ -142,7 +143,8 @@ | ... | @@ -142,7 +143,8 @@ |
| 142 | 143 | ||
| 143 | <View | 144 | <View |
| 144 | android:id="@+id/view5" | 145 | android:id="@+id/view5" |
| 145 | - android:layout_width="320dp" | 146 | + android:layout_width="match_parent" |
| 147 | + android:layout_marginHorizontal="32dp" | ||
| 146 | android:layout_height="0.8dp" | 148 | android:layout_height="0.8dp" |
| 147 | android:background="#E6E6E6" /> | 149 | android:background="#E6E6E6" /> |
| 148 | 150 | ||
| ... | @@ -166,7 +168,8 @@ | ... | @@ -166,7 +168,8 @@ |
| 166 | 168 | ||
| 167 | <View | 169 | <View |
| 168 | android:id="@+id/view4" | 170 | android:id="@+id/view4" |
| 169 | - android:layout_width="320dp" | 171 | + android:layout_width="match_parent" |
| 172 | + android:layout_marginHorizontal="32dp" | ||
| 170 | android:layout_height="0.8dp" | 173 | android:layout_height="0.8dp" |
| 171 | android:layout_marginTop="20dp" | 174 | android:layout_marginTop="20dp" |
| 172 | android:background="#E6E6E6" /> | 175 | android:background="#E6E6E6" /> |
| ... | @@ -308,7 +311,7 @@ | ... | @@ -308,7 +311,7 @@ |
| 308 | android:layout_height="wrap_content" | 311 | android:layout_height="wrap_content" |
| 309 | android:text="@string/cos_coupon_terms_title" | 312 | android:text="@string/cos_coupon_terms_title" |
| 310 | android:textColor="@color/cos_light_black" | 313 | android:textColor="@color/cos_light_black" |
| 311 | - android:textSize="16sp" /> | 314 | + android:textSize="15sp" /> |
| 312 | 315 | ||
| 313 | <ImageView | 316 | <ImageView |
| 314 | android:id="@+id/iv_terms_arrow" | 317 | android:id="@+id/iv_terms_arrow" | ... | ... |
| ... | @@ -125,7 +125,7 @@ | ... | @@ -125,7 +125,7 @@ |
| 125 | android:layout_height="wrap_content" | 125 | android:layout_height="wrap_content" |
| 126 | android:text="@string/cos_coupon_terms_title" | 126 | android:text="@string/cos_coupon_terms_title" |
| 127 | android:textColor="@color/cos_light_black" | 127 | android:textColor="@color/cos_light_black" |
| 128 | - android:textSize="16sp" /> | 128 | + android:textSize="15sp" /> |
| 129 | 129 | ||
| 130 | <ImageView | 130 | <ImageView |
| 131 | android:id="@+id/iv_terms_arrow" | 131 | android:id="@+id/iv_terms_arrow" | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -102,6 +102,7 @@ | ... | @@ -102,6 +102,7 @@ |
| 102 | android:layout_height="50dp" | 102 | android:layout_height="50dp" |
| 103 | android:layout_marginHorizontal="32dp" | 103 | android:layout_marginHorizontal="32dp" |
| 104 | android:layout_marginTop="12dp" | 104 | android:layout_marginTop="12dp" |
| 105 | + android:includeFontPadding="false" | ||
| 105 | android:background="@drawable/banner_border_light_grey" | 106 | android:background="@drawable/banner_border_light_grey" |
| 106 | android:gravity="center" | 107 | android:gravity="center" |
| 107 | android:textColor="@color/cos_light_black" | 108 | android:textColor="@color/cos_light_black" |
| ... | @@ -127,7 +128,8 @@ | ... | @@ -127,7 +128,8 @@ |
| 127 | 128 | ||
| 128 | <View | 129 | <View |
| 129 | android:id="@+id/view5" | 130 | android:id="@+id/view5" |
| 130 | - android:layout_width="320dp" | 131 | + android:layout_width="match_parent" |
| 132 | + android:layout_marginHorizontal="32dp" | ||
| 131 | android:layout_height="0.8dp" | 133 | android:layout_height="0.8dp" |
| 132 | android:background="#E6E6E6" /> | 134 | android:background="#E6E6E6" /> |
| 133 | 135 | ||
| ... | @@ -152,7 +154,8 @@ | ... | @@ -152,7 +154,8 @@ |
| 152 | 154 | ||
| 153 | <View | 155 | <View |
| 154 | android:id="@+id/view4" | 156 | android:id="@+id/view4" |
| 155 | - android:layout_width="320dp" | 157 | + android:layout_width="match_parent" |
| 158 | + android:layout_marginHorizontal="32dp" | ||
| 156 | android:layout_height="0.8dp" | 159 | android:layout_height="0.8dp" |
| 157 | android:layout_marginTop="20dp" | 160 | android:layout_marginTop="20dp" |
| 158 | android:background="#E6E6E6" /> | 161 | android:background="#E6E6E6" /> |
| ... | @@ -175,7 +178,7 @@ | ... | @@ -175,7 +178,7 @@ |
| 175 | android:layout_width="wrap_content" | 178 | android:layout_width="wrap_content" |
| 176 | android:layout_height="wrap_content" | 179 | android:layout_height="wrap_content" |
| 177 | android:layout_gravity="center_horizontal" | 180 | android:layout_gravity="center_horizontal" |
| 178 | - android:layout_marginTop="48dp" | 181 | + android:layout_marginTop="24dp" |
| 179 | android:gravity="center" | 182 | android:gravity="center" |
| 180 | android:orientation="horizontal"> | 183 | android:orientation="horizontal"> |
| 181 | 184 | ||
| ... | @@ -201,7 +204,7 @@ | ... | @@ -201,7 +204,7 @@ |
| 201 | android:id="@+id/ll_market_coupons" | 204 | android:id="@+id/ll_market_coupons" |
| 202 | android:layout_width="match_parent" | 205 | android:layout_width="match_parent" |
| 203 | android:layout_height="wrap_content" | 206 | android:layout_height="wrap_content" |
| 204 | - android:layout_marginTop="16dp" | 207 | + android:layout_marginTop="12dp" |
| 205 | android:background="@color/cos_light_grey3" | 208 | android:background="@color/cos_light_grey3" |
| 206 | android:orientation="vertical"> | 209 | android:orientation="vertical"> |
| 207 | 210 | ||
| ... | @@ -209,6 +212,7 @@ | ... | @@ -209,6 +212,7 @@ |
| 209 | android:id="@+id/rv_active_market_coupons" | 212 | android:id="@+id/rv_active_market_coupons" |
| 210 | android:layout_width="match_parent" | 213 | android:layout_width="match_parent" |
| 211 | android:layout_height="wrap_content" | 214 | android:layout_height="wrap_content" |
| 215 | + android:paddingVertical="8dp" | ||
| 212 | android:layout_marginHorizontal="2dp" | 216 | android:layout_marginHorizontal="2dp" |
| 213 | android:overScrollMode="never" /> | 217 | android:overScrollMode="never" /> |
| 214 | </LinearLayout> | 218 | </LinearLayout> |
| ... | @@ -219,7 +223,7 @@ | ... | @@ -219,7 +223,7 @@ |
| 219 | android:layout_height="55dp" | 223 | android:layout_height="55dp" |
| 220 | android:layout_gravity="center" | 224 | android:layout_gravity="center" |
| 221 | android:layout_marginHorizontal="32dp" | 225 | android:layout_marginHorizontal="32dp" |
| 222 | - android:layout_marginTop="24dp" | 226 | + android:layout_marginTop="20dp" |
| 223 | android:background="@drawable/selector_button_green" | 227 | android:background="@drawable/selector_button_green" |
| 224 | android:gravity="center" | 228 | android:gravity="center" |
| 225 | android:orientation="horizontal" | 229 | android:orientation="horizontal" |
| ... | @@ -241,7 +245,7 @@ | ... | @@ -241,7 +245,7 @@ |
| 241 | android:layout_width="wrap_content" | 245 | android:layout_width="wrap_content" |
| 242 | android:layout_height="wrap_content" | 246 | android:layout_height="wrap_content" |
| 243 | android:layout_gravity="center" | 247 | android:layout_gravity="center" |
| 244 | - android:layout_marginTop="24dp" | 248 | + android:layout_marginTop="20dp" |
| 245 | android:gravity="center"> | 249 | android:gravity="center"> |
| 246 | 250 | ||
| 247 | <LinearLayout | 251 | <LinearLayout |
| ... | @@ -259,7 +263,7 @@ | ... | @@ -259,7 +263,7 @@ |
| 259 | android:layout_height="wrap_content" | 263 | android:layout_height="wrap_content" |
| 260 | android:text="@string/cos_coupon_terms_title" | 264 | android:text="@string/cos_coupon_terms_title" |
| 261 | android:textColor="@color/cos_light_black" | 265 | android:textColor="@color/cos_light_black" |
| 262 | - android:textSize="16sp" /> | 266 | + android:textSize="15sp" /> |
| 263 | 267 | ||
| 264 | <ImageView | 268 | <ImageView |
| 265 | android:id="@+id/iv_terms_arrow" | 269 | android:id="@+id/iv_terms_arrow" | ... | ... |
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | + xmlns:custom="http://schemas.android.com/apk/res-auto" | ||
| 4 | xmlns:tools="http://schemas.android.com/tools" | 5 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | android:id="@+id/cl_custom_layout" | 6 | android:id="@+id/cl_custom_layout" |
| 6 | android:layout_width="match_parent" | 7 | android:layout_width="match_parent" |
| 7 | android:layout_height="150dp" | 8 | android:layout_height="150dp" |
| 8 | android:layout_marginHorizontal="4dp" | 9 | android:layout_marginHorizontal="4dp" |
| 9 | android:layout_marginVertical="4dp" | 10 | android:layout_marginVertical="4dp" |
| 10 | - android:background="@drawable/ic_coupon_background"> | 11 | + android:background="@drawable/ic_coupon_background_new2"> |
| 11 | - | ||
| 12 | - <androidx.constraintlayout.widget.Guideline | ||
| 13 | - android:id="@+id/gl_vertical_72_percent" | ||
| 14 | - android:layout_width="wrap_content" | ||
| 15 | - android:layout_height="wrap_content" | ||
| 16 | - android:orientation="vertical" | ||
| 17 | - app:layout_constraintGuide_percent="0.72" /> | ||
| 18 | 12 | ||
| 19 | <ImageView | 13 | <ImageView |
| 20 | android:id="@+id/iv_active_coupon" | 14 | android:id="@+id/iv_active_coupon" |
| ... | @@ -26,68 +20,101 @@ | ... | @@ -26,68 +20,101 @@ |
| 26 | app:layout_constraintTop_toTopOf="parent" | 20 | app:layout_constraintTop_toTopOf="parent" |
| 27 | tools:src="@drawable/ic_gifts_for_you" /> | 21 | tools:src="@drawable/ic_gifts_for_you" /> |
| 28 | 22 | ||
| 29 | - <View | 23 | + <ly.warp.sdk.views.DividerView |
| 30 | android:id="@+id/v_separator" | 24 | android:id="@+id/v_separator" |
| 31 | android:layout_width="1dp" | 25 | android:layout_width="1dp" |
| 32 | - android:layout_height="match_parent" | 26 | + android:layout_height="0dp" |
| 33 | android:layout_marginVertical="16dp" | 27 | android:layout_marginVertical="16dp" |
| 34 | - android:layout_marginStart="8dp" | 28 | + android:layout_marginStart="16dp" |
| 35 | - android:background="@drawable/shape_dashed_vertical" | 29 | + android:layerType="software" |
| 36 | app:layout_constraintBottom_toBottomOf="parent" | 30 | app:layout_constraintBottom_toBottomOf="parent" |
| 37 | app:layout_constraintStart_toEndOf="@+id/iv_active_coupon" | 31 | app:layout_constraintStart_toEndOf="@+id/iv_active_coupon" |
| 38 | - app:layout_constraintTop_toTopOf="parent" /> | 32 | + app:layout_constraintTop_toTopOf="parent" |
| 33 | + custom:color="@color/cos_gray" | ||
| 34 | + custom:dashGap="10dp" | ||
| 35 | + custom:dashLength="10dp" | ||
| 36 | + custom:dashThickness="1dp" | ||
| 37 | + custom:orientation="vertical" /> | ||
| 39 | 38 | ||
| 40 | <LinearLayout | 39 | <LinearLayout |
| 41 | android:id="@+id/ll_coupon_info" | 40 | android:id="@+id/ll_coupon_info" |
| 42 | android:layout_width="0dp" | 41 | android:layout_width="0dp" |
| 43 | android:layout_height="wrap_content" | 42 | android:layout_height="wrap_content" |
| 44 | - android:layout_marginStart="16dp" | 43 | + android:layout_marginHorizontal="16dp" |
| 45 | android:orientation="vertical" | 44 | android:orientation="vertical" |
| 46 | app:layout_constraintBottom_toBottomOf="parent" | 45 | app:layout_constraintBottom_toBottomOf="parent" |
| 47 | - app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent" | 46 | + app:layout_constraintEnd_toEndOf="parent" |
| 48 | app:layout_constraintStart_toEndOf="@+id/v_separator" | 47 | app:layout_constraintStart_toEndOf="@+id/v_separator" |
| 49 | app:layout_constraintTop_toTopOf="parent"> | 48 | app:layout_constraintTop_toTopOf="parent"> |
| 50 | 49 | ||
| 51 | <TextView | 50 | <TextView |
| 52 | android:id="@+id/tv_active_coupons_title" | 51 | android:id="@+id/tv_active_coupons_title" |
| 53 | - fontPath="fonts/pf_square_sans_pro_medium.ttf" | 52 | + fontPath="fonts/BTCosmo-Bold.ttf" |
| 54 | android:layout_width="wrap_content" | 53 | android:layout_width="wrap_content" |
| 55 | android:layout_height="wrap_content" | 54 | android:layout_height="wrap_content" |
| 56 | android:ellipsize="end" | 55 | android:ellipsize="end" |
| 57 | android:maxLines="1" | 56 | android:maxLines="1" |
| 58 | - android:textColor="#3A5266" | 57 | + android:textColor="@color/cos_light_black" |
| 59 | android:textSize="16sp" | 58 | android:textSize="16sp" |
| 60 | tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" /> | 59 | tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" /> |
| 61 | 60 | ||
| 61 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
| 62 | + android:layout_width="match_parent" | ||
| 63 | + android:layout_height="wrap_content"> | ||
| 64 | + | ||
| 65 | + <androidx.constraintlayout.widget.Guideline | ||
| 66 | + android:id="@+id/gl_vertical_62_percent_inner" | ||
| 67 | + android:layout_width="wrap_content" | ||
| 68 | + android:layout_height="wrap_content" | ||
| 69 | + android:orientation="vertical" | ||
| 70 | + app:layout_constraintGuide_percent="0.62" /> | ||
| 71 | + | ||
| 62 | <TextView | 72 | <TextView |
| 63 | android:id="@+id/tv_active_coupons_value" | 73 | android:id="@+id/tv_active_coupons_value" |
| 64 | - fontPath="fonts/pf_square_sans_pro_bold.ttf" | 74 | + fontPath="fonts/BTCosmo-Bold.ttf" |
| 65 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
| 66 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
| 67 | - android:textColor="#3A5266" | 77 | + android:textColor="@color/cos_light_black" |
| 68 | android:textSize="42sp" | 78 | android:textSize="42sp" |
| 79 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 80 | + app:layout_constraintStart_toStartOf="parent" | ||
| 81 | + app:layout_constraintTop_toTopOf="parent" | ||
| 69 | tools:text="10$" /> | 82 | tools:text="10$" /> |
| 70 | 83 | ||
| 71 | <TextView | 84 | <TextView |
| 85 | + android:id="@+id/tv_active_coupons_description" | ||
| 86 | + fontPath="fonts/PeridotPE-Regular.ttf" | ||
| 87 | + android:layout_width="0dp" | ||
| 88 | + android:layout_height="wrap_content" | ||
| 89 | + android:maxLines="3" | ||
| 90 | + android:textColor="@color/cos_light_black" | ||
| 91 | + android:textSize="12sp" | ||
| 92 | + app:layout_constraintBottom_toBottomOf="parent" | ||
| 93 | + app:layout_constraintEnd_toEndOf="parent" | ||
| 94 | + app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner" | ||
| 95 | + app:layout_constraintTop_toTopOf="parent" | ||
| 96 | + tools:text="Εκπτωση με ελάχιστες αγορές 100€" /> | ||
| 97 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
| 98 | + | ||
| 99 | + <TextView | ||
| 72 | android:id="@+id/tv_active_coupons_date" | 100 | android:id="@+id/tv_active_coupons_date" |
| 73 | - fontPath="fonts/pf_square_sans_pro_medium.ttf" | 101 | + fontPath="fonts/PeridotPE-Regular.ttf" |
| 74 | android:layout_width="wrap_content" | 102 | android:layout_width="wrap_content" |
| 75 | android:layout_height="wrap_content" | 103 | android:layout_height="wrap_content" |
| 76 | - android:textColor="#617181" | 104 | + android:textColor="@color/cos_light_black" |
| 77 | android:textSize="12sp" | 105 | android:textSize="12sp" |
| 78 | android:visibility="gone" | 106 | android:visibility="gone" |
| 79 | tools:text="@string/cos_active_coupon_date" /> | 107 | tools:text="@string/cos_active_coupon_date" /> |
| 80 | 108 | ||
| 81 | <TextView | 109 | <TextView |
| 82 | android:id="@+id/tv_active_coupons_date_expired" | 110 | android:id="@+id/tv_active_coupons_date_expired" |
| 83 | - fontPath="fonts/pf_square_sans_pro_bold.ttf" | 111 | + fontPath="fonts/PeridotPE-SemiBold.ttf" |
| 84 | android:layout_width="wrap_content" | 112 | android:layout_width="wrap_content" |
| 85 | android:layout_height="wrap_content" | 113 | android:layout_height="wrap_content" |
| 86 | - android:textColor="#617181" | 114 | + android:textColor="@color/cos_light_black" |
| 87 | android:textSize="12sp" | 115 | android:textSize="12sp" |
| 88 | android:visibility="gone" | 116 | android:visibility="gone" |
| 89 | tools:text="@string/cos_market_coupon_expired" /> | 117 | tools:text="@string/cos_market_coupon_expired" /> |
| 90 | - </LinearLayout> | ||
| 91 | 118 | ||
| 92 | <LinearLayout | 119 | <LinearLayout |
| 93 | android:id="@+id/ll_date_limit" | 120 | android:id="@+id/ll_date_limit" |
| ... | @@ -97,51 +124,36 @@ | ... | @@ -97,51 +124,36 @@ |
| 97 | android:gravity="center_vertical" | 124 | android:gravity="center_vertical" |
| 98 | android:orientation="horizontal" | 125 | android:orientation="horizontal" |
| 99 | android:visibility="gone" | 126 | android:visibility="gone" |
| 100 | - android:layout_marginBottom="36dp" | ||
| 101 | - android:layout_marginStart="8dp" | ||
| 102 | app:layout_constraintBottom_toBottomOf="parent" | 127 | app:layout_constraintBottom_toBottomOf="parent" |
| 103 | - app:layout_constraintTop_toBottomOf="@+id/ll_coupon_info" | ||
| 104 | app:layout_constraintStart_toEndOf="@+id/v_separator" | 128 | app:layout_constraintStart_toEndOf="@+id/v_separator" |
| 129 | + app:layout_constraintTop_toBottomOf="@+id/ll_coupon_info" | ||
| 105 | tools:visibility="visible"> | 130 | tools:visibility="visible"> |
| 106 | 131 | ||
| 107 | -<!-- <ImageView--> | 132 | + <ImageView |
| 108 | -<!-- android:layout_width="14dp"--> | 133 | + android:layout_width="14dp" |
| 109 | -<!-- android:layout_height="14dp"--> | 134 | + android:layout_height="14dp" |
| 110 | -<!-- android:layout_marginEnd="4dp"--> | 135 | + android:layout_marginEnd="4dp" |
| 111 | -<!-- android:src="@drawable/timer_red" />--> | 136 | + android:src="@drawable/timer_blue" /> |
| 112 | 137 | ||
| 113 | <TextView | 138 | <TextView |
| 114 | - fontPath="fonts/pf_square_sans_pro_medium.ttf" | 139 | + fontPath="fonts/PeridotPE-SemiBold.ttf" |
| 115 | android:layout_width="wrap_content" | 140 | android:layout_width="wrap_content" |
| 116 | android:layout_height="wrap_content" | 141 | android:layout_height="wrap_content" |
| 117 | android:text="@string/cos_coupon_date_limit" | 142 | android:text="@string/cos_coupon_date_limit" |
| 118 | - android:textColor="#617181" | 143 | + android:includeFontPadding="false" |
| 144 | + android:textColor="@color/cos_light_black" | ||
| 119 | android:textSize="12sp" /> | 145 | android:textSize="12sp" /> |
| 120 | 146 | ||
| 121 | <TextView | 147 | <TextView |
| 122 | android:id="@+id/tv_active_coupons_date_limit" | 148 | android:id="@+id/tv_active_coupons_date_limit" |
| 123 | - fontPath="fonts/pf_square_sans_pro_medium.ttf" | 149 | + fontPath="fonts/PeridotPE-SemiBold.ttf" |
| 124 | android:layout_width="wrap_content" | 150 | android:layout_width="wrap_content" |
| 125 | android:layout_height="wrap_content" | 151 | android:layout_height="wrap_content" |
| 126 | android:text="@string/cos_coupon_date_limit" | 152 | android:text="@string/cos_coupon_date_limit" |
| 127 | - android:textColor="#FF6B6B" | 153 | + android:includeFontPadding="false" |
| 154 | + android:textColor="@color/cos_blue6" | ||
| 128 | android:textSize="12sp" | 155 | android:textSize="12sp" |
| 129 | tools:text="@string/cos_coupon_date_limit2" /> | 156 | tools:text="@string/cos_coupon_date_limit2" /> |
| 130 | </LinearLayout> | 157 | </LinearLayout> |
| 131 | - | 158 | + </LinearLayout> |
| 132 | - <TextView | ||
| 133 | - android:id="@+id/tv_active_coupons_description" | ||
| 134 | - fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
| 135 | - android:layout_width="0dp" | ||
| 136 | - android:layout_height="wrap_content" | ||
| 137 | - android:layout_marginStart="8dp" | ||
| 138 | - android:layout_marginEnd="32dp" | ||
| 139 | - android:maxLines="4" | ||
| 140 | - android:textColor="#617181" | ||
| 141 | - android:textSize="12sp" | ||
| 142 | - app:layout_constraintBottom_toBottomOf="parent" | ||
| 143 | - app:layout_constraintEnd_toEndOf="parent" | ||
| 144 | - app:layout_constraintStart_toEndOf="@+id/gl_vertical_72_percent" | ||
| 145 | - app:layout_constraintTop_toTopOf="parent" | ||
| 146 | - tools:text="Εκπτωση με ελάχιστες αγορές 100€" /> | ||
| 147 | </androidx.constraintlayout.widget.ConstraintLayout> | 159 | </androidx.constraintlayout.widget.ConstraintLayout> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
| 4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 6 | android:layout_height="150dp" | 6 | android:layout_height="150dp" |
| 7 | - android:layout_marginBottom="24dp"> | 7 | + android:layout_marginBottom="12dp"> |
| 8 | 8 | ||
| 9 | <androidx.cardview.widget.CardView | 9 | <androidx.cardview.widget.CardView |
| 10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| ... | @@ -43,7 +43,7 @@ | ... | @@ -43,7 +43,7 @@ |
| 43 | android:layout_marginHorizontal="12dp" | 43 | android:layout_marginHorizontal="12dp" |
| 44 | android:gravity="center" | 44 | android:gravity="center" |
| 45 | android:maxLines="4" | 45 | android:maxLines="4" |
| 46 | - android:textColor="@color/grey" | 46 | + android:textColor="@color/cos_light_black" |
| 47 | fontPath="fonts/PeridotPE-Regular.ttf" | 47 | fontPath="fonts/PeridotPE-Regular.ttf" |
| 48 | app:layout_constraintBottom_toBottomOf="parent" | 48 | app:layout_constraintBottom_toBottomOf="parent" |
| 49 | app:layout_constraintLeft_toRightOf="@+id/gl_vertical_60_percent" | 49 | app:layout_constraintLeft_toRightOf="@+id/gl_vertical_60_percent" | ... | ... |
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | + xmlns:custom="http://schemas.android.com/apk/res-auto" | ||
| 4 | xmlns:tools="http://schemas.android.com/tools" | 5 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
| 6 | android:layout_height="150dp" | 7 | android:layout_height="150dp" |
| ... | @@ -26,25 +27,30 @@ | ... | @@ -26,25 +27,30 @@ |
| 26 | app:layout_constraintStart_toStartOf="parent" | 27 | app:layout_constraintStart_toStartOf="parent" |
| 27 | app:layout_constraintTop_toTopOf="parent" /> | 28 | app:layout_constraintTop_toTopOf="parent" /> |
| 28 | 29 | ||
| 29 | - <View | 30 | + <ly.warp.sdk.views.DividerView |
| 30 | android:id="@+id/v_separator" | 31 | android:id="@+id/v_separator" |
| 31 | android:layout_width="1dp" | 32 | android:layout_width="1dp" |
| 32 | android:layout_height="match_parent" | 33 | android:layout_height="match_parent" |
| 33 | android:layout_marginVertical="16dp" | 34 | android:layout_marginVertical="16dp" |
| 34 | - android:layout_marginStart="8dp" | 35 | + android:layout_marginStart="16dp" |
| 35 | - android:background="@drawable/shape_dashed_vertical" | 36 | + android:layerType="software" |
| 36 | app:layout_constraintBottom_toBottomOf="parent" | 37 | app:layout_constraintBottom_toBottomOf="parent" |
| 37 | app:layout_constraintStart_toEndOf="@+id/iv_market_coupon" | 38 | app:layout_constraintStart_toEndOf="@+id/iv_market_coupon" |
| 38 | - app:layout_constraintTop_toTopOf="parent" /> | 39 | + app:layout_constraintTop_toTopOf="parent" |
| 40 | + custom:color="@color/cos_gray" | ||
| 41 | + custom:dashGap="10dp" | ||
| 42 | + custom:dashLength="10dp" | ||
| 43 | + custom:dashThickness="1dp" | ||
| 44 | + custom:orientation="vertical" /> | ||
| 39 | 45 | ||
| 40 | <LinearLayout | 46 | <LinearLayout |
| 41 | android:id="@+id/ll_coupon_info" | 47 | android:id="@+id/ll_coupon_info" |
| 42 | android:layout_width="0dp" | 48 | android:layout_width="0dp" |
| 43 | android:layout_height="wrap_content" | 49 | android:layout_height="wrap_content" |
| 44 | - android:layout_marginStart="16dp" | 50 | + android:layout_marginHorizontal="16dp" |
| 45 | android:orientation="vertical" | 51 | android:orientation="vertical" |
| 46 | app:layout_constraintBottom_toBottomOf="parent" | 52 | app:layout_constraintBottom_toBottomOf="parent" |
| 47 | - app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent" | 53 | + app:layout_constraintEnd_toEndOf="parent" |
| 48 | app:layout_constraintStart_toEndOf="@+id/v_separator" | 54 | app:layout_constraintStart_toEndOf="@+id/v_separator" |
| 49 | app:layout_constraintTop_toTopOf="parent"> | 55 | app:layout_constraintTop_toTopOf="parent"> |
| 50 | 56 | ||
| ... | @@ -55,17 +61,17 @@ | ... | @@ -55,17 +61,17 @@ |
| 55 | android:layout_height="wrap_content" | 61 | android:layout_height="wrap_content" |
| 56 | android:ellipsize="end" | 62 | android:ellipsize="end" |
| 57 | android:maxLines="3" | 63 | android:maxLines="3" |
| 64 | + android:text="@string/cos_market_item_title" | ||
| 58 | android:textColor="@color/cos_light_black" | 65 | android:textColor="@color/cos_light_black" |
| 59 | - android:textSize="16sp" | 66 | + android:textSize="16sp" /> |
| 60 | - android:text="@string/cos_market_item_title" /> | ||
| 61 | 67 | ||
| 62 | <TextView | 68 | <TextView |
| 63 | fontPath="fonts/pf_square_sans_pro_bold.ttf" | 69 | fontPath="fonts/pf_square_sans_pro_bold.ttf" |
| 64 | android:layout_width="wrap_content" | 70 | android:layout_width="wrap_content" |
| 65 | android:layout_height="wrap_content" | 71 | android:layout_height="wrap_content" |
| 72 | + android:text="" | ||
| 66 | android:textColor="#3A5266" | 73 | android:textColor="#3A5266" |
| 67 | - android:textSize="22sp" | 74 | + android:textSize="22sp" /> |
| 68 | - android:text="" /> | ||
| 69 | 75 | ||
| 70 | <TextView | 76 | <TextView |
| 71 | android:id="@+id/tv_market_coupons_date" | 77 | android:id="@+id/tv_market_coupons_date" |
| ... | @@ -83,8 +89,8 @@ | ... | @@ -83,8 +89,8 @@ |
| 83 | android:layout_width="0dp" | 89 | android:layout_width="0dp" |
| 84 | android:layout_height="wrap_content" | 90 | android:layout_height="wrap_content" |
| 85 | android:layout_marginStart="8dp" | 91 | android:layout_marginStart="8dp" |
| 86 | - android:layout_marginEnd="32dp" | 92 | + android:layout_marginEnd="16dp" |
| 87 | - android:maxLines="4" | 93 | + android:maxLines="3" |
| 88 | android:textColor="@color/cos_light_black" | 94 | android:textColor="@color/cos_light_black" |
| 89 | android:textSize="12sp" | 95 | android:textSize="12sp" |
| 90 | app:layout_constraintBottom_toBottomOf="parent" | 96 | app:layout_constraintBottom_toBottomOf="parent" | ... | ... |
| ... | @@ -72,4 +72,6 @@ | ... | @@ -72,4 +72,6 @@ |
| 72 | <color name="cos_gray2">#848484</color> | 72 | <color name="cos_gray2">#848484</color> |
| 73 | <color name="cos_light_blue">#00A5E3</color> | 73 | <color name="cos_light_blue">#00A5E3</color> |
| 74 | <color name="cos_grey_dark2">#32485A</color> | 74 | <color name="cos_grey_dark2">#32485A</color> |
| 75 | + <color name="cos_blue6">#004B87</color> | ||
| 76 | + <color name="cos_skyblue4">#B8E0EF</color> | ||
| 75 | </resources> | 77 | </resources> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment