Panagiotis Triantafyllou

new unified coupons screen with basket part1

...@@ -7,8 +7,10 @@ import android.os.Handler; ...@@ -7,8 +7,10 @@ import android.os.Handler;
7 import android.os.Looper; 7 import android.os.Looper;
8 import android.view.View; 8 import android.view.View;
9 import android.widget.ImageView; 9 import android.widget.ImageView;
10 +import android.widget.RelativeLayout;
10 import android.widget.TextView; 11 import android.widget.TextView;
11 12
13 +import androidx.constraintlayout.widget.ConstraintLayout;
12 import androidx.recyclerview.widget.LinearLayoutManager; 14 import androidx.recyclerview.widget.LinearLayoutManager;
13 import androidx.recyclerview.widget.RecyclerView; 15 import androidx.recyclerview.widget.RecyclerView;
14 16
...@@ -30,6 +32,7 @@ import ly.warp.sdk.utils.WarplyManagerHelper; ...@@ -30,6 +32,7 @@ import ly.warp.sdk.utils.WarplyManagerHelper;
30 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; 32 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
31 import ly.warp.sdk.utils.managers.WarplyEventBusManager; 33 import ly.warp.sdk.utils.managers.WarplyEventBusManager;
32 import ly.warp.sdk.utils.managers.WarplyManager; 34 import ly.warp.sdk.utils.managers.WarplyManager;
35 +import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
33 import ly.warp.sdk.views.adapters.MarketCouponAdapter; 36 import ly.warp.sdk.views.adapters.MarketCouponAdapter;
34 37
35 38
...@@ -43,11 +46,16 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli ...@@ -43,11 +46,16 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
43 // Fields 46 // Fields
44 // =========================================================== 47 // ===========================================================
45 48
46 - private ImageView mIvBack; 49 + private ImageView mIvBack, mIvInfo, mIvInfoClose, mIvChooseAll;
47 - private RecyclerView mRecyclerUnifiedCoupons; 50 + private RecyclerView mRecyclerUnifiedCoupons, mRvActiveUnifiedCoupons;
48 private MarketCouponAdapter mAdapterUnifiedCoupons; 51 private MarketCouponAdapter mAdapterUnifiedCoupons;
49 - private TextView mTvEmptyUnifiedCoupons, mFontHeader; 52 + private TextView mTvEmptyUnifiedCoupons, mFontHeader, mTvInnerTitle,
50 - private boolean mUnifiedPressed = false; 53 + mTvInnerSubtitle, mTvInnerClose, mTvUnifieCouponsTitle, mTvActiveUnifiedCouponsTitle,
54 + mTvChooseAll;
55 + private boolean mUnifiedPressed = false, mActiveUnifiedPressed = false;
56 + private ConstraintLayout mClInfoView, mClActiveCouponsHeader;
57 + private RelativeLayout mRlUnifiedCoupons, mRlActiveUnifiedCoupons;
58 + private ActiveCouponAdapter mAdapterCoupons;
51 59
52 // =========================================================== 60 // ===========================================================
53 // Methods for/from SuperClass/Interfaces 61 // Methods for/from SuperClass/Interfaces
...@@ -62,8 +70,26 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli ...@@ -62,8 +70,26 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
62 mTvEmptyUnifiedCoupons = findViewById(R.id.tv_no_unified_coupons); 70 mTvEmptyUnifiedCoupons = findViewById(R.id.tv_no_unified_coupons);
63 mRecyclerUnifiedCoupons = findViewById(R.id.rv_active_unified_coupons); 71 mRecyclerUnifiedCoupons = findViewById(R.id.rv_active_unified_coupons);
64 mFontHeader = findViewById(R.id.textView3); 72 mFontHeader = findViewById(R.id.textView3);
65 - WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader); 73 + mIvInfo = findViewById(R.id.iv_coupons_info);
66 - WarpUtils.renderCustomFont(this, R.font.peridot_regular, mTvEmptyUnifiedCoupons); 74 + mClInfoView = findViewById(R.id.cl_info_view);
75 + mTvInnerTitle = mClInfoView.findViewById(R.id.tv_inner_title);
76 + mTvInnerSubtitle = mClInfoView.findViewById(R.id.tv_inner_subtitle);
77 + mIvInfoClose = mClInfoView.findViewById(R.id.iv_loyalty_history_close);
78 + mTvInnerClose = mClInfoView.findViewById(R.id.tv_inner_close);
79 + mRlUnifiedCoupons = findViewById(R.id.rl_unified_coupons);
80 + mRecyclerUnifiedCoupons = mRlUnifiedCoupons.findViewById(R.id.rv_active_unified_coupons);
81 + mTvUnifieCouponsTitle = mRlUnifiedCoupons.findViewById(R.id.tv_sm_coupons_title);
82 + mRlActiveUnifiedCoupons = findViewById(R.id.rl_active_unified_coupons);
83 + mRvActiveUnifiedCoupons = mRlActiveUnifiedCoupons.findViewById(R.id.rv_active_single_unified_coupons);
84 + mClActiveCouponsHeader = findViewById(R.id.cl_active_sm_coupons_title);
85 + mTvActiveUnifiedCouponsTitle = mClActiveCouponsHeader.findViewById(R.id.tv_active_sm_coupons_title);
86 + mTvChooseAll = mClActiveCouponsHeader.findViewById(R.id.tv_choose_all);
87 + mIvChooseAll = mClActiveCouponsHeader.findViewById(R.id.iv_choose_all);
88 + WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mTvInnerTitle,
89 + mTvUnifieCouponsTitle, mTvActiveUnifiedCouponsTitle);
90 + WarpUtils.renderCustomFont(this, R.font.peridot_regular, mTvEmptyUnifiedCoupons, mTvInnerSubtitle);
91 + WarpUtils.renderCustomFont(this, R.font.peridot_bold, mTvInnerClose);
92 + WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, mTvChooseAll);
67 93
68 initViews(); 94 initViews();
69 } 95 }
...@@ -73,6 +99,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli ...@@ -73,6 +99,7 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
73 super.onResume(); 99 super.onResume();
74 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "ActiveUnifiedCouponsScreen"); 100 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "ActiveUnifiedCouponsScreen");
75 mUnifiedPressed = false; 101 mUnifiedPressed = false;
102 + mActiveUnifiedPressed = false;
76 filterItems(); 103 filterItems();
77 } 104 }
78 105
...@@ -106,6 +133,18 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli ...@@ -106,6 +133,18 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
106 public void onClick(View view) { 133 public void onClick(View view) {
107 if (view.getId() == R.id.iv_coupons_close) { 134 if (view.getId() == R.id.iv_coupons_close) {
108 onBackPressed(); 135 onBackPressed();
136 + return;
137 + }
138 + if (view.getId() == R.id.iv_coupons_info) {
139 + mClInfoView.setVisibility(View.VISIBLE);
140 + return;
141 + }
142 + if (view.getId() == R.id.iv_loyalty_history_close || view.getId() == R.id.tv_inner_close) {
143 + mClInfoView.setVisibility(View.GONE);
144 + return;
145 + }
146 + if (view.getId() == R.id.iv_choose_all) {
147 +
109 } 148 }
110 } 149 }
111 150
...@@ -115,10 +154,20 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli ...@@ -115,10 +154,20 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
115 154
116 private void initViews() { 155 private void initViews() {
117 mIvBack.setOnClickListener(this); 156 mIvBack.setOnClickListener(this);
157 + mIvInfo.setOnClickListener(this);
158 + mIvInfoClose.setOnClickListener(this);
159 + mTvInnerClose.setOnClickListener(this);
160 + mIvChooseAll.setOnClickListener(this);
118 } 161 }
119 162
120 private void filterItems() { 163 private void filterItems() {
121 - if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) { 164 + if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().isEmpty()
165 + && WarplyManagerHelper.getSmCouponsList() != null && WarplyManagerHelper.getSmCouponsList().isEmpty()) {
166 + mTvEmptyUnifiedCoupons.setVisibility(View.VISIBLE);
167 + }
168 +
169 +
170 + if (WarplyManagerHelper.getMarketCouponsList() != null && !WarplyManagerHelper.getMarketCouponsList().isEmpty()) {
122 ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>(); 171 ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>();
123 for (UnifiedCoupon unicpn : WarplyManagerHelper.getMarketCouponsList()) { 172 for (UnifiedCoupon unicpn : WarplyManagerHelper.getMarketCouponsList()) {
124 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); 173 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
...@@ -151,9 +200,38 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli ...@@ -151,9 +200,38 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
151 .doOnError(error -> { 200 .doOnError(error -> {
152 }) 201 })
153 .subscribe(); 202 .subscribe();
203 +
204 + mRlUnifiedCoupons.setVisibility(View.VISIBLE);
154 } else { 205 } else {
155 - mRecyclerUnifiedCoupons.setVisibility(View.GONE); 206 + mRlUnifiedCoupons.setVisibility(View.GONE);
156 - mTvEmptyUnifiedCoupons.setVisibility(View.VISIBLE); 207 + }
208 +
209 + if (WarplyManagerHelper.getSmCouponsList() != null && !WarplyManagerHelper.getSmCouponsList().isEmpty()) {
210 + Collections.sort(WarplyManagerHelper.getSmCouponsList(), (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
211 +
212 + mRvActiveUnifiedCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
213 + mAdapterCoupons = new ActiveCouponAdapter(this, WarplyManagerHelper.getSmCouponsList(), false, false, true);
214 + mRvActiveUnifiedCoupons.setAdapter(mAdapterCoupons);
215 + mAdapterCoupons.getPositionClicks()
216 + .doOnNext(coupon -> {
217 + if (!mActiveUnifiedPressed) {
218 + mActiveUnifiedPressed = true;
219 + WarplyAnalyticsManager.logTrackersEvent(this, "click", ("MarketCoupon").concat(":").concat(coupon.getName()));
220 + Intent intent = new Intent(ActiveUnifiedCouponsActivity.this, CouponInfoActivity.class);
221 + intent.putExtra("coupon", coupon.getCoupon());
222 + intent.putExtra("isFromWallet", true);
223 +// intent.putExtra("isUnified", true);
224 +// intent.putExtra("unifiedCoupon", coupon.getBarcode());
225 + startActivity(intent);
226 + }
227 + })
228 + .doOnError(error -> {
229 + })
230 + .subscribe();
231 +
232 + mRlActiveUnifiedCoupons.setVisibility(View.VISIBLE);
233 + } else {
234 + mRlActiveUnifiedCoupons.setVisibility(View.GONE);
157 } 235 }
158 } 236 }
159 237
......
...@@ -21,6 +21,8 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; ...@@ -21,6 +21,8 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
21 import java.text.ParseException; 21 import java.text.ParseException;
22 import java.text.SimpleDateFormat; 22 import java.text.SimpleDateFormat;
23 import java.util.Date; 23 import java.util.Date;
24 +import java.util.HashSet;
25 +import java.util.Set;
24 import java.util.concurrent.TimeUnit; 26 import java.util.concurrent.TimeUnit;
25 27
26 import io.reactivex.Observable; 28 import io.reactivex.Observable;
...@@ -36,7 +38,8 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -36,7 +38,8 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
36 private Context mContext; 38 private Context mContext;
37 private CouponList mCoupons; 39 private CouponList mCoupons;
38 private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); 40 private final PublishSubject<Coupon> onClickSubject = PublishSubject.create();
39 - private boolean mIsPast = false, mIsCustom = false; 41 + private boolean mIsPast = false, mIsCustom = false, mIsActiveSM = false;
42 + private Set<Coupon> mSelectedItems = new HashSet<>();
40 43
41 public ActiveCouponAdapter(Context mContext, CouponList campaignList) { 44 public ActiveCouponAdapter(Context mContext, CouponList campaignList) {
42 this.mContext = mContext; 45 this.mContext = mContext;
...@@ -57,11 +60,19 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -57,11 +60,19 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
57 this.mIsCustom = custom; 60 this.mIsCustom = custom;
58 } 61 }
59 62
63 + public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past, boolean custom, boolean isActiveSM) {
64 + this.mContext = mContext;
65 + this.mCoupons = campaignList;
66 + this.mIsPast = past;
67 + this.mIsCustom = custom;
68 + this.mIsActiveSM = isActiveSM;
69 + }
70 +
60 public class ActiveCouponViewHolder extends RecyclerView.ViewHolder { 71 public class ActiveCouponViewHolder extends RecyclerView.ViewHolder {
61 - private ImageView ivCouponLogo, ivCouponBackground; 72 + private ImageView ivCouponLogo, ivCouponBackground, ivChooseCoupon;
62 private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit, 73 private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit,
63 tvCouponDescription, tvCouponDateExpired, tvDateLimitTitle; 74 tvCouponDescription, tvCouponDateExpired, tvDateLimitTitle;
64 - private ConstraintLayout clCustomLayout; 75 + private ConstraintLayout clCustomLayout, clActiveCustomLayout;
65 private LinearLayout lLDateLimit; 76 private LinearLayout lLDateLimit;
66 77
67 public ActiveCouponViewHolder(View view) { 78 public ActiveCouponViewHolder(View view) {
...@@ -73,10 +84,12 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -73,10 +84,12 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
73 tvCouponDate = view.findViewById(R.id.tv_active_coupons_date); 84 tvCouponDate = view.findViewById(R.id.tv_active_coupons_date);
74 tvCouponDescription = view.findViewById(R.id.tv_active_coupons_description); 85 tvCouponDescription = view.findViewById(R.id.tv_active_coupons_description);
75 clCustomLayout = view.findViewById(R.id.cl_custom_layout); 86 clCustomLayout = view.findViewById(R.id.cl_custom_layout);
87 + clActiveCustomLayout = view.findViewById(R.id.cl_active_custom_layout);
76 tvCouponDateExpired = view.findViewById(R.id.tv_active_coupons_date_expired); 88 tvCouponDateExpired = view.findViewById(R.id.tv_active_coupons_date_expired);
77 tvDateLimit = view.findViewById(R.id.tv_active_coupons_date_limit); 89 tvDateLimit = view.findViewById(R.id.tv_active_coupons_date_limit);
78 tvDateLimitTitle = view.findViewById(R.id.tv_active_coupons_date_limit_title); 90 tvDateLimitTitle = view.findViewById(R.id.tv_active_coupons_date_limit_title);
79 lLDateLimit = view.findViewById(R.id.ll_date_limit); 91 lLDateLimit = view.findViewById(R.id.ll_date_limit);
92 + ivChooseCoupon = view.findViewById(R.id.iv_choose_coupon);
80 93
81 WarpUtils.renderCustomFont(mContext, R.font.bt_cosmo_bold, tvCouponTitle, tvCouponValue); 94 WarpUtils.renderCustomFont(mContext, R.font.bt_cosmo_bold, tvCouponTitle, tvCouponValue);
82 WarpUtils.renderCustomFont(mContext, R.font.peridot_regular, tvCouponDescription, tvCouponDate); 95 WarpUtils.renderCustomFont(mContext, R.font.peridot_regular, tvCouponDescription, tvCouponDate);
...@@ -111,6 +124,8 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -111,6 +124,8 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
111 itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.past_coupon_layout, parent, false); 124 itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.past_coupon_layout, parent, false);
112 else if (mIsCustom) 125 else if (mIsCustom)
113 itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_coupon_layout, parent, false); 126 itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_coupon_layout, parent, false);
127 + else if (mIsActiveSM)
128 + itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_active_coupon_layout, parent, false);
114 else 129 else
115 itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false); 130 itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false);
116 return new ActiveCouponViewHolder(itemView); 131 return new ActiveCouponViewHolder(itemView);
...@@ -120,6 +135,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -120,6 +135,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
120 public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) { 135 public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) {
121 Coupon couponItem = mCoupons.get(position); 136 Coupon couponItem = mCoupons.get(position);
122 Merchant merchant = new Merchant(); 137 Merchant merchant = new Merchant();
138 +
123 if (mIsPast) 139 if (mIsPast)
124 holder.ivCouponBackground.setColorFilter(ContextCompat.getColor(mContext, R.color.grey_light3), android.graphics.PorterDuff.Mode.MULTIPLY); 140 holder.ivCouponBackground.setColorFilter(ContextCompat.getColor(mContext, R.color.grey_light3), android.graphics.PorterDuff.Mode.MULTIPLY);
125 if (couponItem != null) { 141 if (couponItem != null) {
...@@ -218,6 +234,28 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -218,6 +234,28 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
218 return; 234 return;
219 } 235 }
220 236
237 + if (mIsActiveSM) {
238 + if (mSelectedItems.contains(couponItem)) {
239 + holder.ivChooseCoupon.setBackgroundResource(R.drawable.ic_circle_checked_skyblue);
240 + holder.clActiveCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new3_border_skyblue);
241 + } else {
242 + holder.ivChooseCoupon.setBackgroundResource(R.drawable.ic_circle_gray);
243 + holder.clActiveCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new3);
244 + }
245 +
246 + holder.ivChooseCoupon.setOnClickListener(v -> {
247 + if (mSelectedItems.contains(couponItem)) {
248 + mSelectedItems.remove(couponItem);
249 + holder.ivChooseCoupon.setBackgroundResource(R.drawable.ic_circle_gray);
250 + holder.clActiveCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new3);
251 + } else {
252 + mSelectedItems.add(couponItem);
253 + holder.ivChooseCoupon.setBackgroundResource(R.drawable.ic_circle_checked_skyblue);
254 + holder.clActiveCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new3_border_skyblue);
255 + }
256 + });
257 + }
258 +
221 if (!TextUtils.isEmpty(couponItem.getMerchantDetails().getImgPreview())) { 259 if (!TextUtils.isEmpty(couponItem.getMerchantDetails().getImgPreview())) {
222 Glide.with(mContext) 260 Glide.with(mContext)
223 // .setDefaultRequestOptions( 261 // .setDefaultRequestOptions(
...@@ -285,6 +323,10 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -285,6 +323,10 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
285 } 323 }
286 } 324 }
287 325
326 + public Set<Coupon> getSelectedCoupons() {
327 + return mSelectedItems;
328 + }
329 +
288 private long getDaysBetweenDates(String start, String end) { 330 private long getDaysBetweenDates(String start, String end) {
289 SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); 331 SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
290 Date startDate, endDate; 332 Date startDate, endDate;
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3 +
4 + <!-- Shadow layer -->
5 +<!-- <item>-->
6 +<!-- <shape android:shape="rectangle">-->
7 +<!-- <solid android:color="#00000000" /> &lt;!&ndash; Transparent color &ndash;&gt;-->
8 +<!-- <corners android:radius="20dp" />-->
9 +<!-- <padding/>-->
10 +<!-- <size android:width="0dp" android:height="0dp"/>-->
11 +<!-- <gradient-->
12 +<!-- android:startColor="#00000091"-->
13 +<!-- android:endColor="#00000000"-->
14 +<!-- android:angle="270"/>-->
15 +<!-- </shape>-->
16 +<!-- </item>-->
17 +
18 + <!-- Background layer -->
19 + <item>
20 + <shape android:shape="rectangle">
21 + <solid android:color="@color/cos_grey2" /> <!-- Background color -->
22 + <corners android:radius="14dp" /> <!-- Rounded corners -->
23 + </shape>
24 + </item>
25 +
26 +</layer-list>
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<LinearLayout 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:tools="http://schemas.android.com/tools"
4 android:id="@+id/cl_bill_payment" 5 android:id="@+id/cl_bill_payment"
5 android:layout_width="match_parent" 6 android:layout_width="match_parent"
6 android:layout_height="match_parent" 7 android:layout_height="match_parent"
...@@ -11,7 +12,10 @@ ...@@ -11,7 +12,10 @@
11 android:id="@+id/cl_bill_header" 12 android:id="@+id/cl_bill_header"
12 android:layout_width="match_parent" 13 android:layout_width="match_parent"
13 android:layout_height="64dp" 14 android:layout_height="64dp"
14 - android:background="@color/white"> 15 + android:background="@color/white"
16 + app:layout_constraintEnd_toEndOf="parent"
17 + app:layout_constraintStart_toStartOf="parent"
18 + app:layout_constraintTop_toTopOf="parent">
15 19
16 <ImageView 20 <ImageView
17 android:id="@+id/iv_coupons_close" 21 android:id="@+id/iv_coupons_close"
...@@ -36,37 +40,230 @@ ...@@ -36,37 +40,230 @@
36 app:layout_constraintEnd_toEndOf="parent" 40 app:layout_constraintEnd_toEndOf="parent"
37 app:layout_constraintStart_toStartOf="parent" 41 app:layout_constraintStart_toStartOf="parent"
38 app:layout_constraintTop_toTopOf="parent" /> 42 app:layout_constraintTop_toTopOf="parent" />
43 +
44 + <ImageView
45 + android:id="@+id/iv_coupons_info"
46 + android:layout_width="48dp"
47 + android:layout_height="48dp"
48 + android:layout_marginEnd="16dp"
49 + android:padding="12dp"
50 + android:scaleType="centerInside"
51 + android:src="@drawable/ic_info"
52 + app:layout_constraintBottom_toBottomOf="parent"
53 + app:layout_constraintEnd_toEndOf="parent"
54 + app:layout_constraintTop_toTopOf="parent" />
55 + </androidx.constraintlayout.widget.ConstraintLayout>
56 +
57 + <androidx.constraintlayout.widget.ConstraintLayout
58 + android:id="@+id/cl_info_view"
59 + android:layout_width="match_parent"
60 + android:layout_height="wrap_content"
61 + android:layout_marginHorizontal="16dp"
62 + android:layout_marginTop="48dp"
63 + android:translationZ="1dp"
64 + android:visibility="gone"
65 + app:layout_constraintEnd_toEndOf="parent"
66 + app:layout_constraintStart_toStartOf="parent"
67 + app:layout_constraintTop_toTopOf="parent">
68 +
69 + <ImageView
70 + android:id="@+id/iv_arrow"
71 + android:layout_width="10dp"
72 + android:layout_height="7dp"
73 + android:layout_marginEnd="24dp"
74 + android:scaleType="fitXY"
75 + android:src="@drawable/ic_arrow_up"
76 + app:layout_constraintEnd_toEndOf="parent"
77 + app:layout_constraintTop_toTopOf="parent" />
78 +
79 + <androidx.constraintlayout.widget.ConstraintLayout
80 + android:layout_width="0dp"
81 + android:layout_height="wrap_content"
82 + android:background="@drawable/background_grey_shadow"
83 + android:orientation="horizontal"
84 + android:paddingTop="20dp"
85 + android:paddingBottom="16dp"
86 + app:layout_constraintEnd_toEndOf="parent"
87 + app:layout_constraintStart_toStartOf="parent"
88 + app:layout_constraintTop_toBottomOf="@+id/iv_arrow">
89 +
90 + <TextView
91 + android:id="@+id/tv_inner_title"
92 + android:layout_width="wrap_content"
93 + android:layout_height="wrap_content"
94 + android:layout_marginStart="24dp"
95 + android:gravity="center"
96 + android:text="@string/cos_market_title"
97 + android:textColor="@color/cos_light_black"
98 + android:textSize="17sp"
99 + app:layout_constraintStart_toStartOf="parent"
100 + app:layout_constraintTop_toTopOf="parent" />
101 +
102 + <ImageView
103 + android:id="@+id/iv_loyalty_history_close"
104 + android:layout_width="12dp"
105 + android:layout_height="12dp"
106 + android:layout_marginEnd="24dp"
107 + android:scaleType="centerInside"
108 + android:src="@drawable/ic_close"
109 + app:layout_constraintBottom_toBottomOf="@+id/tv_inner_title"
110 + app:layout_constraintEnd_toEndOf="parent"
111 + app:layout_constraintTop_toTopOf="@+id/tv_inner_title" />
112 +
113 + <TextView
114 + android:id="@+id/tv_inner_subtitle"
115 + android:layout_width="0dp"
116 + android:layout_height="wrap_content"
117 + android:layout_marginHorizontal="24dp"
118 + android:layout_marginTop="16dp"
119 + android:text="@string/cos_market_subtitle"
120 + android:textColor="@color/cos_light_black"
121 + android:textSize="17sp"
122 + app:layout_constraintEnd_toEndOf="parent"
123 + app:layout_constraintStart_toStartOf="parent"
124 + app:layout_constraintTop_toBottomOf="@+id/tv_inner_title" />
125 +
126 + <TextView
127 + android:id="@+id/tv_inner_close"
128 + android:layout_width="0dp"
129 + android:layout_height="wrap_content"
130 + android:layout_marginTop="16dp"
131 + android:layout_marginEnd="24dp"
132 + android:text="@string/cos_market_close"
133 + android:textColor="@color/cos_light_black"
134 + android:textSize="16sp"
135 + app:layout_constraintBottom_toBottomOf="parent"
136 + app:layout_constraintEnd_toEndOf="parent"
137 + app:layout_constraintTop_toBottomOf="@+id/tv_inner_subtitle" />
138 + </androidx.constraintlayout.widget.ConstraintLayout>
139 +
39 </androidx.constraintlayout.widget.ConstraintLayout> 140 </androidx.constraintlayout.widget.ConstraintLayout>
40 141
41 <!-- android:background="@drawable/shape_cos_loyalty"--> 142 <!-- android:background="@drawable/shape_cos_loyalty"-->
42 <RelativeLayout 143 <RelativeLayout
144 + android:id="@+id/rl_unified_coupons"
43 android:layout_width="match_parent" 145 android:layout_width="match_parent"
44 - android:layout_height="match_parent" 146 + android:layout_height="wrap_content"
45 android:background="@color/cos_light_grey3" 147 android:background="@color/cos_light_grey3"
46 - android:orientation="vertical"> 148 + android:orientation="vertical"
149 + android:visibility="gone"
150 + app:layout_constraintEnd_toEndOf="parent"
151 + app:layout_constraintStart_toStartOf="parent"
152 + app:layout_constraintTop_toBottomOf="@+id/cl_bill_header"
153 + tools:visibility="visible">
154 +
155 + <TextView
156 + android:id="@+id/tv_sm_coupons_title"
157 + android:layout_width="wrap_content"
158 + android:layout_height="wrap_content"
159 + android:layout_marginHorizontal="16dp"
160 + android:layout_marginTop="32dp"
161 + android:layout_marginBottom="8dp"
162 + android:gravity="center"
163 + android:lineHeight="24dp"
164 + android:text="@string/cos_coupon_unified_title"
165 + android:textColor="@color/cos_light_black"
166 + android:textSize="17sp" />
47 167
48 <androidx.recyclerview.widget.RecyclerView 168 <androidx.recyclerview.widget.RecyclerView
49 android:id="@+id/rv_active_unified_coupons" 169 android:id="@+id/rv_active_unified_coupons"
50 android:layout_width="match_parent" 170 android:layout_width="match_parent"
51 android:layout_height="wrap_content" 171 android:layout_height="wrap_content"
172 + android:layout_below="@+id/tv_sm_coupons_title"
52 android:clipToPadding="false" 173 android:clipToPadding="false"
53 android:orientation="vertical" 174 android:orientation="vertical"
54 android:overScrollMode="never" 175 android:overScrollMode="never"
55 android:paddingVertical="16dp" 176 android:paddingVertical="16dp"
56 android:scrollbars="none" /> 177 android:scrollbars="none" />
178 + </RelativeLayout>
57 179
58 - <TextView 180 + <RelativeLayout
59 - android:id="@+id/tv_no_unified_coupons" 181 + android:id="@+id/rl_active_unified_coupons"
60 - android:layout_width="wrap_content" 182 + android:layout_width="match_parent"
183 + android:layout_height="wrap_content"
184 + android:background="@color/cos_light_grey3"
185 + android:orientation="vertical"
186 + android:visibility="gone"
187 + app:layout_constraintEnd_toEndOf="parent"
188 + app:layout_constraintStart_toStartOf="parent"
189 + app:layout_constraintTop_toBottomOf="@+id/rl_unified_coupons"
190 + tools:visibility="visible">
191 +
192 + <androidx.constraintlayout.widget.ConstraintLayout
193 + android:id="@+id/cl_active_sm_coupons_title"
194 + android:layout_width="match_parent"
61 android:layout_height="wrap_content" 195 android:layout_height="wrap_content"
62 - android:layout_centerHorizontal="true" 196 + android:layout_marginHorizontal="16dp"
63 - android:layout_marginTop="24dp" 197 + android:layout_marginTop="8dp"
64 - android:layout_marginHorizontal="24dp" 198 + android:layout_marginBottom="8dp">
65 - android:gravity="center" 199 +
66 - android:lineHeight="24dp" 200 + <TextView
67 - android:text="@string/cos_no_active_unified_coupons" 201 + android:id="@+id/tv_active_sm_coupons_title"
68 - android:textColor="@color/cos_light_black" 202 + android:layout_width="wrap_content"
69 - android:textSize="16sp" 203 + android:layout_height="wrap_content"
70 - android:visibility="gone" /> 204 + android:gravity="center"
205 + android:lineHeight="24dp"
206 + android:text="@string/cos_coupon_active_unified_title"
207 + android:textColor="@color/cos_light_black"
208 + android:textSize="17sp"
209 + app:layout_constraintBottom_toBottomOf="parent"
210 + app:layout_constraintStart_toStartOf="parent"
211 + app:layout_constraintTop_toTopOf="parent" />
212 +
213 + <LinearLayout
214 + android:layout_width="wrap_content"
215 + android:layout_height="wrap_content"
216 + android:gravity="center"
217 + android:orientation="horizontal"
218 + app:layout_constraintBottom_toBottomOf="@+id/tv_active_sm_coupons_title"
219 + app:layout_constraintEnd_toEndOf="parent"
220 + app:layout_constraintTop_toTopOf="@+id/tv_active_sm_coupons_title">
221 +
222 + <TextView
223 + android:id="@+id/tv_choose_all"
224 + android:layout_width="wrap_content"
225 + android:layout_height="wrap_content"
226 + android:gravity="center"
227 + android:text="@string/cos_coupon_active_unified_choose_all_title"
228 + android:textColor="@color/cos_light_black"
229 + android:textSize="17sp" />
230 +
231 + <ImageView
232 + android:id="@+id/iv_choose_all"
233 + android:layout_width="28dp"
234 + android:layout_height="28dp"
235 + android:layout_marginStart="8dp"
236 + android:scaleType="fitXY"
237 + android:src="@drawable/ic_circle_gray" />
238 + </LinearLayout>
239 + </androidx.constraintlayout.widget.ConstraintLayout>
240 +
241 + <androidx.recyclerview.widget.RecyclerView
242 + android:id="@+id/rv_active_single_unified_coupons"
243 + android:layout_width="match_parent"
244 + android:layout_height="wrap_content"
245 + android:layout_below="@+id/cl_active_sm_coupons_title"
246 + android:clipToPadding="false"
247 + android:orientation="vertical"
248 + android:overScrollMode="never"
249 + android:paddingVertical="16dp"
250 + android:scrollbars="none" />
71 </RelativeLayout> 251 </RelativeLayout>
72 -</LinearLayout>
...\ No newline at end of file ...\ No newline at end of file
252 +
253 + <TextView
254 + android:id="@+id/tv_no_unified_coupons"
255 + android:layout_width="wrap_content"
256 + android:layout_height="wrap_content"
257 + android:layout_centerHorizontal="true"
258 + android:layout_marginHorizontal="24dp"
259 + android:layout_marginTop="24dp"
260 + android:gravity="center"
261 + android:lineHeight="24dp"
262 + android:text="@string/cos_no_active_unified_coupons"
263 + android:textColor="@color/cos_light_black"
264 + android:textSize="16sp"
265 + android:visibility="gone"
266 + app:layout_constraintEnd_toEndOf="parent"
267 + app:layout_constraintStart_toStartOf="parent"
268 + app:layout_constraintTop_toBottomOf="@+id/cl_bill_header" />
269 +</androidx.constraintlayout.widget.ConstraintLayout>
...\ No newline at end of file ...\ No newline at end of file
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 + xmlns:app="http://schemas.android.com/apk/res-auto"
4 + xmlns:custom="http://schemas.android.com/apk/res-auto"
5 + xmlns:tools="http://schemas.android.com/tools"
6 + android:layout_width="match_parent"
7 + android:layout_height="145dp"
8 + android:layout_marginHorizontal="6dp"
9 + android:layout_marginBottom="3dp"
10 + android:id="@+id/cl_active_custom_layout"
11 + android:background="@drawable/ic_coupon_background_new3">
12 +
13 + <androidx.constraintlayout.widget.Guideline
14 + android:id="@+id/gl_vertical_72_percent"
15 + android:layout_width="wrap_content"
16 + android:layout_height="wrap_content"
17 + android:orientation="vertical"
18 + app:layout_constraintGuide_percent="0.72" />
19 +
20 + <ImageView
21 + android:id="@+id/iv_active_coupon"
22 + android:layout_width="80dp"
23 + android:layout_height="80dp"
24 + android:layout_marginStart="24dp"
25 + app:layout_constraintBottom_toBottomOf="parent"
26 + app:layout_constraintStart_toStartOf="parent"
27 + app:layout_constraintTop_toTopOf="parent"
28 + tools:src="@drawable/ic_gifts_for_you" />
29 +
30 + <ly.warp.sdk.views.DividerView
31 + android:id="@+id/v_separator"
32 + android:layout_width="1dp"
33 + android:layout_height="0dp"
34 + android:layout_marginVertical="16dp"
35 + android:layout_marginStart="16dp"
36 + android:layerType="software"
37 + app:layout_constraintBottom_toBottomOf="parent"
38 + app:layout_constraintStart_toEndOf="@+id/iv_active_coupon"
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" />
45 +
46 + <LinearLayout
47 + android:id="@+id/ll_coupon_info"
48 + android:layout_width="0dp"
49 + android:layout_height="wrap_content"
50 + android:layout_marginHorizontal="16dp"
51 + android:orientation="vertical"
52 + app:layout_constraintBottom_toBottomOf="parent"
53 + app:layout_constraintEnd_toEndOf="parent"
54 + app:layout_constraintStart_toEndOf="@+id/v_separator"
55 + app:layout_constraintTop_toTopOf="parent">
56 +
57 + <TextView
58 + android:id="@+id/tv_active_coupons_title"
59 + android:layout_width="wrap_content"
60 + android:layout_height="wrap_content"
61 + android:ellipsize="end"
62 + android:maxLines="1"
63 + android:textColor="@color/cos_light_black"
64 + android:textSize="16sp"
65 + tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" />
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 +
78 + <TextView
79 + android:id="@+id/tv_active_coupons_value"
80 + android:layout_width="wrap_content"
81 + android:layout_height="wrap_content"
82 + android:textColor="@color/cos_light_black"
83 + android:textSize="42sp"
84 + app:layout_constraintBottom_toBottomOf="parent"
85 + app:layout_constraintStart_toStartOf="parent"
86 + app:layout_constraintTop_toTopOf="parent"
87 + tools:text="10$" />
88 +
89 + <TextView
90 + android:id="@+id/tv_active_coupons_description"
91 + android:layout_width="0dp"
92 + android:layout_height="wrap_content"
93 + android:ellipsize="end"
94 + android:maxLines="3"
95 + android:textColor="@color/cos_light_black"
96 + android:textSize="12sp"
97 + app:layout_constraintBottom_toBottomOf="parent"
98 + app:layout_constraintEnd_toEndOf="parent"
99 + app:layout_constraintHorizontal_bias="0.0"
100 + app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner"
101 + app:layout_constraintTop_toTopOf="parent"
102 + app:layout_constraintVertical_bias="0.545"
103 + tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
104 + </androidx.constraintlayout.widget.ConstraintLayout>
105 +
106 + <TextView
107 + android:id="@+id/tv_active_coupons_date"
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>
114 +
115 + <ImageView
116 + android:id="@+id/iv_choose_coupon"
117 + android:layout_width="24dp"
118 + android:layout_height="24dp"
119 + android:layout_marginTop="8dp"
120 + android:layout_marginEnd="8dp"
121 + app:layout_constraintEnd_toEndOf="parent"
122 + app:layout_constraintTop_toTopOf="parent"
123 + tools:src="@drawable/ic_circle_gray" />
124 +</androidx.constraintlayout.widget.ConstraintLayout>
...\ No newline at end of file ...\ No newline at end of file
...@@ -75,6 +75,9 @@ ...@@ -75,6 +75,9 @@
75 <string name="cos_no_active_rewards">Δεν υπάρχουν δώρα</string> 75 <string name="cos_no_active_rewards">Δεν υπάρχουν δώρα</string>
76 <string name="cos_past_all_coupons">Παλαιότερα κουπόνια</string> 76 <string name="cos_past_all_coupons">Παλαιότερα κουπόνια</string>
77 <string name="cos_coupon_expired_date">Εξαργυρώθηκε την %1$s</string> 77 <string name="cos_coupon_expired_date">Εξαργυρώθηκε την %1$s</string>
78 + <string name="cos_coupon_unified_title">Ενιαία κουπόνια</string>
79 + <string name="cos_coupon_active_unified_title">Κουπόνια</string>
80 + <string name="cos_coupon_active_unified_choose_all_title">Επιλογή όλων</string>
78 <string name="cos_popup_gifts_title">COSMOTE GIFTS FOR YOU</string> 81 <string name="cos_popup_gifts_title">COSMOTE GIFTS FOR YOU</string>
79 <string name="cos_popup_gifts_subtitle">Σε αυτή την ενότητα βρίσκεις τα διαθέσιμα δώρα και επιβραβεύσεις αποκλειστικά για σένα!</string> 82 <string name="cos_popup_gifts_subtitle">Σε αυτή την ενότητα βρίσκεις τα διαθέσιμα δώρα και επιβραβεύσεις αποκλειστικά για σένα!</string>
80 <string name="cos_mycoupon_date">Το κουπόνι ισχύει έως %1$s</string> 83 <string name="cos_mycoupon_date">Το κουπόνι ισχύει έως %1$s</string>
...@@ -165,6 +168,8 @@ ...@@ -165,6 +168,8 @@
165 <string name="cos_dlg_no_shops_positive">Δες το eshop</string> 168 <string name="cos_dlg_no_shops_positive">Δες το eshop</string>
166 <string name="cos_profile_preferences_placeholder">Οι προτιμήσεις μου</string> 169 <string name="cos_profile_preferences_placeholder">Οι προτιμήσεις μου</string>
167 <string name="cos_market_title">SUPERMARKET DEALS</string> 170 <string name="cos_market_title">SUPERMARKET DEALS</string>
171 + <string name="cos_market_subtitle">Δημιούργησε το δικό σου ενιαίο κουπόνι προσφορών, και εξαργύρωσέ το στα supermarket της επιλογής σου γρήγορα και εύκολα με ένα μόνο κωδικό κουπονιού!</string>
172 + <string name="cos_market_close">Τέλος</string>
168 <string name="cos_rewards_title2">COSMOTE Επιβράβευση</string> 173 <string name="cos_rewards_title2">COSMOTE Επιβράβευση</string>
169 <string name="cos_market_item_title">COSMOTE\nSUPERMARKET\nDEALS</string> 174 <string name="cos_market_item_title">COSMOTE\nSUPERMARKET\nDEALS</string>
170 <string name="cos_market_active_coupons">έχεις %1$s ενεργά κουπόνια αξίας %2$s€</string> 175 <string name="cos_market_active_coupons">έχεις %1$s ενεργά κουπόνια αξίας %2$s€</string>
......