Panagiotis Triantafyllou

redesign part5

Showing 23 changed files with 602 additions and 173 deletions
...@@ -57,6 +57,12 @@ ...@@ -57,6 +57,12 @@
57 android:theme="@style/SDKAppTheme" /> 57 android:theme="@style/SDKAppTheme" />
58 58
59 <activity 59 <activity
60 + android:name=".activities.CouponsActivity"
61 + android:exported="false"
62 + android:screenOrientation="portrait"
63 + android:theme="@style/SDKAppTheme" />
64 +
65 + <activity
60 android:name=".dexter.PermissionsActivity" 66 android:name=".dexter.PermissionsActivity"
61 android:exported="false" 67 android:exported="false"
62 android:launchMode="singleInstance" 68 android:launchMode="singleInstance"
...@@ -66,7 +72,7 @@ ...@@ -66,7 +72,7 @@
66 <activity 72 <activity
67 android:name=".activities.BaseFragmentActivity" 73 android:name=".activities.BaseFragmentActivity"
68 android:exported="true" 74 android:exported="true"
69 - android:screenOrientation="portrait" /> 75 + android:screenOrientation="portrait"/>
70 76
71 <!-- Service used for updating user's location. --> 77 <!-- Service used for updating user's location. -->
72 <service 78 <service
......
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.os.Parcelable;
7 +import android.util.TypedValue;
8 +import android.view.View;
9 +import android.widget.ImageView;
10 +import android.widget.LinearLayout;
11 +import android.widget.TextView;
12 +
13 +import androidx.recyclerview.widget.LinearLayoutManager;
14 +import androidx.recyclerview.widget.RecyclerView;
15 +
16 +import ly.warp.sdk.R;
17 +import ly.warp.sdk.io.adapters.CouponAdapter;
18 +import ly.warp.sdk.io.models.Coupon;
19 +import ly.warp.sdk.utils.WarpUtils;
20 +import ly.warp.sdk.utils.WarplyManagerHelper;
21 +import ly.warp.sdk.views.VerticalSpaceItemDecoration;
22 +
23 +public class CouponsActivity extends Activity implements View.OnClickListener,
24 + CouponAdapter.OnCouponClickListener {
25 + // ===========================================================
26 + // Constants
27 + // ===========================================================
28 +
29 +
30 + // ===========================================================
31 + // Fields
32 + // ===========================================================
33 +
34 + private ImageView mIvBack;
35 + private LinearLayout mLlFilterActive, mLlFilterExpired;
36 + private RecyclerView mRvCoupons;
37 + private CouponAdapter mCouponsAdapter;
38 + private TextView mBtnFilterActive, mBtnFilterExpired, mTvHeaderTitle;
39 +
40 + // ===========================================================
41 + // Methods for/from SuperClass/Interfaces
42 + // ===========================================================
43 +
44 + @Override
45 + public void onCreate(Bundle savedInstanceState) {
46 + super.onCreate(savedInstanceState);
47 + setContentView(R.layout.activity_coupons);
48 +
49 + initViews();
50 +
51 + WarpUtils.applyEdgeToEdge(this,
52 + findViewById(R.id.header_layout),
53 + null);
54 +
55 + setupMyCouponsSection();
56 + }
57 +
58 + @Override
59 + public void onResume() {
60 + super.onResume();
61 + }
62 +
63 + @Override
64 + public void onClick(View v) {
65 + int id = v.getId();
66 + if (id == R.id.iv_back) {
67 + onBackPressed();
68 + } else if (id == R.id.ll_filter_active) {
69 +// filterCoupons(CouponItem.STATUS_ACTIVE);
70 + } else if (id == R.id.ll_filter_redeemed) {
71 +// filterCoupons(CouponItem.STATUS_REDEEMED);
72 + }
73 + }
74 +
75 + @Override
76 + public void onCouponClick(Coupon couponItem, int position) {
77 + Intent myIntent = new Intent(CouponsActivity.this, SingleCouponActivity.class);
78 + myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, (Parcelable) couponItem);
79 + startActivity(myIntent);
80 + }
81 +
82 + @Override
83 + public void onFavoriteClick(Coupon couponItem, int position) {
84 + // Handle favorite click if needed
85 + }
86 +
87 + // ===========================================================
88 + // Methods
89 + // ===========================================================
90 +
91 + private void initViews() {
92 + mIvBack = findViewById(R.id.iv_back);
93 + mIvBack.setOnClickListener(this);
94 +
95 + // Initialize My Coupons section
96 + mRvCoupons = findViewById(R.id.rv_coupons);
97 + mLlFilterActive = findViewById(R.id.ll_filter_active);
98 + mBtnFilterActive = findViewById(R.id.btn_filter_active);
99 + mLlFilterExpired = findViewById(R.id.ll_filter_redeemed);
100 + mBtnFilterExpired = findViewById(R.id.btn_filter_redeemed);
101 + mTvHeaderTitle = findViewById(R.id.tv_header_title);
102 + // Set click listeners for filter buttons
103 + mLlFilterActive.setOnClickListener(this);
104 + mLlFilterExpired.setOnClickListener(this);
105 +
106 + WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle,
107 + mBtnFilterActive, mBtnFilterExpired);
108 + }
109 +
110 + private void setupMyCouponsSection() {
111 + LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
112 + mRvCoupons.setLayoutManager(layoutManager);
113 + mRvCoupons.setHasFixedSize(true);
114 +
115 + mCouponsAdapter = new CouponAdapter(this, WarplyManagerHelper.getCoupons());
116 + mCouponsAdapter.setOnCouponClickListener(this);
117 + mRvCoupons.setAdapter(mCouponsAdapter);
118 +
119 + int verticalSpacingInPixels = (int) TypedValue.applyDimension(
120 + TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics());
121 + mRvCoupons.addItemDecoration(new VerticalSpaceItemDecoration(verticalSpacingInPixels));
122 +
123 +// filterCoupons(CouponItem.STATUS_ACTIVE);
124 + }
125 +
126 + private void filterCoupons(String status) {
127 + // Reset all filter button styles
128 +// mBtnFilterActive.setBackgroundResource(R.drawable.shape_transparent_black_border);
129 +// mBtnFilterActive.setTextColor(getResources().getColor(R.color.custom_black2));
130 +
131 +// mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_transparent_black_border);
132 +// mBtnFilterRedeemed.setTextColor(getResources().getColor(R.color.custom_black2));
133 +
134 + // Set selected filter button style
135 +// if (CouponItem.STATUS_ACTIVE.equals(status)) {
136 +// mBtnFilterActive.setBackgroundResource(R.drawable.shape_rectangle_rounded_black);
137 +// mBtnFilterActive.setTextColor(Color.WHITE);
138 +// } else if (CouponItem.STATUS_REDEEMED.equals(status)) {
139 +// mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_rectangle_rounded_black);
140 +// mBtnFilterRedeemed.setTextColor(Color.WHITE);
141 +// }
142 +
143 + // Apply filter to adapter
144 +// mCouponsAdapter.filterByStatus(status);
145 + }
146 +
147 + // ===========================================================
148 + // Inner and Anonymous Classes
149 + // ===========================================================
150 +
151 +}
...@@ -31,6 +31,7 @@ import ly.warp.sdk.io.adapters.BannerAdapter; ...@@ -31,6 +31,7 @@ import ly.warp.sdk.io.adapters.BannerAdapter;
31 import ly.warp.sdk.io.adapters.CouponsetAdapter; 31 import ly.warp.sdk.io.adapters.CouponsetAdapter;
32 import ly.warp.sdk.io.callbacks.CallbackReceiver; 32 import ly.warp.sdk.io.callbacks.CallbackReceiver;
33 import ly.warp.sdk.io.models.BannerItem; 33 import ly.warp.sdk.io.models.BannerItem;
34 +import ly.warp.sdk.io.models.Coupon;
34 import ly.warp.sdk.io.models.Couponset; 35 import ly.warp.sdk.io.models.Couponset;
35 import ly.warp.sdk.io.models.User; 36 import ly.warp.sdk.io.models.User;
36 import ly.warp.sdk.utils.WarpUtils; 37 import ly.warp.sdk.utils.WarpUtils;
...@@ -51,8 +52,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -51,8 +52,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
51 // =========================================================== 52 // ===========================================================
52 53
53 private RelativeLayout mPbLoading; 54 private RelativeLayout mPbLoading;
54 - private TextView mTvHeaderTitle; 55 + private TextView mTvHeaderTitle, mTvMyCouponsTitle, mTvMyCouponsValue;
55 - private LinearLayout mLlUserTags; 56 + private LinearLayout mLlUserTags, mLlMyCoupons;
56 /* View Pager */ 57 /* View Pager */
57 // private ViewPager2 mBannerViewPager; 58 // private ViewPager2 mBannerViewPager;
58 private RecyclerView mRvBannerViewPager; 59 private RecyclerView mRvBannerViewPager;
...@@ -84,6 +85,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -84,6 +85,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
84 85
85 mPbLoading.setVisibility(View.VISIBLE); 86 mPbLoading.setVisibility(View.VISIBLE);
86 mSectionsLoading.setVisibility(View.VISIBLE); 87 mSectionsLoading.setVisibility(View.VISIBLE);
88 +
89 + WarplyManager.getCoupons(mCouponsCallback);
87 WarplyManager.getCampaigns(mCampaignsCallback); 90 WarplyManager.getCampaigns(mCampaignsCallback);
88 WarplyManager.getCouponsets(mCouponsetsCallback); 91 WarplyManager.getCouponsets(mCouponsetsCallback);
89 } 92 }
...@@ -96,7 +99,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -96,7 +99,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
96 @Override 99 @Override
97 public void onClick(View v) { 100 public void onClick(View v) {
98 if (v.getId() == R.id.profile_icon) { 101 if (v.getId() == R.id.profile_icon) {
99 - Intent myIntent = new Intent(HomeActivity.this, ProfileActivity.class); 102 +// Intent myIntent = new Intent(HomeActivity.this, ProfileActivity.class);
103 +// startActivity(myIntent);
104 + return;
105 + }
106 + if (v.getId() == R.id.ll_my_coupons) {
107 + Intent myIntent = new Intent(HomeActivity.this, CouponsActivity.class);
100 startActivity(myIntent); 108 startActivity(myIntent);
101 } 109 }
102 } 110 }
...@@ -115,18 +123,21 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -115,18 +123,21 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
115 private void initViews() { 123 private void initViews() {
116 mPbLoading = findViewById(R.id.pb_loading); 124 mPbLoading = findViewById(R.id.pb_loading);
117 mPbLoading.setOnTouchListener((v, event) -> true); 125 mPbLoading.setOnTouchListener((v, event) -> true);
118 - 126 + mLlMyCoupons = findViewById(R.id.ll_my_coupons);
127 + mLlMyCoupons.setOnClickListener(this);
119 mViewPager = findViewById(R.id.cl_viewpager); 128 mViewPager = findViewById(R.id.cl_viewpager);
120 mSectionsContainer = findViewById(R.id.ll_sections_container); 129 mSectionsContainer = findViewById(R.id.ll_sections_container);
121 mSectionsLoading = findViewById(R.id.rl_sections_loading); 130 mSectionsLoading = findViewById(R.id.rl_sections_loading);
122 - 131 + mTvMyCouponsTitle = findViewById(R.id.tv_my_coupons_title);
132 + mTvMyCouponsValue = findViewById(R.id.tv_my_coupons_value);
123 mIvProfile = findViewById(R.id.profile_icon); 133 mIvProfile = findViewById(R.id.profile_icon);
124 mIvProfile.setOnClickListener(this); 134 mIvProfile.setOnClickListener(this);
125 mTvHeaderTitle = findViewById(R.id.tv_header_title); 135 mTvHeaderTitle = findViewById(R.id.tv_header_title);
126 mLlUserTags = findViewById(R.id.ll_user_tags); 136 mLlUserTags = findViewById(R.id.ll_user_tags);
127 mRvBannerViewPager = findViewById(R.id.banner_viewpager); 137 mRvBannerViewPager = findViewById(R.id.banner_viewpager);
128 138
129 - WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle); 139 + WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle, mTvMyCouponsValue);
140 + WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, mTvMyCouponsTitle);
130 } 141 }
131 142
132 private void setUpUser() { 143 private void setUpUser() {
...@@ -270,7 +281,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -270,7 +281,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
270 LayoutInflater inflater = LayoutInflater.from(this); 281 LayoutInflater inflater = LayoutInflater.from(this);
271 int spacingInPixels = (int) TypedValue.applyDimension( 282 int spacingInPixels = (int) TypedValue.applyDimension(
272 TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); 283 TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
284 + int sectionMarginTopPx = (int) TypedValue.applyDimension(
285 + TypedValue.COMPLEX_UNIT_DIP, 40, getResources().getDisplayMetrics());
273 286
287 +// int sectionIndex = 0;
274 for (Map.Entry<String, ArrayList<Couponset>> entry : categorizedMap.entrySet()) { 288 for (Map.Entry<String, ArrayList<Couponset>> entry : categorizedMap.entrySet()) {
275 String categoryName = entry.getKey(); 289 String categoryName = entry.getKey();
276 ArrayList<Couponset> couponsets = entry.getValue(); 290 ArrayList<Couponset> couponsets = entry.getValue();
...@@ -281,6 +295,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -281,6 +295,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
281 295
282 View sectionView = inflater.inflate(R.layout.item_couponset_section, mSectionsContainer, false); 296 View sectionView = inflater.inflate(R.layout.item_couponset_section, mSectionsContainer, false);
283 297
298 +// if (sectionIndex > 0) {
299 + LinearLayout.LayoutParams sectionParams = (LinearLayout.LayoutParams) sectionView.getLayoutParams();
300 + sectionParams.topMargin = sectionMarginTopPx;
301 + sectionView.setLayoutParams(sectionParams);
302 +// }
303 +
284 TextView tvTitle = sectionView.findViewById(R.id.tv_section_title); 304 TextView tvTitle = sectionView.findViewById(R.id.tv_section_title);
285 String titleText = categoryName + " (" + couponsets.size() + ")"; 305 String titleText = categoryName + " (" + couponsets.size() + ")";
286 tvTitle.setText(titleText); 306 tvTitle.setText(titleText);
...@@ -304,6 +324,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -304,6 +324,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
304 rvSection.setAdapter(adapter); 324 rvSection.setAdapter(adapter);
305 325
306 mSectionsContainer.addView(sectionView); 326 mSectionsContainer.addView(sectionView);
327 +// sectionIndex++;
307 } 328 }
308 mSectionsLoading.setVisibility(View.GONE); 329 mSectionsLoading.setVisibility(View.GONE);
309 } 330 }
...@@ -362,4 +383,16 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -362,4 +383,16 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
362 mSectionsLoading.setVisibility(View.GONE); 383 mSectionsLoading.setVisibility(View.GONE);
363 } 384 }
364 }; 385 };
386 +
387 + private final CallbackReceiver<ArrayList<Coupon>> mCouponsCallback = new CallbackReceiver<ArrayList<Coupon>>() {
388 + @Override
389 + public void onSuccess(ArrayList<Coupon> result) {
390 + mTvMyCouponsValue.setText(String.valueOf(result.size()));
391 + }
392 +
393 + @Override
394 + public void onFailure(int errorCode) {
395 +
396 + }
397 + };
365 } 398 }
......
...@@ -141,9 +141,6 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen ...@@ -141,9 +141,6 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen
141 if (mOfferItem.getExpiration() != null && !mOfferItem.getExpiration().isEmpty()) { 141 if (mOfferItem.getExpiration() != null && !mOfferItem.getExpiration().isEmpty()) {
142 String formattedDate = formatValidityDate(mOfferItem.getExpiration()); 142 String formattedDate = formatValidityDate(mOfferItem.getExpiration());
143 mTvEndDate.setText(getString(R.string.demo_valid_until, formattedDate)); 143 mTvEndDate.setText(getString(R.string.demo_valid_until, formattedDate));
144 - mTvEndDate.setVisibility(View.VISIBLE);
145 - } else {
146 - mTvEndDate.setVisibility(View.GONE);
147 } 144 }
148 145
149 if (mOfferItem.getCouponsetDetails() != null && mOfferItem.getCouponsetDetails().getImg_preview() != null && !TextUtils.isEmpty(mOfferItem.getCouponsetDetails().getImg_preview())) { 146 if (mOfferItem.getCouponsetDetails() != null && mOfferItem.getCouponsetDetails().getImg_preview() != null && !TextUtils.isEmpty(mOfferItem.getCouponsetDetails().getImg_preview())) {
......
...@@ -154,9 +154,6 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis ...@@ -154,9 +154,6 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
154 if (mOfferItem.getEndDate() != null && !mOfferItem.getEndDate().isEmpty()) { 154 if (mOfferItem.getEndDate() != null && !mOfferItem.getEndDate().isEmpty()) {
155 String formattedDate = formatValidityDate(mOfferItem.getEndDate()); 155 String formattedDate = formatValidityDate(mOfferItem.getEndDate());
156 mTvEndDate.setText(getString(R.string.demo_valid_until, formattedDate)); 156 mTvEndDate.setText(getString(R.string.demo_valid_until, formattedDate));
157 - mTvEndDate.setVisibility(View.VISIBLE);
158 - } else {
159 - mTvEndDate.setVisibility(View.GONE);
160 } 157 }
161 158
162 if (!TextUtils.isEmpty(mOfferItem.getImg_preview())) { 159 if (!TextUtils.isEmpty(mOfferItem.getImg_preview())) {
......
...@@ -112,26 +112,23 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView ...@@ -112,26 +112,23 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
112 * ViewHolder for coupon items 112 * ViewHolder for coupon items
113 */ 113 */
114 class CouponViewHolder extends RecyclerView.ViewHolder { 114 class CouponViewHolder extends RecyclerView.ViewHolder {
115 - private final ImageView ivOfferImage;
116 - private final ImageView ivFavorite;
117 private final ImageView ivLogo; 115 private final ImageView ivLogo;
118 - private final TextView tvPrice; 116 + private final TextView tvMerchant;
119 private final TextView tvTitle; 117 private final TextView tvTitle;
120 private final TextView tvDescription; 118 private final TextView tvDescription;
121 - private final TextView tvValidity; 119 + private final TextView tvEndDate;
122 120
123 CouponViewHolder(@NonNull View itemView) { 121 CouponViewHolder(@NonNull View itemView) {
124 super(itemView); 122 super(itemView);
125 - ivOfferImage = itemView.findViewById(R.id.iv_offer_image);
126 - ivFavorite = itemView.findViewById(R.id.iv_favorite);
127 ivLogo = itemView.findViewById(R.id.iv_logo); 123 ivLogo = itemView.findViewById(R.id.iv_logo);
128 - tvPrice = itemView.findViewById(R.id.tv_price); 124 + tvMerchant = itemView.findViewById(R.id.tv_merchant);
129 tvTitle = itemView.findViewById(R.id.tv_title); 125 tvTitle = itemView.findViewById(R.id.tv_title);
130 tvDescription = itemView.findViewById(R.id.tv_description); 126 tvDescription = itemView.findViewById(R.id.tv_description);
131 - tvValidity = itemView.findViewById(R.id.tv_validity); 127 + tvEndDate = itemView.findViewById(R.id.tv_coupon_end_date);
132 128
133 - WarpUtils.renderCustomFont(context, R.font.ping_lcg_bold, tvPrice, tvTitle); 129 + WarpUtils.renderCustomFont(context, R.font.ping_lcg_bold, tvTitle,
134 - WarpUtils.renderCustomFont(context, R.font.ping_lcg_regular, tvDescription, tvValidity); 130 + tvMerchant, tvEndDate);
131 + WarpUtils.renderCustomFont(context, R.font.ping_lcg_regular, tvDescription);
135 132
136 // Set click listeners 133 // Set click listeners
137 itemView.setOnClickListener(v -> { 134 itemView.setOnClickListener(v -> {
...@@ -140,36 +137,17 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView ...@@ -140,36 +137,17 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
140 listener.onCouponClick(filteredCouponItems.get(position), position); 137 listener.onCouponClick(filteredCouponItems.get(position), position);
141 } 138 }
142 }); 139 });
143 -
144 - ivFavorite.setOnClickListener(v -> {
145 - int position = getAdapterPosition();
146 - if (listener != null && position != RecyclerView.NO_POSITION) {
147 - listener.onFavoriteClick(filteredCouponItems.get(position), position);
148 - }
149 - });
150 } 140 }
151 141
152 void bind(Coupon couponItem, int position) { 142 void bind(Coupon couponItem, int position) {
153 - tvTitle.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getName()) ? couponItem.getCouponsetDetails().getName() : ""); 143 + tvMerchant.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getAdmin_name()) ? couponItem.getCouponsetDetails().getAdmin_name().trim() : "");
154 - tvDescription.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getShort_description()) ? couponItem.getCouponsetDetails().getShort_description() : ""); 144 + tvTitle.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getName()) ? couponItem.getCouponsetDetails().getName().trim() : "");
155 - tvPrice.setText(!TextUtils.isEmpty(couponItem.getDiscount()) ? couponItem.getDiscount() : ""); 145 + tvDescription.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getShort_description()) ? couponItem.getCouponsetDetails().getShort_description().trim() : "");
156 if (couponItem.getCouponsetDetails().getEndDate() != null && !couponItem.getCouponsetDetails().getEndDate().isEmpty()) { 146 if (couponItem.getCouponsetDetails().getEndDate() != null && !couponItem.getCouponsetDetails().getEndDate().isEmpty()) {
157 - tvValidity.setText(formatValidityDate(couponItem.getCouponsetDetails().getEndDate())); 147 + String formattedDate = formatValidityDate(couponItem.getCouponsetDetails().getEndDate().trim());
158 - tvValidity.setVisibility(View.VISIBLE); 148 + tvEndDate.setText(context.getString(R.string.demo_valid_until, formattedDate));
159 - } else {
160 - tvValidity.setVisibility(View.GONE);
161 } 149 }
162 150
163 - // Set heart icon based on favorite status
164 -// if (couponItem.isFavorite()) {
165 -// // Use pressed/filled heart for Favorites
166 -// ivFavorite.setImageResource(R.drawable.demo_heart_pressed);
167 -// } else {
168 -// // Use default/empty heart for other statuses
169 -// ivFavorite.setImageResource(R.drawable.demo_heart);
170 -// }
171 -
172 - loadCouponImage(couponItem.getCouponsetDetails().getImg_preview());
173 loadMerchantLogo(couponItem.getMerchantDetails().getImgPreview()); 151 loadMerchantLogo(couponItem.getMerchantDetails().getImgPreview());
174 } 152 }
175 153
...@@ -177,41 +155,40 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView ...@@ -177,41 +155,40 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
177 try { 155 try {
178 SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); 156 SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
179 Date date = inputFormat.parse(endDate); 157 Date date = inputFormat.parse(endDate);
180 - SimpleDateFormat outputFormat = new SimpleDateFormat("dd-MM", Locale.getDefault()); 158 + SimpleDateFormat outputFormat = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);
181 - return "έως " + outputFormat.format(date); 159 + return outputFormat.format(date);
182 } catch (ParseException e) { 160 } catch (ParseException e) {
183 try { 161 try {
184 SimpleDateFormat inputFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()); 162 SimpleDateFormat inputFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault());
185 Date date = inputFormat2.parse(endDate); 163 Date date = inputFormat2.parse(endDate);
186 - SimpleDateFormat outputFormat = new SimpleDateFormat("dd-MM", Locale.getDefault()); 164 + SimpleDateFormat outputFormat = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);
187 - return "έως " + outputFormat.format(date); 165 + return outputFormat.format(date);
188 } catch (ParseException e2) { 166 } catch (ParseException e2) {
189 - return endDate; 167 + try {
168 + SimpleDateFormat inputFormat3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
169 + Date date = inputFormat3.parse(endDate);
170 + SimpleDateFormat outputFormat = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);
171 + return outputFormat.format(date);
172 + } catch (ParseException e3) {
173 + return endDate;
174 + }
190 } 175 }
191 } 176 }
192 } 177 }
193 178
194 - private void loadCouponImage(String imageUrl) { 179 + private void loadMerchantLogo(String logoUrl) {
195 - if (imageUrl != null && !imageUrl.isEmpty()) { 180 + if (logoUrl != null && !logoUrl.isEmpty()) {
196 int radiusInPixels = (int) TypedValue.applyDimension( 181 int radiusInPixels = (int) TypedValue.applyDimension(
197 - TypedValue.COMPLEX_UNIT_DIP, 9, 182 + TypedValue.COMPLEX_UNIT_DIP, 10,
198 context.getResources().getDisplayMetrics()); 183 context.getResources().getDisplayMetrics());
199 184
200 Glide.with(context) 185 Glide.with(context)
201 - .load(imageUrl)
202 - .diskCacheStrategy(DiskCacheStrategy.DATA)
203 - .transform(new CenterCrop(), new TopRoundedCornersTransformation(radiusInPixels))
204 - .into(ivOfferImage);
205 - }
206 - }
207 -
208 - private void loadMerchantLogo(String logoUrl) {
209 - if (logoUrl != null && !logoUrl.isEmpty()) {
210 - ivLogo.setVisibility(View.VISIBLE);
211 - Glide.with(context)
212 .load(logoUrl) 186 .load(logoUrl)
213 .diskCacheStrategy(DiskCacheStrategy.DATA) 187 .diskCacheStrategy(DiskCacheStrategy.DATA)
188 + .transform(new CenterCrop(), new TopRoundedCornersTransformation(radiusInPixels, true))
214 .into(ivLogo); 189 .into(ivLogo);
190 +
191 + ivLogo.setVisibility(View.VISIBLE);
215 } else { 192 } else {
216 ivLogo.setVisibility(View.GONE); 193 ivLogo.setVisibility(View.GONE);
217 } 194 }
......
...@@ -21,7 +21,6 @@ import java.util.List; ...@@ -21,7 +21,6 @@ import java.util.List;
21 import java.util.Locale; 21 import java.util.Locale;
22 22
23 import ly.warp.sdk.R; 23 import ly.warp.sdk.R;
24 -import ly.warp.sdk.io.models.DummyDataProvider;
25 import ly.warp.sdk.io.models.OfferItem; 24 import ly.warp.sdk.io.models.OfferItem;
26 import ly.warp.sdk.utils.TopRoundedCornersTransformation; 25 import ly.warp.sdk.utils.TopRoundedCornersTransformation;
27 import ly.warp.sdk.utils.WarpUtils; 26 import ly.warp.sdk.utils.WarpUtils;
...@@ -86,7 +85,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol ...@@ -86,7 +85,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol
86 */ 85 */
87 class OfferViewHolder extends RecyclerView.ViewHolder { 86 class OfferViewHolder extends RecyclerView.ViewHolder {
88 private final ImageView ivOfferImage; 87 private final ImageView ivOfferImage;
89 - private final ImageView ivFavorite;
90 private final ImageView ivLogo; 88 private final ImageView ivLogo;
91 private final TextView tvPrice; 89 private final TextView tvPrice;
92 private final TextView tvTitle; 90 private final TextView tvTitle;
...@@ -96,7 +94,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol ...@@ -96,7 +94,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol
96 OfferViewHolder(@NonNull View itemView) { 94 OfferViewHolder(@NonNull View itemView) {
97 super(itemView); 95 super(itemView);
98 ivOfferImage = itemView.findViewById(R.id.iv_offer_image); 96 ivOfferImage = itemView.findViewById(R.id.iv_offer_image);
99 - ivFavorite = itemView.findViewById(R.id.iv_favorite);
100 ivLogo = itemView.findViewById(R.id.iv_logo); 97 ivLogo = itemView.findViewById(R.id.iv_logo);
101 tvPrice = itemView.findViewById(R.id.tv_price); 98 tvPrice = itemView.findViewById(R.id.tv_price);
102 tvTitle = itemView.findViewById(R.id.tv_title); 99 tvTitle = itemView.findViewById(R.id.tv_title);
...@@ -113,13 +110,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol ...@@ -113,13 +110,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol
113 listener.onOfferClick(offerItems.get(position), position); 110 listener.onOfferClick(offerItems.get(position), position);
114 } 111 }
115 }); 112 });
116 -
117 -// ivFavorite.setOnClickListener(v -> {
118 -// int position = getAdapterPosition();
119 -// if (listener != null && position != RecyclerView.NO_POSITION) {
120 -// listener.onFavoriteClick(offerItems.get(position), position);
121 -// }
122 -// });
123 } 113 }
124 114
125 void bind(OfferItem offerItem, int position) { 115 void bind(OfferItem offerItem, int position) {
...@@ -129,15 +119,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol ...@@ -129,15 +119,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol
129 tvPrice.setText(offerItem.getValue()); 119 tvPrice.setText(offerItem.getValue());
130 tvValidity.setText(formatValidityDate(offerItem.getEndDate())); 120 tvValidity.setText(formatValidityDate(offerItem.getEndDate()));
131 121
132 - // Set heart icon based on category
133 - if (DummyDataProvider.CATEGORY_FAVORITES.equals(offerItem.getCategory())) {
134 - // Use pressed/filled heart for Favorites category
135 - ivFavorite.setImageResource(R.drawable.demo_heart_pressed);
136 - } else {
137 - // Use default/empty heart for other categories
138 - ivFavorite.setImageResource(R.drawable.demo_heart);
139 - }
140 -
141 // Load images from resources 122 // Load images from resources
142 loadOfferImage(offerItem.getImageUrl()); 123 loadOfferImage(offerItem.getImageUrl());
143 loadLogoImage(offerItem.getLogoUrl()); 124 loadLogoImage(offerItem.getLogoUrl());
......
This diff could not be displayed because it is too large.
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="6dp" />
5 +
6 + <solid android:color="@color/custom_grey5" />
7 +
8 + <stroke
9 + android:width="1dp"
10 + android:color="@color/custom_grey7" />
11 +</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="28dp" />
5 +
6 + <solid
7 + android:color="@color/custom_black7" />
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="28dp" />
5 +
6 + <solid
7 + android:color="@color/custom_grey8" />
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="28dp" />
5 +
6 + <solid
7 + android:color="@color/custom_grey5" />
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="13dp" />
5 +
6 + <solid android:color="@color/custom_skyblue4" />
7 +
8 + <stroke
9 + android:width="2dp"
10 + android:color="@color/custom_skyblue6" />
11 +</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="1000dp" />
5 +
6 + <solid android:color="@android:color/transparent" />
7 +
8 + <stroke
9 + android:width="2dp"
10 + android:color="@color/white" />
11 +</shape>
...\ No newline at end of file ...\ No newline at end of file
1 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 + xmlns:tools="http://schemas.android.com/tools"
3 + android:layout_width="match_parent"
4 + android:layout_height="match_parent"
5 + android:background="@color/white">
6 +
7 + <androidx.core.widget.NestedScrollView
8 + android:id="@+id/profile_scrollview"
9 + android:layout_width="match_parent"
10 + android:layout_height="match_parent"
11 + android:fillViewport="true">
12 +
13 + <LinearLayout
14 + android:id="@+id/profile_content_container"
15 + android:layout_width="match_parent"
16 + android:layout_height="wrap_content"
17 + android:orientation="vertical">
18 +
19 + <LinearLayout
20 + android:id="@+id/header_layout"
21 + android:layout_width="match_parent"
22 + android:layout_height="wrap_content"
23 + android:layout_gravity="center"
24 + android:background="@color/white"
25 + android:orientation="horizontal"
26 + android:padding="16dp">
27 +
28 + <LinearLayout
29 + android:layout_width="0dp"
30 + android:layout_height="wrap_content"
31 + android:layout_weight="1"
32 + android:gravity="center_vertical"
33 + android:orientation="horizontal">
34 +
35 + <ImageView
36 + android:id="@+id/iv_back"
37 + android:layout_width="16dp"
38 + android:layout_height="16dp"
39 + android:layout_marginEnd="24dp"
40 + android:src="@drawable/ic_back" />
41 + </LinearLayout>
42 + </LinearLayout>
43 +
44 + <LinearLayout
45 + android:id="@+id/header_layout2"
46 + android:layout_width="match_parent"
47 + android:layout_height="wrap_content"
48 + android:background="@color/white"
49 + android:gravity="center"
50 + android:orientation="horizontal"
51 + android:paddingHorizontal="16dp">
52 +
53 + <LinearLayout
54 + android:layout_width="0dp"
55 + android:layout_height="wrap_content"
56 + android:layout_weight="1"
57 + android:orientation="vertical">
58 +
59 + <TextView
60 + android:id="@+id/tv_header_title"
61 + android:layout_width="wrap_content"
62 + android:layout_height="wrap_content"
63 + android:includeFontPadding="false"
64 + android:text="@string/demo_my_coupons_header"
65 + android:textColor="@color/custom_black6"
66 + android:textSize="28sp" />
67 + </LinearLayout>
68 +
69 + <ImageView
70 + android:id="@+id/profile_icon"
71 + android:layout_width="46dp"
72 + android:layout_height="46dp"
73 + android:background="@drawable/shape_rectangle_rounded_grey"
74 + android:padding="14dp"
75 + android:src="@drawable/demo_search" />
76 + </LinearLayout>
77 +
78 + <RelativeLayout
79 + android:id="@+id/my_coupons_section"
80 + android:layout_width="match_parent"
81 + android:layout_height="wrap_content"
82 + android:layout_marginTop="24dp"
83 + android:layout_marginBottom="48dp"
84 + android:background="@color/white"
85 + android:paddingBottom="16dp">
86 +
87 + <LinearLayout
88 + android:id="@+id/ll_coupon_filters"
89 + android:layout_width="match_parent"
90 + android:layout_height="wrap_content"
91 + android:orientation="horizontal"
92 + android:paddingHorizontal="16dp">
93 +
94 + <LinearLayout
95 + android:id="@+id/ll_filter_active"
96 + android:layout_width="wrap_content"
97 + android:layout_height="wrap_content"
98 + android:layout_marginEnd="8dp"
99 + android:background="@drawable/shape_rectangle_rounded_black2"
100 + android:paddingHorizontal="20dp"
101 + android:paddingVertical="12dp">
102 +
103 + <TextView
104 + android:id="@+id/btn_filter_active"
105 + android:layout_width="wrap_content"
106 + android:layout_height="wrap_content"
107 + android:includeFontPadding="false"
108 + android:text="@string/demo_active"
109 + android:textColor="@color/white"
110 + android:textSize="14sp" />
111 + </LinearLayout>
112 +
113 + <LinearLayout
114 + android:id="@+id/ll_filter_redeemed"
115 + android:layout_width="wrap_content"
116 + android:layout_height="wrap_content"
117 + android:layout_marginEnd="8dp"
118 + android:background="@drawable/shape_rectangle_rounded_grey4"
119 + android:paddingHorizontal="20dp"
120 + android:paddingVertical="12dp">
121 +
122 + <TextView
123 + android:id="@+id/btn_filter_redeemed"
124 + android:layout_height="wrap_content"
125 + android:layout_width="wrap_content"
126 + android:gravity="center"
127 + android:includeFontPadding="false"
128 + android:text="@string/demo_expired"
129 + android:textColor="@color/custom_black6"
130 + android:textSize="14sp" />
131 + </LinearLayout>
132 + </LinearLayout>
133 +
134 + <androidx.recyclerview.widget.RecyclerView
135 + android:id="@+id/rv_coupons"
136 + android:layout_width="match_parent"
137 + android:layout_height="wrap_content"
138 + android:layout_below="@id/ll_coupon_filters"
139 + android:layout_marginTop="32dp"
140 + android:clipToPadding="false"
141 + android:nestedScrollingEnabled="false"
142 + android:paddingHorizontal="16dp" />
143 + </RelativeLayout>
144 + </LinearLayout>
145 + </androidx.core.widget.NestedScrollView>
146 +</RelativeLayout>
...@@ -66,7 +66,8 @@ ...@@ -66,7 +66,8 @@
66 <androidx.constraintlayout.widget.ConstraintLayout 66 <androidx.constraintlayout.widget.ConstraintLayout
67 android:id="@+id/cl_viewpager" 67 android:id="@+id/cl_viewpager"
68 android:layout_width="match_parent" 68 android:layout_width="match_parent"
69 - android:layout_height="wrap_content"> 69 + android:layout_height="wrap_content"
70 + android:layout_marginTop="16dp">
70 71
71 <androidx.recyclerview.widget.RecyclerView 72 <androidx.recyclerview.widget.RecyclerView
72 android:id="@+id/banner_viewpager" 73 android:id="@+id/banner_viewpager"
...@@ -151,4 +152,50 @@ ...@@ -151,4 +152,50 @@
151 </RelativeLayout> 152 </RelativeLayout>
152 </LinearLayout> 153 </LinearLayout>
153 </androidx.core.widget.NestedScrollView> 154 </androidx.core.widget.NestedScrollView>
155 +
156 + <LinearLayout
157 + android:id="@+id/ll_my_coupons"
158 + android:layout_width="wrap_content"
159 + android:layout_height="wrap_content"
160 + android:layout_alignParentEnd="true"
161 + android:layout_alignParentBottom="true"
162 + android:layout_marginEnd="8dp"
163 + android:layout_marginBottom="64dp"
164 + android:background="@drawable/shape_rectangle_rounded_grey3"
165 + android:gravity="center"
166 + android:orientation="horizontal"
167 + android:paddingHorizontal="16dp"
168 + android:paddingVertical="18dp"
169 + android:translationZ="100dp">
170 +
171 + <TextView
172 + android:id="@+id/tv_my_coupons_title"
173 + android:layout_width="wrap_content"
174 + android:layout_height="wrap_content"
175 + android:includeFontPadding="false"
176 + android:text="@string/demo_my_coupons_title"
177 + android:textColor="@color/white"
178 + android:textSize="15sp" />
179 +
180 + <View
181 + android:layout_width="12dp"
182 + android:layout_height="match_parent" />
183 +
184 + <LinearLayout
185 + android:layout_width="21dp"
186 + android:layout_height="21dp"
187 + android:orientation="horizontal"
188 + android:gravity="center"
189 + android:background="@drawable/shape_rounded_transparent_white_border">
190 +
191 + <TextView
192 + android:id="@+id/tv_my_coupons_value"
193 + android:layout_width="wrap_content"
194 + android:layout_height="wrap_content"
195 + android:includeFontPadding="false"
196 + android:text="0"
197 + android:textColor="@color/white"
198 + android:textSize="13sp" />
199 + </LinearLayout>
200 + </LinearLayout>
154 </RelativeLayout> 201 </RelativeLayout>
......
...@@ -76,17 +76,19 @@ ...@@ -76,17 +76,19 @@
76 android:layout_width="0dp" 76 android:layout_width="0dp"
77 android:layout_height="wrap_content" 77 android:layout_height="wrap_content"
78 android:orientation="vertical" 78 android:orientation="vertical"
79 + android:paddingEnd="16dp"
79 app:layout_constraintBottom_toBottomOf="parent" 80 app:layout_constraintBottom_toBottomOf="parent"
80 - app:layout_constraintEnd_toEndOf="parent" 81 + app:layout_constraintEnd_toStartOf="@+id/iv_share_coupon"
81 app:layout_constraintStart_toStartOf="parent" 82 app:layout_constraintStart_toStartOf="parent"
82 app:layout_constraintTop_toTopOf="parent"> 83 app:layout_constraintTop_toTopOf="parent">
83 84
84 <TextView 85 <TextView
85 android:id="@+id/tv_merchant_value" 86 android:id="@+id/tv_merchant_value"
86 - android:layout_width="wrap_content" 87 + android:layout_width="match_parent"
87 android:layout_height="wrap_content" 88 android:layout_height="wrap_content"
88 android:includeFontPadding="false" 89 android:includeFontPadding="false"
89 android:maxLines="1" 90 android:maxLines="1"
91 + android:ellipsize="end"
90 android:textColor="@color/custom_grey4" 92 android:textColor="@color/custom_grey4"
91 android:textSize="16sp" 93 android:textSize="16sp"
92 tools:text="@string/demo_more" /> 94 tools:text="@string/demo_more" />
...@@ -98,6 +100,7 @@ ...@@ -98,6 +100,7 @@
98 android:layout_marginTop="16dp" 100 android:layout_marginTop="16dp"
99 android:includeFontPadding="false" 101 android:includeFontPadding="false"
100 android:maxLines="1" 102 android:maxLines="1"
103 + android:ellipsize="end"
101 android:textColor="@color/custom_black2" 104 android:textColor="@color/custom_black2"
102 android:textSize="23sp" 105 android:textSize="23sp"
103 tools:text="@string/demo_more" /> 106 tools:text="@string/demo_more" />
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
82 android:layout_height="wrap_content" 82 android:layout_height="wrap_content"
83 android:includeFontPadding="false" 83 android:includeFontPadding="false"
84 android:maxLines="1" 84 android:maxLines="1"
85 + android:ellipsize="end"
85 android:textColor="@color/custom_grey4" 86 android:textColor="@color/custom_grey4"
86 android:textSize="16sp" 87 android:textSize="16sp"
87 tools:text="@string/demo_more" /> 88 tools:text="@string/demo_more" />
...@@ -93,6 +94,7 @@ ...@@ -93,6 +94,7 @@
93 android:layout_marginTop="16dp" 94 android:layout_marginTop="16dp"
94 android:includeFontPadding="false" 95 android:includeFontPadding="false"
95 android:maxLines="1" 96 android:maxLines="1"
97 + android:ellipsize="end"
96 android:textColor="@color/custom_black2" 98 android:textColor="@color/custom_black2"
97 android:textSize="23sp" 99 android:textSize="23sp"
98 tools:text="@string/demo_more" /> 100 tools:text="@string/demo_more" />
......
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <RelativeLayout 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" 3 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent" 4 android:layout_width="match_parent"
6 - android:layout_height="280dp" 5 + android:layout_height="150dp"
7 - android:background="@drawable/demo_shape_white_border_grey"> 6 + android:background="@drawable/shape_rounded_skyblue_skyblue_border">
8 7
9 - <ImageView 8 + <LinearLayout
10 - android:id="@+id/iv_offer_image"
11 android:layout_width="match_parent" 9 android:layout_width="match_parent"
12 - android:layout_height="160dp" 10 + android:layout_height="wrap_content"
13 - android:scaleType="centerCrop" 11 + android:layout_alignParentTop="true"
14 - tools:src="@drawable/demo_home_banner1" /> 12 + android:orientation="horizontal">
15 13
16 - <ImageView 14 + <LinearLayout
17 - android:id="@+id/iv_favorite" 15 + android:layout_width="0dp"
18 - android:layout_width="46dp"
19 - android:layout_height="46dp"
20 - android:layout_margin="8dp"
21 - android:src="@drawable/demo_heart" />
22 -
23 - <TextView
24 - android:id="@+id/tv_price"
25 - android:layout_width="84dp"
26 - android:layout_height="84dp"
27 - android:layout_alignParentEnd="true"
28 - android:layout_margin="8dp"
29 - android:background="@drawable/demo_shape_pink"
30 - android:gravity="center"
31 - android:textColor="@android:color/white"
32 - android:textSize="23sp"
33 - tools:text="17,95€" />
34 -
35 - <androidx.constraintlayout.widget.ConstraintLayout
36 - android:layout_width="match_parent"
37 - android:layout_height="match_parent"
38 - android:layout_below="@id/iv_offer_image"
39 - android:orientation="vertical"
40 - android:padding="12dp">
41 -
42 - <androidx.constraintlayout.widget.Guideline
43 - android:id="@+id/gl_vertical_70"
44 - android:layout_width="wrap_content"
45 android:layout_height="wrap_content" 16 android:layout_height="wrap_content"
17 + android:layout_marginTop="16dp"
18 + android:layout_weight="1"
46 android:orientation="vertical" 19 android:orientation="vertical"
47 - app:layout_constraintGuide_percent="0.7" /> 20 + android:paddingHorizontal="16dp">
48 21
49 - <!-- Title --> 22 + <TextView
50 - <TextView 23 + android:id="@+id/tv_merchant"
51 - android:id="@+id/tv_title" 24 + android:layout_width="wrap_content"
52 - android:layout_width="0dp" 25 + android:layout_height="wrap_content"
53 - android:layout_height="wrap_content" 26 + android:includeFontPadding="false"
54 - android:maxLines="1" 27 + android:maxLines="1"
55 - android:textColor="@color/custom_black2" 28 + android:ellipsize="end"
56 - android:textSize="21sp" 29 + android:textColor="@color/custom_grey3"
57 - app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70" 30 + android:textSize="14sp"
58 - app:layout_constraintStart_toStartOf="parent" 31 + tools:text="2 πίτσες &amp; Coca-COLA 1,5lt" />
59 - app:layout_constraintTop_toTopOf="parent"
60 - tools:text="Móvo 17,95" />
61 32
62 - <!-- Description --> 33 + <TextView
63 - <TextView 34 + android:id="@+id/tv_title"
64 - android:id="@+id/tv_description" 35 + android:layout_width="wrap_content"
65 - android:layout_width="0dp" 36 + android:layout_height="wrap_content"
66 - android:layout_height="wrap_content" 37 + android:layout_marginTop="8dp"
67 - android:maxLines="2" 38 + android:includeFontPadding="false"
68 - android:textColor="@color/custom_black3" 39 + android:maxLines="1"
69 - android:textSize="15sp" 40 + android:ellipsize="end"
70 - app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70" 41 + android:textColor="@color/custom_black6"
71 - app:layout_constraintStart_toStartOf="parent" 42 + android:textSize="21sp"
72 - app:layout_constraintTop_toBottomOf="@+id/tv_title" 43 + tools:text="Móvo 17,95" />
73 - tools:text="2 πίτσες &amp; Coca-COLA 1,5lt" />
74 44
75 - <!-- Validity Date --> 45 + <TextView
76 - <TextView 46 + android:id="@+id/tv_description"
77 - android:id="@+id/tv_validity" 47 + android:layout_width="wrap_content"
78 - android:layout_width="wrap_content" 48 + android:layout_height="wrap_content"
79 - android:layout_height="wrap_content" 49 + android:layout_marginTop="2dp"
80 - android:layout_alignParentStart="true" 50 + android:includeFontPadding="false"
81 - android:layout_centerVertical="true" 51 + android:maxLines="2"
82 - android:layout_marginTop="24dp" 52 + android:textColor="@color/custom_grey3"
83 - android:maxLines="1" 53 + android:textSize="13sp"
84 - android:textColor="@color/custom_black3" 54 + tools:text="2 πίτσες &amp; Coca-COLA 1,5lt" />
85 - android:textSize="12sp" 55 + </LinearLayout>
86 - app:layout_constraintStart_toStartOf="parent"
87 - app:layout_constraintBottom_toBottomOf="parent"
88 - tools:text="έως 30-09" />
89 56
90 <ImageView 57 <ImageView
91 android:id="@+id/iv_logo" 58 android:id="@+id/iv_logo"
92 - android:layout_width="80dp" 59 + android:layout_width="68dp"
93 - android:layout_height="80dp" 60 + android:layout_height="68dp"
94 - android:layout_alignParentEnd="true" 61 + android:layout_marginTop="10dp"
95 - android:layout_centerVertical="true" 62 + android:layout_marginEnd="10dp"
96 android:scaleType="centerInside" 63 android:scaleType="centerInside"
97 - app:layout_constraintBottom_toBottomOf="parent"
98 - app:layout_constraintEnd_toEndOf="parent"
99 - app:layout_constraintTop_toTopOf="parent"
100 tools:src="@drawable/demo_avis" /> 64 tools:src="@drawable/demo_avis" />
101 - </androidx.constraintlayout.widget.ConstraintLayout> 65 + </LinearLayout>
66 +
67 + <LinearLayout
68 + android:layout_width="match_parent"
69 + android:layout_height="wrap_content"
70 + android:layout_alignParentBottom="true"
71 + android:gravity="center"
72 + android:orientation="horizontal"
73 + android:paddingStart="16dp"
74 + android:paddingEnd="10dp"
75 + android:layout_marginBottom="8dp">
76 +
77 + <LinearLayout
78 + android:layout_width="0dp"
79 + android:layout_height="wrap_content"
80 + android:layout_weight="1">
81 +
82 + <LinearLayout
83 + android:id="@+id/ll_date"
84 + android:layout_width="wrap_content"
85 + android:layout_height="wrap_content"
86 + android:background="@drawable/demo_shape_grey_border_grey"
87 + android:gravity="center"
88 + android:orientation="horizontal"
89 + android:paddingHorizontal="8dp"
90 + android:paddingVertical="6dp">
91 +
92 + <ImageView
93 + android:layout_width="14dp"
94 + android:layout_height="14dp"
95 + android:src="@drawable/demo_time" />
96 +
97 + <View
98 + android:layout_width="4dp"
99 + android:layout_height="match_parent" />
100 +
101 + <TextView
102 + android:id="@+id/tv_coupon_end_date"
103 + android:layout_width="wrap_content"
104 + android:layout_height="wrap_content"
105 + android:includeFontPadding="false"
106 + android:textColor="@color/custom_black7"
107 + android:textSize="12sp"
108 + tools:text="@string/demo_purchases" />
109 + </LinearLayout>
110 + </LinearLayout>
111 +
112 + <LinearLayout
113 + android:id="@+id/header_layout"
114 + android:layout_width="wrap_content"
115 + android:layout_height="wrap_content">
116 +
117 + <ImageView
118 + android:id="@+id/iv_back"
119 + android:layout_width="38dp"
120 + android:layout_height="38dp"
121 + android:background="@drawable/demo_shape_white"
122 + android:padding="13dp"
123 + android:rotation="180"
124 + android:src="@drawable/ic_back" />
125 + </LinearLayout>
126 + </LinearLayout>
102 </RelativeLayout> 127 </RelativeLayout>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
17 android:layout_width="0dp" 17 android:layout_width="0dp"
18 android:layout_height="wrap_content" 18 android:layout_height="wrap_content"
19 android:layout_weight="1" 19 android:layout_weight="1"
20 + android:includeFontPadding="false"
20 android:textColor="@color/custom_black2" 21 android:textColor="@color/custom_black2"
21 android:textSize="15sp" 22 android:textSize="15sp"
22 tools:text="Top Offers (10)" /> 23 tools:text="Top Offers (10)" />
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
34 android:layout_width="wrap_content" 35 android:layout_width="wrap_content"
35 android:layout_height="wrap_content" 36 android:layout_height="wrap_content"
36 android:text="@string/demo_all" 37 android:text="@string/demo_all"
38 + android:includeFontPadding="false"
37 android:textColor="@color/custom_black3" 39 android:textColor="@color/custom_black3"
38 android:textSize="15sp" /> 40 android:textSize="15sp" />
39 41
......
...@@ -35,4 +35,6 @@ ...@@ -35,4 +35,6 @@
35 <color name="custom_grey5">#F1F2F4</color> 35 <color name="custom_grey5">#F1F2F4</color>
36 <color name="custom_grey6">#CBCBCB</color> 36 <color name="custom_grey6">#CBCBCB</color>
37 <color name="custom_grey7">#D2D6D9</color> 37 <color name="custom_grey7">#D2D6D9</color>
38 + <color name="custom_grey8">#8F8F8F</color>
39 + <color name="custom_skyblue6">#A5DAF8</color>
38 </resources> 40 </resources>
......
...@@ -25,10 +25,13 @@ ...@@ -25,10 +25,13 @@
25 <string name="demo_success_redeem">Saved to My Coupons</string> 25 <string name="demo_success_redeem">Saved to My Coupons</string>
26 <string name="demo_profile">Το προφίλ μου</string> 26 <string name="demo_profile">Το προφίλ μου</string>
27 <string name="demo_my_coupons">Τα κουπόνια μου</string> 27 <string name="demo_my_coupons">Τα κουπόνια μου</string>
28 - <string name="demo_active">Ενεργά</string> 28 + <string name="demo_active">Valid</string>
29 <string name="demo_redeemed">Εξαργυρωμένα</string> 29 <string name="demo_redeemed">Εξαργυρωμένα</string>
30 + <string name="demo_expired">Expired</string>
30 <string name="demo_favorites">Αγαπημένα</string> 31 <string name="demo_favorites">Αγαπημένα</string>
31 <string name="demo_rewards_title">Rewards</string> 32 <string name="demo_rewards_title">Rewards</string>
32 <string name="demo_green_title">green</string> 33 <string name="demo_green_title">green</string>
33 <string name="demo_family_title">family</string> 34 <string name="demo_family_title">family</string>
35 + <string name="demo_my_coupons_title">My coupons</string>
36 + <string name="demo_my_coupons_header">My Coupons</string>
34 </resources> 37 </resources>
......