Panagiotis Triantafyllou

more for you screen

...@@ -94,7 +94,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -94,7 +94,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
94 mTvCouponCode.setText(mCoupon.getCoupon()); 94 mTvCouponCode.setText(mCoupon.getCoupon());
95 mTvCouponTitle.setText(mCoupon.getName()); 95 mTvCouponTitle.setText(mCoupon.getName());
96 mTvCouponSubtitle.setText(mCoupon.getDescription()); 96 mTvCouponSubtitle.setText(mCoupon.getDescription());
97 - String strCurrentDate = mCoupon.getCreated(); 97 + String strCurrentDate = mCoupon.getExpiration();
98 SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy"); 98 SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
99 Date newDate = new Date(); 99 Date newDate = new Date();
100 try { 100 try {
......
...@@ -67,8 +67,8 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener ...@@ -67,8 +67,8 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
67 mTvTitle.setText(getIntent().getStringExtra("title")); 67 mTvTitle.setText(getIntent().getStringExtra("title"));
68 68
69 if (WarplyManagerHelper.getUniqueCampaignList().get("more_for_you") != null && WarplyManagerHelper.getUniqueCampaignList().get("more_for_you").size() > 0) { 69 if (WarplyManagerHelper.getUniqueCampaignList().get("more_for_you") != null && WarplyManagerHelper.getUniqueCampaignList().get("more_for_you").size() > 0) {
70 - mRecyclerMore.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)); 70 + mRecyclerMore.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
71 - mAdapterMore = new ProfileCampaignAdapter(this, WarplyManagerHelper.getUniqueCampaignList().get("more_for_you")); 71 + mAdapterMore = new ProfileCampaignAdapter(this, WarplyManagerHelper.getUniqueCampaignList().get("more_for_you"), true);
72 mRecyclerMore.setAdapter(mAdapterMore); 72 mRecyclerMore.setAdapter(mAdapterMore);
73 mAdapterMore.getPositionClicks() 73 mAdapterMore.getPositionClicks()
74 .doOnNext(gift -> { 74 .doOnNext(gift -> {
......
...@@ -22,8 +22,6 @@ import java.util.concurrent.TimeUnit; ...@@ -22,8 +22,6 @@ import java.util.concurrent.TimeUnit;
22 import io.reactivex.Observable; 22 import io.reactivex.Observable;
23 import io.reactivex.subjects.PublishSubject; 23 import io.reactivex.subjects.PublishSubject;
24 import ly.warp.sdk.R; 24 import ly.warp.sdk.R;
25 -import ly.warp.sdk.io.models.Coupon;
26 -import ly.warp.sdk.io.models.CouponList;
27 import ly.warp.sdk.io.models.Couponset; 25 import ly.warp.sdk.io.models.Couponset;
28 import ly.warp.sdk.io.models.CouponsetsList; 26 import ly.warp.sdk.io.models.CouponsetsList;
29 27
...@@ -101,13 +99,16 @@ public class CouponsetsAdapter extends RecyclerView.Adapter<CouponsetsAdapter.Co ...@@ -101,13 +99,16 @@ public class CouponsetsAdapter extends RecyclerView.Adapter<CouponsetsAdapter.Co
101 99
102 holder.tvCouponTitle.setText(couponsetItem.getName()); 100 holder.tvCouponTitle.setText(couponsetItem.getName());
103 holder.tvCouponDescription.setText(Html.fromHtml(couponsetItem.getDescription())); 101 holder.tvCouponDescription.setText(Html.fromHtml(couponsetItem.getDescription()));
104 - Date date = null; 102 +
103 + String strCurrentDate = couponsetItem.getExpiration();
104 + SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
105 + Date newDate = new Date();
105 try { 106 try {
106 - date = new SimpleDateFormat().parse(couponsetItem.getExpiration()); 107 + newDate = format.parse(strCurrentDate);
107 - holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_active_coupon_date), String.valueOf(getDifferenceDays(date, new Date()))));
108 } catch (ParseException e) { 108 } catch (ParseException e) {
109 e.printStackTrace(); 109 e.printStackTrace();
110 } 110 }
111 + holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), format.format(newDate)));
111 112
112 holder.tvCouponValue.setText(couponsetItem.getDiscount()); 113 holder.tvCouponValue.setText(couponsetItem.getDiscount());
113 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponsetItem)); 114 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponsetItem));
......
...@@ -27,21 +27,37 @@ public class ProfileCampaignAdapter extends RecyclerView.Adapter<ProfileCampaign ...@@ -27,21 +27,37 @@ public class ProfileCampaignAdapter extends RecyclerView.Adapter<ProfileCampaign
27 private Context mContext; 27 private Context mContext;
28 private CampaignList mCampaigns; 28 private CampaignList mCampaigns;
29 private final PublishSubject<Campaign> onClickSubject = PublishSubject.create(); 29 private final PublishSubject<Campaign> onClickSubject = PublishSubject.create();
30 + private boolean mIsVertical = false;
30 31
31 public ProfileCampaignAdapter(Context mContext, CampaignList campaignList) { 32 public ProfileCampaignAdapter(Context mContext, CampaignList campaignList) {
32 this.mContext = mContext; 33 this.mContext = mContext;
33 this.mCampaigns = campaignList; 34 this.mCampaigns = campaignList;
35 + this.mIsVertical = false;
36 + }
37 +
38 + public ProfileCampaignAdapter(Context mContext, CampaignList campaignList, boolean vertical) {
39 + this.mContext = mContext;
40 + this.mCampaigns = campaignList;
41 + this.mIsVertical = vertical;
34 } 42 }
35 43
36 public class ProfileCampaignViewHolder extends RecyclerView.ViewHolder { 44 public class ProfileCampaignViewHolder extends RecyclerView.ViewHolder {
37 private ImageView ivCampaignTitle; 45 private ImageView ivCampaignTitle;
38 - private TextView tvCampaignTitle; 46 + private TextView tvCampaignTitle, tvCampaignSubtitle;
39 47
40 public ProfileCampaignViewHolder(View view) { 48 public ProfileCampaignViewHolder(View view) {
41 super(view); 49 super(view);
42 ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo); 50 ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo);
43 tvCampaignTitle = view.findViewById(R.id.tv_campaign_title); 51 tvCampaignTitle = view.findViewById(R.id.tv_campaign_title);
44 } 52 }
53 +
54 + public ProfileCampaignViewHolder(View view, boolean vertical) {
55 + super(view);
56 + ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo);
57 + tvCampaignTitle = view.findViewById(R.id.tv_campaign_title);
58 + if (vertical)
59 + tvCampaignSubtitle = view.findViewById(R.id.tv_campaign_subtitle);
60 + }
45 } 61 }
46 62
47 @Override 63 @Override
...@@ -63,11 +79,16 @@ public class ProfileCampaignAdapter extends RecyclerView.Adapter<ProfileCampaign ...@@ -63,11 +79,16 @@ public class ProfileCampaignAdapter extends RecyclerView.Adapter<ProfileCampaign
63 notifyDataSetChanged(); 79 notifyDataSetChanged();
64 } 80 }
65 81
66 -
67 @Override 82 @Override
68 public ProfileCampaignViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 83 public ProfileCampaignViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
69 - View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler, parent, false); 84 + View itemView;
70 - return new ProfileCampaignViewHolder(itemView); 85 + if (!mIsVertical) {
86 + itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler, parent, false);
87 + return new ProfileCampaignViewHolder(itemView);
88 + } else {
89 + itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler_vertical, parent, false);
90 + return new ProfileCampaignViewHolder(itemView, true);
91 + }
71 } 92 }
72 93
73 @Override 94 @Override
...@@ -88,6 +109,8 @@ public class ProfileCampaignAdapter extends RecyclerView.Adapter<ProfileCampaign ...@@ -88,6 +109,8 @@ public class ProfileCampaignAdapter extends RecyclerView.Adapter<ProfileCampaign
88 } 109 }
89 110
90 holder.tvCampaignTitle.setText(campaignItem.getTitle()); 111 holder.tvCampaignTitle.setText(campaignItem.getTitle());
112 + if (mIsVertical)
113 + holder.tvCampaignSubtitle.setText(campaignItem.getSubtitle());
91 114
92 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem)); 115 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem));
93 } 116 }
......
...@@ -100,13 +100,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -100,13 +100,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
100 100
101 holder.tvCouponTitle.setText(couponItem.getName()); 101 holder.tvCouponTitle.setText(couponItem.getName());
102 holder.tvCouponDescription.setText(couponItem.getDescription()); 102 holder.tvCouponDescription.setText(couponItem.getDescription());
103 - Date date = null; 103 +
104 + String strCurrentDate = couponItem.getExpiration();
105 + SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
106 + Date newDate = new Date();
104 try { 107 try {
105 - date = new SimpleDateFormat().parse(couponItem.getExpiration()); 108 + newDate = format.parse(strCurrentDate);
106 - holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_active_coupon_date), String.valueOf(getDifferenceDays(date, new Date()))));
107 } catch (ParseException e) { 109 } catch (ParseException e) {
108 e.printStackTrace(); 110 e.printStackTrace();
109 } 111 }
112 + holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), format.format(newDate)));
110 113
111 holder.tvCouponValue.setText(couponItem.getDiscount()); 114 holder.tvCouponValue.setText(couponItem.getDiscount());
112 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); 115 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
3 + android:width="318.547dp"
4 + android:height="237dp"
5 + android:viewportWidth="318.547"
6 + android:viewportHeight="237">
7 +
8 + <path
9 + android:fillColor="#fff"
10 + android:pathData="M318.546,237H5a5.006,5.006,0,0,1-5-5V5A5.006,5.006,0,0,1,5,0H212.609A73.158,73.158,0,0,1,268.8,66h0.2V187a49.958,49.958,0,0,0,49.546,50Z" />
11 +</vector>
...\ No newline at end of file ...\ No newline at end of file
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
6 android:background="@android:color/white" 6 android:background="@android:color/white"
7 android:fillViewport="true"> 7 android:fillViewport="true">
8 8
9 - <!-- <LinearLayout-->
10 - <!-- android:id="@+id/cl_bill_payment"-->
11 - <!-- android:layout_width="match_parent"-->
12 - <!-- android:layout_height="match_parent"-->
13 - <!-- android:orientation="vertical">-->
14 -
15 <androidx.constraintlayout.widget.ConstraintLayout 9 <androidx.constraintlayout.widget.ConstraintLayout
16 android:id="@+id/cl_more_header" 10 android:id="@+id/cl_more_header"
17 android:layout_width="match_parent" 11 android:layout_width="match_parent"
...@@ -48,43 +42,16 @@ ...@@ -48,43 +42,16 @@
48 android:layout_height="match_parent" 42 android:layout_height="match_parent"
49 android:layout_below="@+id/cl_more_header" 43 android:layout_below="@+id/cl_more_header"
50 android:background="@drawable/shape_cos_profile_gradient" 44 android:background="@drawable/shape_cos_profile_gradient"
51 - android:orientation="vertical" 45 + android:orientation="vertical">
52 - android:paddingBottom="24dp">
53 46
54 <androidx.recyclerview.widget.RecyclerView 47 <androidx.recyclerview.widget.RecyclerView
55 android:id="@+id/rv_more" 48 android:id="@+id/rv_more"
56 android:layout_width="match_parent" 49 android:layout_width="match_parent"
57 android:layout_height="match_parent" 50 android:layout_height="match_parent"
58 - android:layout_marginTop="24dp" 51 + android:layout_marginHorizontal="16dp"
52 + android:layout_marginTop="48dp"
59 android:clipToPadding="false" 53 android:clipToPadding="false"
60 android:orientation="vertical" 54 android:orientation="vertical"
61 - android:paddingEnd="24dp" /> 55 + android:paddingBottom="24dp" />
62 -
63 - <!-- <androidx.constraintlayout.widget.ConstraintLayout-->
64 - <!-- android:id="@+id/cl_recycler_inner3"-->
65 - <!-- android:layout_width="match_parent"-->
66 - <!-- android:layout_height="wrap_content"-->
67 - <!-- android:layout_below="@+id/cl_recycler_inner2"-->
68 - <!-- android:layout_marginTop="36dp"-->
69 - <!-- android:paddingBottom="4dp"-->
70 - <!-- app:layout_constraintLeft_toLeftOf="parent"-->
71 - <!-- app:layout_constraintRight_toRightOf="parent"-->
72 - <!-- app:layout_constraintTop_toTopOf="parent">-->
73 -
74 - <!-- <TextView-->
75 - <!-- android:id="@+id/tv_coupons_title"-->
76 - <!-- android:layout_width="wrap_content"-->
77 - <!-- android:layout_height="wrap_content"-->
78 - <!-- android:layout_marginStart="10dp"-->
79 - <!-- android:text="@string/cos_coupons_title"-->
80 - <!-- android:textColor="@android:color/white"-->
81 - <!-- android:textSize="18sp"-->
82 - <!-- android:textStyle="bold"-->
83 - <!-- app:layout_constraintStart_toStartOf="parent"-->
84 - <!-- app:layout_constraintTop_toTopOf="parent" />-->
85 -
86 -
87 - <!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
88 </RelativeLayout> 56 </RelativeLayout>
89 - <!-- </LinearLayout>-->
90 </RelativeLayout> 57 </RelativeLayout>
...\ No newline at end of file ...\ No newline at end of file
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
3 + xmlns:app="http://schemas.android.com/apk/res-auto"
4 + xmlns:tools="http://schemas.android.com/tools"
5 + android:layout_width="match_parent"
6 + android:layout_height="240dp"
7 + android:layout_marginBottom="16dp"
8 + app:cardCornerRadius="5dp">
9 +
10 + <androidx.constraintlayout.widget.ConstraintLayout
11 + android:layout_width="match_parent"
12 + android:layout_height="match_parent"
13 + android:background="@drawable/selector_cos_campaign">
14 +
15 + <androidx.constraintlayout.widget.Guideline
16 + android:id="@+id/gl_vertical_80_percent"
17 + android:layout_width="wrap_content"
18 + android:layout_height="wrap_content"
19 + android:orientation="vertical"
20 + app:layout_constraintGuide_percent="0.8" />
21 +
22 + <ImageView
23 + android:id="@+id/iv_campaign_logo"
24 + android:layout_width="0dp"
25 + android:layout_height="0dp"
26 + android:scaleType="centerCrop"
27 + app:layout_constraintBottom_toBottomOf="parent"
28 + app:layout_constraintEnd_toEndOf="parent"
29 + app:layout_constraintStart_toStartOf="parent"
30 + app:layout_constraintTop_toTopOf="parent"
31 + tools:src="@drawable/ic_cosmote_logo_horizontal_grey" />
32 +
33 + <androidx.constraintlayout.widget.ConstraintLayout
34 + android:layout_width="0dp"
35 + android:layout_height="match_parent"
36 + android:background="@drawable/svg_background_more"
37 + android:orientation="vertical"
38 + app:layout_constraintBottom_toBottomOf="parent"
39 + app:layout_constraintEnd_toStartOf="@+id/gl_vertical_80_percent"
40 + app:layout_constraintStart_toStartOf="parent"
41 + app:layout_constraintTop_toTopOf="parent">
42 +
43 + <androidx.constraintlayout.widget.Guideline
44 + android:id="@+id/gl_vertical_80_percent_inner"
45 + android:layout_width="wrap_content"
46 + android:layout_height="wrap_content"
47 + android:orientation="vertical"
48 + app:layout_constraintGuide_percent="0.8" />
49 +
50 + <TextView
51 + android:id="@+id/tv_campaign_title"
52 + android:layout_width="0dp"
53 + android:layout_height="wrap_content"
54 + android:layout_marginHorizontal="12dp"
55 + android:layout_marginTop="20dp"
56 + android:maxLines="2"
57 + android:textColor="@color/blue_dark"
58 + android:textSize="18sp"
59 + android:textStyle="bold"
60 + app:layout_constraintEnd_toStartOf="@+id/gl_vertical_80_percent_inner"
61 + app:layout_constraintStart_toStartOf="parent"
62 + app:layout_constraintTop_toTopOf="parent"
63 + tools:text="ΔΙΑΓΩΝΙΣΜΟΣ ΑΓΙΟΥ ΒΑΛΕΝΤΙΝΟΥ!" />
64 +
65 + <TextView
66 + android:id="@+id/tv_campaign_subtitle"
67 + android:layout_width="0dp"
68 + android:layout_height="wrap_content"
69 + android:layout_marginHorizontal="12dp"
70 + android:layout_marginBottom="20dp"
71 + android:maxLines="4"
72 + android:textColor="@color/blue_dark"
73 + android:textSize="16sp"
74 + android:textStyle="bold"
75 + app:layout_constraintBottom_toBottomOf="parent"
76 + app:layout_constraintEnd_toStartOf="@+id/gl_vertical_80_percent_inner"
77 + app:layout_constraintStart_toStartOf="parent"
78 + tools:text="Σπάσε την πινιάτα και κέρδισε μοναδικά δώρα εσύ και το ταίρι σου!" />
79 + </androidx.constraintlayout.widget.ConstraintLayout>
80 + </androidx.constraintlayout.widget.ConstraintLayout>
81 +</androidx.cardview.widget.CardView>
...\ No newline at end of file ...\ No newline at end of file
...@@ -26,4 +26,5 @@ ...@@ -26,4 +26,5 @@
26 <color name="cos_green4">#6DBC7A</color> 26 <color name="cos_green4">#6DBC7A</color>
27 <color name="cos_green5">#79BF14</color> 27 <color name="cos_green5">#79BF14</color>
28 <color name="cos_green5_tr">#6679BF14</color> 28 <color name="cos_green5_tr">#6679BF14</color>
29 + <color name="blue_dark">#3A5266</color>
29 </resources> 30 </resources>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
26 <string name="cos_gifts_loyalty_title">Τα δώρα μου</string> 26 <string name="cos_gifts_loyalty_title">Τα δώρα μου</string>
27 <string name="cos_coupons_loyalty_title">Ενεργά κουπόνια</string> 27 <string name="cos_coupons_loyalty_title">Ενεργά κουπόνια</string>
28 <string name="cos_coupon_info_title">Εκπτωτικό κουπόνι</string> 28 <string name="cos_coupon_info_title">Εκπτωτικό κουπόνι</string>
29 - <string name="cos_coupon_date">Το κουπόνι ισχύει έως %1$s</string> 29 + <string name="cos_coupon_date">Ισχύει έως %1$s</string>
30 <string name="cos_dl_title">Μόλις έλαβες δώρο %1$s συμμετοχές στο My Lucky Day Draw!</string> 30 <string name="cos_dl_title">Μόλις έλαβες δώρο %1$s συμμετοχές στο My Lucky Day Draw!</string>
31 <string name="cos_active_coupons">Έχεις %1$s ενεργά\nκουπόνια</string> 31 <string name="cos_active_coupons">Έχεις %1$s ενεργά\nκουπόνια</string>
32 <string name="cos_active_coupon_date">Λήγει σε %1$s ημέρες</string> 32 <string name="cos_active_coupon_date">Λήγει σε %1$s ημέρες</string>
......