Panagiotis Triantafyllou

redesign supermarket part3

Showing 23 changed files with 301 additions and 109 deletions
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc51'
PUBLISH_VERSION = '4.5.4.6rc52'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -107,6 +107,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.getSharingHistory(new WarplySharingHistoryRequest()
.setExcludeFilter("supermarket")
, mSharingHistoryCallback);
}
Thread.currentThread().interrupt();
......
......@@ -282,8 +282,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
analyticsEvent.setEventName("did_tap_market_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
// Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class); //TODO: uncomment it
// startActivity(intent);
Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class);
startActivity(intent);
}
return;
}
......@@ -391,7 +391,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
if (mUnifiedCoupons != null && mUnifiedCoupons.size() > 0) {
ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>();
for (UnifiedCoupon unicpn : mUnifiedCoupons) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss", Locale.US);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date newDate = new Date();
try {
newDate = simpleDateFormat.parse(unicpn.getCreated());
......@@ -401,7 +401,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
unicpn.setExpirationDate(newDate);
unilist.add(unicpn);
}
Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist);
mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
mAdapterMarketCoupons.getPositionClicks()
......
......@@ -46,6 +46,7 @@ import ly.warp.sdk.io.models.Merchant;
import ly.warp.sdk.io.models.MerchantList;
import ly.warp.sdk.io.request.WarplyMerchantsRequest;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.WarplyProperty;
import ly.warp.sdk.utils.constants.WarpConstants;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -84,12 +85,14 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
setContentView(R.layout.activity_shops);
mCouponset = (Couponset) getIntent().getSerializableExtra("couponset");
if (mCouponset != null) {
for (Merchant merchant : WarplyManagerHelper.getMerchantList()) {
if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) {
mMerchant = merchant;
break;
}
}
}
mIvBack = findViewById(R.id.iv_shops_back);
mMapView = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops);
......@@ -189,6 +192,18 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
}
Thread.currentThread().interrupt();
}).start();
} else {
ArrayList<String> catuuids = new ArrayList<>();
catuuids.add(WarplyProperty.getAppUuid(this).equals("0086a2088301440792091b9f814c2267") ? "" : "adcace6cab6049c7b7271bc85bc2b26d"); //TODO: add live cat uuid
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.getMerchantsMultilingual(new WarplyMerchantsRequest()
.setIsMultilingual(true)
.setCategories(catuuids)
, mMerchantsCallback);
}
Thread.currentThread().interrupt();
}).start();
}
}
......@@ -287,7 +302,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
private void openWebsite() {
WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite");
if (!TextUtils.isEmpty(mMerchant.getWebsite())) {
if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getWebsite())) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(mMerchant.getWebsite()));
......
......@@ -45,6 +45,7 @@ import ly.warp.sdk.io.models.Merchant;
import ly.warp.sdk.io.models.MerchantList;
import ly.warp.sdk.io.request.WarplyMerchantsRequest;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.WarplyProperty;
import ly.warp.sdk.utils.constants.WarpConstants;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -83,12 +84,14 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
setContentView(R.layout.activity_shops_huawei);
mCouponset = (Couponset) getIntent().getSerializableExtra("couponset");
if (mCouponset != null) {
for (Merchant merchant : WarplyManagerHelper.getMerchantList()) {
if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) {
mMerchant = merchant;
break;
}
}
}
mIvBack = findViewById(R.id.iv_shops_back);
mSupportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops_huawei);
......@@ -190,6 +193,18 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
}
Thread.currentThread().interrupt();
}).start();
} else {
ArrayList<String> catuuids = new ArrayList<>();
catuuids.add(WarplyProperty.getAppUuid(this).equals("0086a2088301440792091b9f814c2267") ? "" : "adcace6cab6049c7b7271bc85bc2b26d"); //TODO: add live cat uuid
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.getMerchantsMultilingual(new WarplyMerchantsRequest()
.setIsMultilingual(true)
.setCategories(catuuids)
, mMerchantsCallback);
}
Thread.currentThread().interrupt();
}).start();
}
}
......@@ -304,7 +319,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
private void openWebsite() {
WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite");
if (!TextUtils.isEmpty(mMerchant.getWebsite())) {
if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getWebsite())) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(mMerchant.getWebsite()));
......
package ly.warp.sdk.io.request;
import android.text.TextUtils;
import android.util.Base64;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
......@@ -24,6 +26,10 @@ public class WarplySharingHistoryRequest {
private final String KEY_ACTION = "action";
private final String KEY_ACTION_VALUE = "sharing_history";
private final String KEY_EXCLUDE = "exclude";
private final String KEY_FIELD = "field";
private final String KEY_VALUE = "value";
private final String KEY_TYPE = "couponset_types";
// ===========================================================
// Fields
......@@ -31,6 +37,8 @@ public class WarplySharingHistoryRequest {
private HashMap<String, String> mFilters;
private long mCacheUpdateInterval = 0;
private String mExcludeFilter = "";
private String mType = "";
// ===========================================================
// Constructor
......@@ -128,6 +136,16 @@ public class WarplySharingHistoryRequest {
return this;
}
public WarplySharingHistoryRequest setExcludeFilter(String excludeFilter) {
mExcludeFilter = excludeFilter;
return this;
}
public WarplySharingHistoryRequest setType(String type) {
mType = type;
return this;
}
/**
* Call this to build the offers Json object
*
......@@ -137,6 +155,19 @@ public class WarplySharingHistoryRequest {
JSONObject bodyJsonObject = new JSONObject();
try {
bodyJsonObject.putOpt(KEY_ACTION, KEY_ACTION_VALUE);
if (!TextUtils.isEmpty(mExcludeFilter)) {
JSONObject excludesKey = new JSONObject();
try {
excludesKey.putOpt(KEY_FIELD, "couponset_type");
excludesKey.putOpt(KEY_VALUE, new JSONArray().put(mExcludeFilter));
} catch (JSONException e) {
e.printStackTrace();
}
bodyJsonObject.put(KEY_EXCLUDE, new JSONArray().put(excludesKey));
}
if (!TextUtils.isEmpty(mType)) {
bodyJsonObject.put(KEY_TYPE, new JSONArray().put(mType));
}
} catch (JSONException e) {
if (WarpConstants.DEBUG)
e.printStackTrace();
......
......@@ -1252,6 +1252,7 @@ public class WarplyManagerHelper {
public static ArrayList<UnifiedCoupon> getMarketCoupons() {
return mMarketCoupons;
}
public static void setMarketCoupons( ArrayList<UnifiedCoupon> marketCoupons) {
mMarketCoupons = marketCoupons;
}
......
......@@ -2286,6 +2286,14 @@ public class WarplyManager {
jsonParams.put("active", true);
jsonParams.put("visible", true);
jsonParams.put("language", WarplyProperty.getLanguage(Warply.getWarplyContext()));
JSONObject excludesKey = new JSONObject();
try {
excludesKey.putOpt("field", "couponset_type");
excludesKey.putOpt("value", new JSONArray().put("supermarket"));
} catch (JSONException e) {
e.printStackTrace();
}
jsonParams.put("exclude", new JSONArray().put(excludesKey));
jsonParamsCouponsets.put("coupon", jsonParams);
RequestBody couponsetsRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsCouponsets)).toString());
......
package ly.warp.sdk.views.adapters;
import android.content.Context;
import android.os.Build;
import android.text.Html;
......@@ -9,16 +10,20 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
......@@ -26,33 +31,39 @@ import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Merchant;
import ly.warp.sdk.utils.WarplyManagerHelper;
public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapter.ActiveCouponViewHolder> {
private Context mContext;
private CouponList mCoupons;
private final PublishSubject<Coupon> onClickSubject = PublishSubject.create();
private boolean mIsPast = false, mIsCustom = false;
public ActiveCouponAdapter(Context mContext, CouponList campaignList) {
this.mContext = mContext;
this.mCoupons = campaignList;
this.mIsPast = false;
}
public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past) {
this.mContext = mContext;
this.mCoupons = campaignList;
this.mIsPast = past;
}
public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past, boolean custom) {
this.mContext = mContext;
this.mCoupons = campaignList;
this.mIsPast = past;
this.mIsCustom = custom;
}
public class ActiveCouponViewHolder extends RecyclerView.ViewHolder {
private ImageView ivCouponLogo, ivCouponBackground;
private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit,
tvCouponDescription, tvCouponDateExpired;
private ConstraintLayout clCustomLayout;
private LinearLayout lLDateLimit;
public ActiveCouponViewHolder(View view) {
super(view);
ivCouponBackground = view.findViewById(R.id.iv_past_coupon_background);
......@@ -67,6 +78,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
lLDateLimit = view.findViewById(R.id.ll_date_limit);
}
}
@Override
public int getItemCount() {
if (mCoupons == null)
......@@ -74,14 +86,17 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
else
return mCoupons.size();
}
public Coupon getItem(int id) {
return mCoupons.get(id);
}
public void updateData(CouponList couponList) {
mCoupons.clear();
mCoupons.addAll(couponList);
notifyDataSetChanged();
}
@Override
public ActiveCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView;
......@@ -93,6 +108,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false);
return new ActiveCouponViewHolder(itemView);
}
@Override
public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) {
Coupon couponItem = mCoupons.get(position);
......@@ -106,13 +122,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
holder.tvCouponTitle.setAlpha(1.0f);
holder.tvCouponValue.setAlpha(1.0f);
holder.tvCouponDescription.setAlpha(1.0f);
holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background);
holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new2);
} else {
holder.ivCouponLogo.setAlpha(0.23f);
holder.tvCouponTitle.setAlpha(0.15f);
holder.tvCouponValue.setAlpha(0.15f);
holder.tvCouponDescription.setAlpha(0.15f);
holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_gray);
holder.ivCouponLogo.setAlpha(0.29f);
holder.tvCouponTitle.setAlpha(0.29f);
holder.tvCouponValue.setAlpha(0.29f);
holder.tvCouponDescription.setAlpha(0.29f);
holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new2);
}
if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) {
for (Merchant mer : WarplyManagerHelper.getMerchantList()) {
......@@ -197,16 +213,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
}
}
if (TextUtils.isEmpty(couponItem.getDiscount_type())) {
holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro));
} else {
if (couponItem.getDiscount_type().equals("value")) {
holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro));
} else if (couponItem.getDiscount_type().equals("percentage")) {
holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.percentage));
} else if (couponItem.getDiscount_type().equals("plus_one")) {
holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.plus_one));
} else {
holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro));
}
}
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
......@@ -295,6 +311,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
}
}
private long getDaysBetweenDates(String start, String end) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date startDate, endDate;
......@@ -308,13 +325,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
}
return numberOfDays;
}
private long getUnitBetweenDates(Date startDate, Date endDate, TimeUnit unit) {
long timeDiff = endDate.getTime() - startDate.getTime();
return unit.convert(timeDiff, TimeUnit.MILLISECONDS);
}
public Observable<Coupon> getPositionClicks() {
return onClickSubject.cache();
}
private long getDifferenceDays(Date d1, Date d2) {
long diff = d2.getTime() - d1.getTime();
return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
......
......@@ -32,6 +32,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
private Context mContext;
private /*CouponList*/ ArrayList<Coupon> mCoupons;
private final PublishSubject<Coupon> onClickSubject = PublishSubject.create();
private boolean mIsCustom = false;
public ExpiredCouponAdapter(Context mContext, CouponList campaignList) {
this.mContext = mContext;
......@@ -43,6 +44,12 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
this.mCoupons = /*(CouponList)*/ campaignList;
}
public ExpiredCouponAdapter(Context mContext, ArrayList<Coupon> campaignList, boolean custom) {
this.mContext = mContext;
this.mCoupons = /*(CouponList)*/ campaignList;
this.mIsCustom = custom;
}
public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder {
private TextView tvCouponTitle, tvCouponValue, tvCouponDate;
private ImageView ivCouponLogo;
......@@ -89,6 +96,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
Merchant merchant = new Merchant();
if (couponItem != null) {
if (mIsCustom) {
if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) {
for (Merchant mer : WarplyManagerHelper.getMerchantList()) {
if (mer.getUuid().equals(couponItem.getMerchantUuid())) {
......@@ -100,6 +108,16 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
if (merchant == null) {
holder.tvCouponTitle.setText(couponItem.getName());
if (!TextUtils.isEmpty(couponItem.getImage())) {
Glide.with(mContext)
// .setDefaultRequestOptions(
// RequestOptions
// .placeholderOf(R.drawable.ic_default_contact_photo)
// .error(R.drawable.ic_default_contact_photo))
.load(couponItem.getImage())
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(holder.ivCouponLogo);
}
} else {
holder.tvCouponTitle.setText(merchant.getAdminName());
if (!TextUtils.isEmpty(merchant.getImgPreview())) {
......@@ -124,6 +142,48 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : ""));
String itemValue = String.format("%.02f", Float.valueOf(couponItem.getDiscount()));
holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro));
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
return;
}
if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) {
for (Merchant mer : WarplyManagerHelper.getMerchantList()) {
if (mer.getUuid().equals(couponItem.getMerchantUuid())) {
merchant = mer;
break;
}
}
}
if (merchant == null) {
holder.tvCouponTitle.setText(couponItem.getName());
} else {
holder.tvCouponTitle.setText(merchant.getAdminName());
if (!TextUtils.isEmpty(merchant.getImgPreview())) {
Glide.with(mContext)
// .setDefaultRequestOptions(
// RequestOptions
// .placeholderOf(R.drawable.ic_default_contact_photo)
// .error(R.drawable.ic_default_contact_photo))
.load(merchant.getImgPreview())
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(holder.ivCouponLogo);
}
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date newDate = new Date();
try {
newDate = simpleDateFormat.parse(couponItem.getChangesDates().optString("redeemed"));
simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : ""));
} catch (ParseException e) {
e.printStackTrace();
holder.tvCouponDate.setVisibility(View.GONE);
}
String itemValue = String.format("%.02f", couponItem.getFinal_price());
holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro));
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#F0E6E6"/>
<solid android:color="@color/cos_skyblue4"/>
<corners android:radius="10dp"/>
<padding android:left="4dp" android:top="2dp" android:right="4dp" android:bottom="2dp" />
</shape>
\ No newline at end of file
......
......@@ -30,9 +30,9 @@
android:id="@+id/v_separator"
android:layout_width="1dp"
android:layout_height="0dp"
android:layerType="software"
android:layout_marginVertical="16dp"
android:layout_marginStart="16dp"
android:layerType="software"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_active_coupon"
app:layout_constraintTop_toTopOf="parent"
......@@ -42,7 +42,6 @@
custom:dashThickness="1dp"
custom:orientation="vertical" />
<!-- app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"-->
<LinearLayout
android:id="@+id/ll_coupon_info"
android:layout_width="0dp"
......@@ -65,6 +64,17 @@
android:textSize="16sp"
tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_62_percent_inner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.62" />
<TextView
android:id="@+id/tv_active_coupons_value"
fontPath="fonts/BTCosmo-Bold.ttf"
......@@ -72,31 +82,33 @@
android:layout_height="wrap_content"
android:textColor="@color/cos_light_black"
android:textSize="42sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="10$" />
<TextView
android:id="@+id/tv_active_coupons_date"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/cos_gray"
android:textSize="12sp"
tools:text="@string/cos_active_coupon_date" />
</LinearLayout>
<TextView
android:id="@+id/tv_active_coupons_description"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="32dp"
android:maxLines="3"
android:textColor="@color/cos_gray"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_72_percent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner"
app:layout_constraintTop_toTopOf="parent"
tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_active_coupons_date"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
tools:text="@string/cos_active_coupon_date" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......
......@@ -115,6 +115,7 @@
android:layout_height="50dp"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="12dp"
android:includeFontPadding="false"
android:background="@drawable/banner_border_light_grey"
android:gravity="center"
android:textColor="@color/cos_light_black"
......@@ -142,7 +143,8 @@
<View
android:id="@+id/view5"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_marginHorizontal="32dp"
android:layout_height="0.8dp"
android:background="#E6E6E6" />
......@@ -166,7 +168,8 @@
<View
android:id="@+id/view4"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_marginHorizontal="32dp"
android:layout_height="0.8dp"
android:layout_marginTop="20dp"
android:background="#E6E6E6" />
......@@ -308,7 +311,7 @@
android:layout_height="wrap_content"
android:text="@string/cos_coupon_terms_title"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
android:textSize="15sp" />
<ImageView
android:id="@+id/iv_terms_arrow"
......
......@@ -125,7 +125,7 @@
android:layout_height="wrap_content"
android:text="@string/cos_coupon_terms_title"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
android:textSize="15sp" />
<ImageView
android:id="@+id/iv_terms_arrow"
......
......@@ -102,6 +102,7 @@
android:layout_height="50dp"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="12dp"
android:includeFontPadding="false"
android:background="@drawable/banner_border_light_grey"
android:gravity="center"
android:textColor="@color/cos_light_black"
......@@ -127,7 +128,8 @@
<View
android:id="@+id/view5"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_marginHorizontal="32dp"
android:layout_height="0.8dp"
android:background="#E6E6E6" />
......@@ -152,7 +154,8 @@
<View
android:id="@+id/view4"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_marginHorizontal="32dp"
android:layout_height="0.8dp"
android:layout_marginTop="20dp"
android:background="#E6E6E6" />
......@@ -175,7 +178,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="48dp"
android:layout_marginTop="24dp"
android:gravity="center"
android:orientation="horizontal">
......@@ -201,7 +204,7 @@
android:id="@+id/ll_market_coupons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="12dp"
android:background="@color/cos_light_grey3"
android:orientation="vertical">
......@@ -209,6 +212,7 @@
android:id="@+id/rv_active_market_coupons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="8dp"
android:layout_marginHorizontal="2dp"
android:overScrollMode="never" />
</LinearLayout>
......@@ -219,7 +223,7 @@
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="24dp"
android:layout_marginTop="20dp"
android:background="@drawable/selector_button_green"
android:gravity="center"
android:orientation="horizontal"
......@@ -241,7 +245,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="24dp"
android:layout_marginTop="20dp"
android:gravity="center">
<LinearLayout
......@@ -259,7 +263,7 @@
android:layout_height="wrap_content"
android:text="@string/cos_coupon_terms_title"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
android:textSize="15sp" />
<ImageView
android:id="@+id/iv_terms_arrow"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cl_custom_layout"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginHorizontal="4dp"
android:layout_marginVertical="4dp"
android:background="@drawable/ic_coupon_background">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_72_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.72" />
android:background="@drawable/ic_coupon_background_new2">
<ImageView
android:id="@+id/iv_active_coupon"
......@@ -26,68 +20,101 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_gifts_for_you" />
<View
<ly.warp.sdk.views.DividerView
android:id="@+id/v_separator"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_height="0dp"
android:layout_marginVertical="16dp"
android:layout_marginStart="8dp"
android:background="@drawable/shape_dashed_vertical"
android:layout_marginStart="16dp"
android:layerType="software"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_active_coupon"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
custom:color="@color/cos_gray"
custom:dashGap="10dp"
custom:dashLength="10dp"
custom:dashThickness="1dp"
custom:orientation="vertical" />
<LinearLayout
android:id="@+id/ll_coupon_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginHorizontal="16dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/v_separator"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_active_coupons_title"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/BTCosmo-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#3A5266"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_62_percent_inner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.62" />
<TextView
android:id="@+id/tv_active_coupons_value"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
fontPath="fonts/BTCosmo-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#3A5266"
android:textColor="@color/cos_light_black"
android:textSize="42sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="10$" />
<TextView
android:id="@+id/tv_active_coupons_description"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="3"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner"
app:layout_constraintTop_toTopOf="parent"
tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_active_coupons_date"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#617181"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
android:visibility="gone"
tools:text="@string/cos_active_coupon_date" />
<TextView
android:id="@+id/tv_active_coupons_date_expired"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#617181"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
android:visibility="gone"
tools:text="@string/cos_market_coupon_expired" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_date_limit"
......@@ -97,51 +124,36 @@
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
android:layout_marginBottom="36dp"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_coupon_info"
app:layout_constraintStart_toEndOf="@+id/v_separator"
app:layout_constraintTop_toBottomOf="@+id/ll_coupon_info"
tools:visibility="visible">
<!-- <ImageView-->
<!-- android:layout_width="14dp"-->
<!-- android:layout_height="14dp"-->
<!-- android:layout_marginEnd="4dp"-->
<!-- android:src="@drawable/timer_red" />-->
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginEnd="4dp"
android:src="@drawable/timer_blue" />
<TextView
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_coupon_date_limit"
android:textColor="#617181"
android:includeFontPadding="false"
android:textColor="@color/cos_light_black"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_active_coupons_date_limit"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_coupon_date_limit"
android:textColor="#FF6B6B"
android:includeFontPadding="false"
android:textColor="@color/cos_blue6"
android:textSize="12sp"
tools:text="@string/cos_coupon_date_limit2" />
</LinearLayout>
<TextView
android:id="@+id/tv_active_coupons_description"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="32dp"
android:maxLines="4"
android:textColor="#617181"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_72_percent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......
......@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginBottom="24dp">
android:layout_marginBottom="12dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
......@@ -43,7 +43,7 @@
android:layout_marginHorizontal="12dp"
android:gravity="center"
android:maxLines="4"
android:textColor="@color/grey"
android:textColor="@color/cos_light_black"
fontPath="fonts/PeridotPE-Regular.ttf"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/gl_vertical_60_percent"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="150dp"
......@@ -26,25 +27,30 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
<ly.warp.sdk.views.DividerView
android:id="@+id/v_separator"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginVertical="16dp"
android:layout_marginStart="8dp"
android:background="@drawable/shape_dashed_vertical"
android:layout_marginStart="16dp"
android:layerType="software"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_market_coupon"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
custom:color="@color/cos_gray"
custom:dashGap="10dp"
custom:dashLength="10dp"
custom:dashThickness="1dp"
custom:orientation="vertical" />
<LinearLayout
android:id="@+id/ll_coupon_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginHorizontal="16dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/v_separator"
app:layout_constraintTop_toTopOf="parent">
......@@ -55,17 +61,17 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="3"
android:text="@string/cos_market_item_title"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
android:text="@string/cos_market_item_title" />
android:textSize="16sp" />
<TextView
fontPath="fonts/pf_square_sans_pro_bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#3A5266"
android:textSize="22sp"
android:text="" />
android:textSize="22sp" />
<TextView
android:id="@+id/tv_market_coupons_date"
......@@ -83,8 +89,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="32dp"
android:maxLines="4"
android:layout_marginEnd="16dp"
android:maxLines="3"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
......
......@@ -72,4 +72,6 @@
<color name="cos_gray2">#848484</color>
<color name="cos_light_blue">#00A5E3</color>
<color name="cos_grey_dark2">#32485A</color>
<color name="cos_blue6">#004B87</color>
<color name="cos_skyblue4">#B8E0EF</color>
</resources>
\ No newline at end of file
......