Panagiotis Triantafyllou

more fixes and changes

Showing 22 changed files with 245 additions and 189 deletions
...@@ -67,6 +67,11 @@ ...@@ -67,6 +67,11 @@
67 android:screenOrientation="portrait" /> 67 android:screenOrientation="portrait" />
68 68
69 <activity 69 <activity
70 + android:name="ly.warp.sdk.activities.LoyaltyWallet"
71 + android:exported="false"
72 + android:screenOrientation="portrait" />
73 +
74 + <activity
70 android:name="ly.warp.sdk.dexter.PermissionsActivity" 75 android:name="ly.warp.sdk.dexter.PermissionsActivity"
71 android:exported="false" 76 android:exported="false"
72 android:launchMode="singleInstance" 77 android:launchMode="singleInstance"
......
...@@ -15,10 +15,8 @@ import android.widget.TextView; ...@@ -15,10 +15,8 @@ import android.widget.TextView;
15 import com.bumptech.glide.Glide; 15 import com.bumptech.glide.Glide;
16 import com.bumptech.glide.load.engine.DiskCacheStrategy; 16 import com.bumptech.glide.load.engine.DiskCacheStrategy;
17 import com.google.zxing.BarcodeFormat; 17 import com.google.zxing.BarcodeFormat;
18 -import com.google.zxing.WriterException;
19 import com.google.zxing.common.BitMatrix; 18 import com.google.zxing.common.BitMatrix;
20 import com.google.zxing.oned.EAN13Writer; 19 import com.google.zxing.oned.EAN13Writer;
21 -import com.google.zxing.qrcode.QRCodeWriter;
22 20
23 import java.text.ParseException; 21 import java.text.ParseException;
24 import java.text.SimpleDateFormat; 22 import java.text.SimpleDateFormat;
...@@ -94,16 +92,17 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -94,16 +92,17 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
94 mTvCouponCode.setText(mCoupon.getCoupon()); 92 mTvCouponCode.setText(mCoupon.getCoupon());
95 mTvCouponTitle.setText(mCoupon.getName()); 93 mTvCouponTitle.setText(mCoupon.getName());
96 mTvCouponSubtitle.setText(mCoupon.getDescription()); 94 mTvCouponSubtitle.setText(mCoupon.getDescription());
97 - String strCurrentDate = mCoupon.getExpiration(); 95 +
98 - SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy"); 96 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
99 Date newDate = new Date(); 97 Date newDate = new Date();
100 try { 98 try {
101 - newDate = format.parse(strCurrentDate); 99 + newDate = simpleDateFormat.parse(mCoupon.getExpiration());
102 } catch (ParseException e) { 100 } catch (ParseException e) {
103 e.printStackTrace(); 101 e.printStackTrace();
104 } 102 }
105 - mTvCouponDate.setText(String.format(getResources().getString(R.string.cos_coupon_date), 103 + simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
106 - format.format(newDate))); 104 + mTvCouponDate.setText(String.format(getResources().getString(R.string.cos_coupon_date), simpleDateFormat.format(newDate != null ? newDate : "")));
105 +
107 if (!TextUtils.isEmpty(mCoupon.getImage())) { 106 if (!TextUtils.isEmpty(mCoupon.getImage())) {
108 Glide.with(this) 107 Glide.with(this)
109 // .setDefaultRequestOptions( 108 // .setDefaultRequestOptions(
......
...@@ -10,16 +10,7 @@ import android.widget.ImageView; ...@@ -10,16 +10,7 @@ import android.widget.ImageView;
10 import android.widget.Spinner; 10 import android.widget.Spinner;
11 import android.widget.TextView; 11 import android.widget.TextView;
12 12
13 -import androidx.recyclerview.widget.LinearLayoutManager;
14 -import androidx.recyclerview.widget.RecyclerView;
15 -
16 -import java.io.Serializable;
17 -
18 import ly.warp.sdk.R; 13 import ly.warp.sdk.R;
19 -import ly.warp.sdk.io.models.Campaign;
20 -import ly.warp.sdk.io.models.CampaignList;
21 -import ly.warp.sdk.utils.WarplyManagerHelper;
22 -import ly.warp.sdk.views.adapters.HomeCouponAdapter;
23 14
24 15
25 public class LoyaltyActivity extends Activity implements View.OnClickListener, 16 public class LoyaltyActivity extends Activity implements View.OnClickListener,
...@@ -34,10 +25,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -34,10 +25,8 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
34 // =========================================================== 25 // ===========================================================
35 26
36 private ImageView mIvBack; 27 private ImageView mIvBack;
37 - private RecyclerView mRecyclerCoupons, mRecyclerBurntCoupons;
38 - private HomeCouponAdapter mAdapterCoupons, mAdapterBurntCoupons;
39 private Spinner mCouponSpinner, mRedemptionSpinner; 28 private Spinner mCouponSpinner, mRedemptionSpinner;
40 - private TextView mTvAnalysisButton, mTvUsername, mTvQuestionnaire; 29 + private TextView mTvAnalysisButton;
41 30
42 // =========================================================== 31 // ===========================================================
43 // Methods for/from SuperClass/Interfaces 32 // Methods for/from SuperClass/Interfaces
...@@ -49,14 +38,9 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -49,14 +38,9 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
49 setContentView(R.layout.activity_loyalty); 38 setContentView(R.layout.activity_loyalty);
50 39
51 mIvBack = findViewById(R.id.iv_back); 40 mIvBack = findViewById(R.id.iv_back);
52 -
53 - mRecyclerCoupons = findViewById(R.id.rv_loyalty_coupons);
54 - mRecyclerBurntCoupons = findViewById(R.id.rv_loyalty_burnt_coupons);
55 mCouponSpinner = findViewById(R.id.sp_coupons); 41 mCouponSpinner = findViewById(R.id.sp_coupons);
56 mRedemptionSpinner = findViewById(R.id.sp_redemption); 42 mRedemptionSpinner = findViewById(R.id.sp_redemption);
57 mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details); 43 mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details);
58 - mTvUsername = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_card_username);
59 - mTvQuestionnaire = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_questionnaire);
60 44
61 initViews(); 45 initViews();
62 } 46 }
...@@ -75,24 +59,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -75,24 +59,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
75 if (view.getId() == R.id.tv_analysis_details) { 59 if (view.getId() == R.id.tv_analysis_details) {
76 Intent intent = new Intent(this, CouponTransactionActivity.class); 60 Intent intent = new Intent(this, CouponTransactionActivity.class);
77 startActivity(intent); 61 startActivity(intent);
78 - return;
79 - }
80 - if (view.getId() == R.id.tv_questionnaire) {
81 - CampaignList cl = WarplyManagerHelper.getUniqueCampaignList().get("more");
82 - Campaign camp = null;
83 - if (cl != null) {
84 - for (Campaign cn : cl) {
85 - if (cn.getSessionUUID().equals("4fc2865e32bd4d5495a3dfdf1472da7f")) {
86 - camp = cn;
87 - break;
88 - }
89 - }
90 - }
91 -
92 - if (camp == null)
93 - return;
94 -
95 - startActivity(WarpViewActivity.createIntentFromURL(LoyaltyActivity.this, WarplyManagerHelper.constructCampaignUrl(camp)));
96 } 62 }
97 } 63 }
98 64
...@@ -109,8 +75,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -109,8 +75,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
109 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab).setVisibility(View.GONE); 75 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab).setVisibility(View.GONE);
110 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab2).setVisibility(View.GONE); 76 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab2).setVisibility(View.GONE);
111 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab3).setVisibility(View.GONE); 77 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab3).setVisibility(View.GONE);
112 - findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab4).setVisibility(View.VISIBLE);
113 - findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab5).setVisibility(View.VISIBLE);
114 } else { 78 } else {
115 mRedemptionSpinner.setVisibility(View.VISIBLE); 79 mRedemptionSpinner.setVisibility(View.VISIBLE);
116 findViewById(R.id.cl_chart).findViewById(R.id.cl_inner_chart).setVisibility(View.VISIBLE); 80 findViewById(R.id.cl_chart).findViewById(R.id.cl_inner_chart).setVisibility(View.VISIBLE);
...@@ -119,8 +83,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -119,8 +83,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
119 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab).setVisibility(View.VISIBLE); 83 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab).setVisibility(View.VISIBLE);
120 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab2).setVisibility(View.VISIBLE); 84 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab2).setVisibility(View.VISIBLE);
121 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab3).setVisibility(View.VISIBLE); 85 findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab3).setVisibility(View.VISIBLE);
122 - findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab4).setVisibility(View.GONE);
123 - findViewById(R.id.cl_chart_info).findViewById(R.id.analysis_tab5).setVisibility(View.GONE);
124 } 86 }
125 } 87 }
126 } 88 }
...@@ -135,30 +97,9 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -135,30 +97,9 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
135 // =========================================================== 97 // ===========================================================
136 98
137 private void initViews() { 99 private void initViews() {
138 - if (WarplyManagerHelper.getConsumer() != null)
139 - mTvUsername.setText(String.format(getResources().getString(R.string.cos_profile_loyalty_name),
140 - WarplyManagerHelper.getConsumer().getFirstName(), WarplyManagerHelper.getConsumer().getLastName()));
141 -
142 mIvBack.setOnClickListener(this); 100 mIvBack.setOnClickListener(this);
143 mTvAnalysisButton.setOnClickListener(this); 101 mTvAnalysisButton.setOnClickListener(this);
144 102
145 - mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
146 - mAdapterCoupons = new HomeCouponAdapter(this, WarplyManagerHelper.getCouponList());
147 - mRecyclerCoupons.setAdapter(mAdapterCoupons);
148 - mAdapterCoupons.getPositionClicks()
149 - .doOnNext(coupon -> {
150 - Intent intent = new Intent(this, CouponInfoActivity.class);
151 - intent.putExtra("coupon", (Serializable) coupon);
152 - startActivity(intent);
153 - })
154 - .doOnError(error -> {
155 - })
156 - .subscribe();
157 -
158 - mRecyclerBurntCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
159 - mAdapterBurntCoupons = new HomeCouponAdapter(this, WarplyManagerHelper.getCouponList(), true);
160 - mRecyclerBurntCoupons.setAdapter(mAdapterBurntCoupons);
161 -
162 ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, 103 ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
163 R.array.coupons_array, R.layout.spinner_item); 104 R.array.coupons_array, R.layout.spinner_item);
164 adapter.setDropDownViewResource(R.layout.spinner_dropdown_item_grey); 105 adapter.setDropDownViewResource(R.layout.spinner_dropdown_item_grey);
...@@ -170,8 +111,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -170,8 +111,6 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
170 adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item_sky_blue); 111 adapter2.setDropDownViewResource(R.layout.spinner_dropdown_item_sky_blue);
171 mRedemptionSpinner.setAdapter(adapter2); 112 mRedemptionSpinner.setAdapter(adapter2);
172 mRedemptionSpinner.setOnItemSelectedListener(this); 113 mRedemptionSpinner.setOnItemSelectedListener(this);
173 -
174 - mTvQuestionnaire.setOnClickListener(this);
175 } 114 }
176 115
177 // =========================================================== 116 // ===========================================================
......
1 +package ly.warp.sdk.activities;
2 +
3 +import android.app.Activity;
4 +import android.content.Intent;
5 +import android.os.Bundle;
6 +import android.view.View;
7 +import android.widget.ImageView;
8 +import android.widget.LinearLayout;
9 +import android.widget.TextView;
10 +
11 +import androidx.constraintlayout.widget.ConstraintLayout;
12 +
13 +import ly.warp.sdk.R;
14 +import ly.warp.sdk.io.models.Campaign;
15 +import ly.warp.sdk.io.models.CampaignList;
16 +import ly.warp.sdk.utils.WarplyManagerHelper;
17 +
18 +
19 +public class LoyaltyWallet extends Activity implements View.OnClickListener {
20 +
21 + // ===========================================================
22 + // Constants
23 + // ===========================================================
24 +
25 + // ===========================================================
26 + // Fields
27 + // ===========================================================
28 +
29 + private ImageView mIvBack;
30 + private TextView mTvUsername, mTvQuestionnaire, mTvActiveCoupons,
31 + mTvActiveRewards;
32 + private ConstraintLayout mClActiveCoupons, mClActiveRewards;
33 + private LinearLayout mLlAnalysisButton;
34 +
35 + // ===========================================================
36 + // Methods for/from SuperClass/Interfaces
37 + // ===========================================================
38 +
39 + @Override
40 + public void onCreate(Bundle savedInstanceState) {
41 + super.onCreate(savedInstanceState);
42 + setContentView(R.layout.activity_loyalty_wallet);
43 +
44 + mIvBack = findViewById(R.id.iv_back);
45 +// mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details);
46 + mTvUsername = findViewById(R.id.tv_name);
47 +// mTvQuestionnaire = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_questionnaire);
48 + mClActiveCoupons = findViewById(R.id.cl_loyalty_coupon);
49 + mTvActiveCoupons = findViewById(R.id.tv_active_coupons);
50 + mClActiveRewards = findViewById(R.id.cl_loyalty_rewards);
51 + mTvActiveRewards = findViewById(R.id.tv_active_rewards);
52 + mLlAnalysisButton = findViewById(R.id.ll_analysis);
53 +
54 + initViews();
55 + }
56 +
57 + @Override
58 + public void onResume() {
59 + super.onResume();
60 + }
61 +
62 + @Override
63 + public void onClick(View view) {
64 + if (view.getId() == R.id.iv_back) {
65 + onBackPressed();
66 + return;
67 + }
68 + if (view.getId() == R.id.ll_analysis) {
69 + Intent intent = new Intent(this, LoyaltyActivity.class);
70 + startActivity(intent);
71 + return;
72 + }
73 + if (view.getId() == R.id.tv_questionnaire) {
74 + CampaignList cl = WarplyManagerHelper.getUniqueCampaignList().get("more_for_you");
75 + Campaign camp = null;
76 + if (cl != null) {
77 + for (Campaign cn : cl) {
78 + if (cn.getSessionUUID().equals("4fc2865e32bd4d5495a3dfdf1472da7f")) {
79 + camp = cn;
80 + break;
81 + }
82 + }
83 + }
84 +
85 + if (camp == null)
86 + return;
87 +
88 + startActivity(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.constructCampaignUrl(camp)));
89 + return;
90 + }
91 + if (view.getId() == R.id.cl_loyalty_coupon) {
92 + Intent intent = new Intent(LoyaltyWallet.this, ActiveCouponsActivity.class);
93 + intent.putExtra("couponlist", WarplyManagerHelper.getCouponList());
94 + startActivity(intent);
95 + return;
96 + }
97 + if (view.getId() == R.id.cl_loyalty_rewards) {
98 +
99 + }
100 + }
101 +
102 + // ===========================================================
103 + // Methods
104 + // ===========================================================
105 +
106 + private void initViews() {
107 + if (WarplyManagerHelper.getConsumer() != null)
108 + mTvUsername.setText(String.format(getResources().getString(R.string.cos_profile_loyalty_name),
109 + WarplyManagerHelper.getConsumer().getFirstName(), WarplyManagerHelper.getConsumer().getLastName()));
110 +
111 + mIvBack.setOnClickListener(this);
112 +// mTvAnalysisButton.setOnClickListener(this);
113 +// mTvQuestionnaire.setOnClickListener(this);
114 + mTvActiveCoupons.setText(String.format(getResources().getString(R.string.cos_active_coupons), String.valueOf(WarplyManagerHelper.getCouponList().size())));
115 + mClActiveCoupons.setOnClickListener(this);
116 + //TODO: change the parameter, for testing purposes only
117 + mTvActiveRewards.setText(String.format(getResources().getString(R.string.cos_active_rewards), String.valueOf(WarplyManagerHelper.getCouponList().size())));
118 + mClActiveRewards.setOnClickListener(this);
119 + mLlAnalysisButton.setOnClickListener(this);
120 + }
121 +
122 + // ===========================================================
123 + // Inner and Anonymous Classes
124 + // ===========================================================
125 +
126 +}
...@@ -16,7 +16,7 @@ import androidx.recyclerview.widget.RecyclerView; ...@@ -16,7 +16,7 @@ import androidx.recyclerview.widget.RecyclerView;
16 16
17 import ly.warp.sdk.R; 17 import ly.warp.sdk.R;
18 import ly.warp.sdk.activities.GiftsForYouActivity; 18 import ly.warp.sdk.activities.GiftsForYouActivity;
19 -import ly.warp.sdk.activities.LoyaltyActivity; 19 +import ly.warp.sdk.activities.LoyaltyWallet;
20 import ly.warp.sdk.activities.MoreForYouActivity; 20 import ly.warp.sdk.activities.MoreForYouActivity;
21 import ly.warp.sdk.activities.WarpViewActivity; 21 import ly.warp.sdk.activities.WarpViewActivity;
22 import ly.warp.sdk.utils.WarplyManagerHelper; 22 import ly.warp.sdk.utils.WarplyManagerHelper;
...@@ -121,7 +121,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener { ...@@ -121,7 +121,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
121 @Override 121 @Override
122 public void onClick(View view) { 122 public void onClick(View view) {
123 if (view.getId() == R.id.cl_rewards_wallet) { 123 if (view.getId() == R.id.cl_rewards_wallet) {
124 - Intent intent = new Intent(getContext(), LoyaltyActivity.class); 124 + Intent intent = new Intent(getContext(), LoyaltyWallet.class);
125 startActivity(intent); 125 startActivity(intent);
126 return; 126 return;
127 } 127 }
......
...@@ -100,15 +100,15 @@ public class CouponsetsAdapter extends RecyclerView.Adapter<CouponsetsAdapter.Co ...@@ -100,15 +100,15 @@ public class CouponsetsAdapter extends RecyclerView.Adapter<CouponsetsAdapter.Co
100 holder.tvCouponTitle.setText(couponsetItem.getName()); 100 holder.tvCouponTitle.setText(couponsetItem.getName());
101 holder.tvCouponDescription.setText(Html.fromHtml(couponsetItem.getDescription())); 101 holder.tvCouponDescription.setText(Html.fromHtml(couponsetItem.getDescription()));
102 102
103 - String strCurrentDate = couponsetItem.getExpiration(); 103 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
104 - SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
105 Date newDate = new Date(); 104 Date newDate = new Date();
106 try { 105 try {
107 - newDate = format.parse(strCurrentDate); 106 + newDate = simpleDateFormat.parse(couponsetItem.getExpiration());
108 } catch (ParseException e) { 107 } catch (ParseException e) {
109 e.printStackTrace(); 108 e.printStackTrace();
110 } 109 }
111 - holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), format.format(newDate))); 110 + simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
111 + holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), simpleDateFormat.format(newDate != null ? newDate : "")));
112 112
113 holder.tvCouponValue.setText(couponsetItem.getDiscount()); 113 holder.tvCouponValue.setText(couponsetItem.getDiscount());
114 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponsetItem)); 114 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponsetItem));
......
...@@ -101,17 +101,17 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -101,17 +101,17 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
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 103
104 - String strCurrentDate = couponItem.getExpiration(); 104 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
105 - SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
106 Date newDate = new Date(); 105 Date newDate = new Date();
107 try { 106 try {
108 - newDate = format.parse(strCurrentDate); 107 + newDate = simpleDateFormat.parse(couponItem.getExpiration());
109 } catch (ParseException e) { 108 } catch (ParseException e) {
110 e.printStackTrace(); 109 e.printStackTrace();
111 } 110 }
112 - holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), format.format(newDate))); 111 + simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
112 + holder.tvCouponDate.setText(String.format(mContext.getString(R.string.cos_coupon_date), simpleDateFormat.format(newDate != null ? newDate : "")));
113 113
114 - holder.tvCouponValue.setText(couponItem.getDiscount()); 114 + holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
115 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); 115 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
116 } 116 }
117 } 117 }
......
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
3 <item> 3 <item>
4 <shape android:shape="rectangle"> 4 <shape android:shape="rectangle">
5 <gradient 5 <gradient
6 - android:angle="90" 6 + android:angle="180"
7 - android:endColor="#C4F187" 7 + android:endColor="@color/cos_cyan2"
8 - android:startColor="#8EF593" /> 8 + android:startColor="@color/cos_green7" />
9 -
10 </shape> 9 </shape>
11 </item> 10 </item>
12 11
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
3 + <item android:drawable="@drawable/shape_cos_grey2_tr" android:state_pressed="true" />
4 + <item android:drawable="@drawable/shape_cos_grey2" android:state_pressed="false" />
5 +</selector>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
3 + android:shape="rectangle">
4 + <corners android:radius="7dp" />
5 +
6 + <solid
7 + android:width="2dp"
8 + android:color="@color/cos_grey2" />
9 +</shape>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
3 + android:shape="rectangle">
4 + <corners android:radius="7dp" />
5 +
6 + <solid
7 + android:width="2dp"
8 + android:color="@color/cos_grey2_tr" />
9 +</shape>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
3 + android:shape="rectangle">
4 + <corners android:radius="11dp" />
5 +
6 + <solid
7 + android:color="@color/grey_tr3" />
8 +</shape>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
3 + android:shape="rectangle">
4 + <corners android:radius="4dp" />
5 +
6 + <solid android:color="@android:color/white" />
7 +</shape>
...\ No newline at end of file ...\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 xmlns:app="http://schemas.android.com/apk/res-auto" 2 xmlns:app="http://schemas.android.com/apk/res-auto"
3 android:layout_width="match_parent" 3 android:layout_width="match_parent"
4 android:layout_height="match_parent" 4 android:layout_height="match_parent"
5 - android:background="#F3F3F3"> 5 + android:background="@color/grey4">
6 6
7 <androidx.constraintlayout.widget.ConstraintLayout 7 <androidx.constraintlayout.widget.ConstraintLayout
8 android:id="@+id/cl_loyalty_wallet_header" 8 android:id="@+id/cl_loyalty_wallet_header"
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
23 <TextView 23 <TextView
24 android:layout_width="wrap_content" 24 android:layout_width="wrap_content"
25 android:layout_height="wrap_content" 25 android:layout_height="wrap_content"
26 - android:text="@string/cos_profile_title" 26 + android:text="@string/cos_analysis"
27 android:textColor="@color/grey" 27 android:textColor="@color/grey"
28 android:textSize="17sp" 28 android:textSize="17sp"
29 android:textStyle="bold" 29 android:textStyle="bold"
...@@ -37,86 +37,43 @@ ...@@ -37,86 +37,43 @@
37 android:layout_width="match_parent" 37 android:layout_width="match_parent"
38 android:layout_height="match_parent" 38 android:layout_height="match_parent"
39 android:layout_below="@+id/cl_loyalty_wallet_header" 39 android:layout_below="@+id/cl_loyalty_wallet_header"
40 - android:background="#F3F3F3"> 40 + android:background="@color/grey4">
41 41
42 - <androidx.constraintlayout.widget.ConstraintLayout 42 + <RelativeLayout
43 android:layout_width="match_parent" 43 android:layout_width="match_parent"
44 android:layout_height="wrap_content" 44 android:layout_height="wrap_content"
45 - android:background="@android:color/white" 45 + android:background="@android:color/white">
46 - android:paddingTop="48dp"> 46 +
47 + <include
48 + android:id="@+id/cl_tab_analysis"
49 + layout="@layout/tab_analysis"
50 + android:layout_width="match_parent"
51 + android:layout_height="wrap_content"
52 + android:layout_marginHorizontal="48dp"
53 + android:layout_marginVertical="24dp" />
47 54
48 <androidx.constraintlayout.widget.ConstraintLayout 55 <androidx.constraintlayout.widget.ConstraintLayout
49 android:id="@+id/cl_loyalty_info_view_inner" 56 android:id="@+id/cl_loyalty_info_view_inner"
50 android:layout_width="match_parent" 57 android:layout_width="match_parent"
51 android:layout_height="match_parent" 58 android:layout_height="match_parent"
59 + android:layout_below="@+id/cl_tab_analysis"
52 android:background="@drawable/shape_cos_loyalty" 60 android:background="@drawable/shape_cos_loyalty"
53 - android:paddingBottom="48dp" 61 + android:paddingBottom="24dp"
54 app:layout_constraintBottom_toBottomOf="parent" 62 app:layout_constraintBottom_toBottomOf="parent"
55 app:layout_constraintEnd_toEndOf="parent" 63 app:layout_constraintEnd_toEndOf="parent"
56 app:layout_constraintStart_toStartOf="parent" 64 app:layout_constraintStart_toStartOf="parent"
57 app:layout_constraintTop_toTopOf="parent"> 65 app:layout_constraintTop_toTopOf="parent">
58 66
59 <include 67 <include
60 - android:id="@+id/rl_coupons_row"
61 - layout="@layout/loyalty_coupons"
62 - android:layout_width="match_parent"
63 - android:layout_height="wrap_content"
64 - android:layout_marginTop="110dp"
65 - app:layout_constraintEnd_toEndOf="parent"
66 - app:layout_constraintStart_toStartOf="parent"
67 - app:layout_constraintTop_toTopOf="parent" />
68 -
69 - <include
70 - android:id="@+id/rl_gifts_row"
71 - layout="@layout/loyalty_gifts"
72 - android:layout_width="match_parent"
73 - android:layout_height="wrap_content"
74 - android:layout_marginTop="32dp"
75 - app:layout_constraintEnd_toEndOf="parent"
76 - app:layout_constraintStart_toStartOf="parent"
77 - app:layout_constraintTop_toBottomOf="@+id/rl_coupons_row" />
78 -
79 - <include
80 android:id="@+id/rl_analysis_row" 68 android:id="@+id/rl_analysis_row"
81 layout="@layout/loyalty_analysis_container" 69 layout="@layout/loyalty_analysis_container"
82 android:layout_width="match_parent" 70 android:layout_width="match_parent"
83 android:layout_height="wrap_content" 71 android:layout_height="wrap_content"
84 - android:layout_marginTop="48dp" 72 + android:layout_marginTop="24dp"
85 - app:layout_constraintEnd_toEndOf="parent"
86 - app:layout_constraintStart_toStartOf="parent"
87 - app:layout_constraintTop_toBottomOf="@+id/rl_gifts_row" />
88 -
89 - <include
90 - android:id="@+id/rl_burnt_coupons_row"
91 - layout="@layout/loyalty_burnt_coupons"
92 - android:layout_width="match_parent"
93 - android:layout_height="wrap_content"
94 - android:layout_marginTop="48dp"
95 app:layout_constraintEnd_toEndOf="parent" 73 app:layout_constraintEnd_toEndOf="parent"
96 app:layout_constraintStart_toStartOf="parent" 74 app:layout_constraintStart_toStartOf="parent"
97 - app:layout_constraintTop_toBottomOf="@+id/rl_analysis_row" /> 75 + app:layout_constraintTop_toTopOf="parent" />
98 -
99 - <include
100 - android:id="@+id/rl_redeemed_gifts_row"
101 - layout="@layout/loyalty_redeemed_gifts"
102 - android:layout_width="match_parent"
103 - android:layout_height="wrap_content"
104 - android:layout_marginTop="32dp"
105 - app:layout_constraintEnd_toEndOf="parent"
106 - app:layout_constraintStart_toStartOf="parent"
107 - app:layout_constraintTop_toBottomOf="@+id/rl_burnt_coupons_row" />
108 </androidx.constraintlayout.widget.ConstraintLayout> 76 </androidx.constraintlayout.widget.ConstraintLayout>
109 - 77 + </RelativeLayout>
110 - <include
111 - android:id="@+id/cl_loyalty_info_banner"
112 - layout="@layout/loyalty_banner"
113 - android:layout_width="match_parent"
114 - android:layout_height="160dp"
115 - android:layout_marginHorizontal="32dp"
116 - app:layout_constraintBottom_toTopOf="@+id/cl_loyalty_info_view_inner"
117 - app:layout_constraintEnd_toEndOf="parent"
118 - app:layout_constraintStart_toStartOf="parent"
119 - app:layout_constraintTop_toTopOf="@+id/cl_loyalty_info_view_inner" />
120 - </androidx.constraintlayout.widget.ConstraintLayout>
121 </ScrollView> 78 </ScrollView>
122 </RelativeLayout> 79 </RelativeLayout>
......
1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 - xmlns:app="http://schemas.android.com/apk/res-auto"
3 android:layout_width="match_parent" 2 android:layout_width="match_parent"
4 android:layout_height="wrap_content"> 3 android:layout_height="wrap_content">
5 4
6 - <TextView
7 - android:id="@+id/tv_analysis_loyalty_title"
8 - android:layout_width="wrap_content"
9 - android:layout_height="wrap_content"
10 - android:layout_marginStart="10dp"
11 - android:text="Ανάλυση"
12 - android:textColor="@color/grey"
13 - android:textSize="18sp"
14 - android:textStyle="bold" />
15 -
16 <RelativeLayout 5 <RelativeLayout
17 android:layout_width="match_parent" 6 android:layout_width="match_parent"
18 android:layout_height="wrap_content" 7 android:layout_height="wrap_content"
19 - android:layout_below="@+id/tv_analysis_loyalty_title"
20 android:layout_marginHorizontal="16dp" 8 android:layout_marginHorizontal="16dp"
21 - android:layout_marginTop="24dp"
22 android:background="@drawable/shape_cos_white" 9 android:background="@drawable/shape_cos_white"
23 android:paddingHorizontal="16dp" 10 android:paddingHorizontal="16dp"
24 android:paddingVertical="24dp"> 11 android:paddingVertical="24dp">
...@@ -35,18 +22,19 @@ ...@@ -35,18 +22,19 @@
35 android:spinnerMode="dropdown" /> 22 android:spinnerMode="dropdown" />
36 23
37 <include 24 <include
38 - android:id="@+id/cl_tab_analysis" 25 + android:id="@+id/cl_chart"
39 - layout="@layout/tab_analysis" 26 + layout="@layout/cos_piechart_conditional_render"
40 - android:layout_width="match_parent" 27 + android:layout_width="200dp"
41 - android:layout_height="wrap_content" 28 + android:layout_height="200dp"
42 android:layout_below="@+id/sp_coupons" 29 android:layout_below="@+id/sp_coupons"
30 + android:layout_centerHorizontal="true"
43 android:layout_marginTop="32dp" /> 31 android:layout_marginTop="32dp" />
44 32
45 <Spinner 33 <Spinner
46 android:id="@+id/sp_redemption" 34 android:id="@+id/sp_redemption"
47 android:layout_width="match_parent" 35 android:layout_width="match_parent"
48 android:layout_height="60dp" 36 android:layout_height="60dp"
49 - android:layout_below="@+id/cl_tab_analysis" 37 + android:layout_below="@+id/cl_chart"
50 android:layout_centerHorizontal="true" 38 android:layout_centerHorizontal="true"
51 android:layout_marginTop="32dp" 39 android:layout_marginTop="32dp"
52 android:background="@drawable/shape_cos_sky_blue" 40 android:background="@drawable/shape_cos_sky_blue"
...@@ -55,30 +43,12 @@ ...@@ -55,30 +43,12 @@
55 android:popupElevation="1dp" 43 android:popupElevation="1dp"
56 android:spinnerMode="dropdown" /> 44 android:spinnerMode="dropdown" />
57 45
58 - <androidx.constraintlayout.widget.ConstraintLayout 46 + <include
47 + android:id="@+id/cl_chart_info"
48 + layout="@layout/cos_analysis"
59 android:layout_width="match_parent" 49 android:layout_width="match_parent"
60 android:layout_height="wrap_content" 50 android:layout_height="wrap_content"
61 android:layout_below="@+id/sp_redemption" 51 android:layout_below="@+id/sp_redemption"
62 - android:layout_marginTop="32dp"> 52 + android:layout_marginTop="32dp" />
63 -
64 - <include
65 - android:id="@+id/cl_chart"
66 - layout="@layout/cos_piechart_conditional_render"
67 - android:layout_width="200dp"
68 - android:layout_height="200dp"
69 - app:layout_constraintEnd_toEndOf="parent"
70 - app:layout_constraintStart_toStartOf="parent"
71 - app:layout_constraintTop_toTopOf="parent" />
72 -
73 - <include
74 - android:id="@+id/cl_chart_info"
75 - layout="@layout/cos_analysis"
76 - android:layout_width="match_parent"
77 - android:layout_height="wrap_content"
78 - android:layout_marginTop="32dp"
79 - app:layout_constraintEnd_toEndOf="@+id/cl_chart"
80 - app:layout_constraintStart_toStartOf="parent"
81 - app:layout_constraintTop_toBottomOf="@+id/cl_chart" />
82 - </androidx.constraintlayout.widget.ConstraintLayout>
83 </RelativeLayout> 53 </RelativeLayout>
84 </RelativeLayout> 54 </RelativeLayout>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
9 android:layout_width="wrap_content" 9 android:layout_width="wrap_content"
10 android:layout_height="wrap_content" 10 android:layout_height="wrap_content"
11 android:background="@drawable/bottom_border_gradient" 11 android:background="@drawable/bottom_border_gradient"
12 - android:text="ΜΗΝΙΑΙΑ" 12 + android:text="@string/cos_monthly"
13 - android:textColor="@color/grey" 13 + android:textColor="@color/cos_cyan3"
14 android:textSize="18sp" 14 android:textSize="18sp"
15 android:textStyle="bold" 15 android:textStyle="bold"
16 app:layout_constraintBottom_toBottomOf="parent" 16 app:layout_constraintBottom_toBottomOf="parent"
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
23 android:layout_width="wrap_content" 23 android:layout_width="wrap_content"
24 android:layout_height="wrap_content" 24 android:layout_height="wrap_content"
25 android:background="@drawable/bottom_border_transparent" 25 android:background="@drawable/bottom_border_transparent"
26 - android:text="6ΜΗΝΟ" 26 + android:text="@string/cos_six_months"
27 android:textColor="@color/grey" 27 android:textColor="@color/grey"
28 android:textSize="18sp" 28 android:textSize="18sp"
29 android:textStyle="bold" 29 android:textStyle="bold"
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
37 android:layout_width="wrap_content" 37 android:layout_width="wrap_content"
38 android:layout_height="wrap_content" 38 android:layout_height="wrap_content"
39 android:background="@drawable/bottom_border_transparent" 39 android:background="@drawable/bottom_border_transparent"
40 - android:text="12ΜΗΝΟ" 40 + android:text="@string/cos_annual"
41 android:textColor="@color/grey" 41 android:textColor="@color/grey"
42 android:textSize="18sp" 42 android:textSize="18sp"
43 android:textStyle="bold" 43 android:textStyle="bold"
......
...@@ -27,4 +27,14 @@ ...@@ -27,4 +27,14 @@
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 <color name="blue_dark">#3A5266</color>
30 + <color name="white_tr4">#A1FFFFFF</color>
31 + <color name="cos_green6">#509E2F</color>
32 + <color name="cos_grey2">#E6E6E6</color>
33 + <color name="cos_grey2_tr">#66E6E6E6</color>
34 + <color name="cos_grey3">#84929E</color>
35 + <color name="cos_cyan2">#6DBCC0</color>
36 + <color name="cos_green7">#B2CF81</color>
37 + <color name="cos_cyan3">#2EB2B9</color>
38 + <color name="grey4">#F3F3F3</color>
39 + <color name="grey_tr3">#7DF2F2F2</color>
30 </resources> 40 </resources>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -41,6 +41,19 @@ ...@@ -41,6 +41,19 @@
41 <string name="cos_dlg_error_subtitle">Κάτι πήγε στραβά</string> 41 <string name="cos_dlg_error_subtitle">Κάτι πήγε στραβά</string>
42 <string name="cos_dlg_error_subtitle_non_buyable">Το κουπόνι δεν είναι διαθέσιμο για αγορά</string> 42 <string name="cos_dlg_error_subtitle_non_buyable">Το κουπόνι δεν είναι διαθέσιμο για αγορά</string>
43 <string name="cos_dlg_error_subtitle_no_points">Δεν έχεις αρκετούς πόντους</string> 43 <string name="cos_dlg_error_subtitle_no_points">Δεν έχεις αρκετούς πόντους</string>
44 + <string name="cos_loyalty_coupons">My coupons</string>
45 + <string name="cos_loyalty_old_coupons">Παλαιότερα κουπόνια</string>
46 + <string name="cos_loyalty_rewards">My rewards</string>
47 + <string name="cos_loyalty_old_rewards">Παλαιότερα δώρα</string>
48 + <string name="cos_see_all">Δες τα όλα -></string>
49 + <string name="cos_active_rewards">Έχεις %1$s ενεργά\nδώρα</string>
50 + <string name="cos_analysis">Ανάλυση</string>
51 + <string name="cos_active_deals">Ενεργός κωδικός:</string>
52 + <string name="cos_monthly">Μηνιαία</string>
53 + <string name="cos_six_months">6Μηνο</string>
54 + <string name="cos_annual">12Μηνο</string>
55 + <string name="cos_analysis2">Αναλυτικά</string>
56 + <string name="euro"></string>
44 57
45 <string-array name="coupons_array"> 58 <string-array name="coupons_array">
46 <item>Κουπόνια</item> 59 <item>Κουπόνια</item>
......