Panagiotis Triantafyllou

deh part5

1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <resources> 2 <resources>
3 3
4 - <string name="app_name">Cosmote demo</string> 4 + <string name="app_name">ΔΕΗ demo</string>
5 <string name="hello_world">Hello world!</string> 5 <string name="hello_world">Hello world!</string>
6 <string name="action_settings">Settings</string> 6 <string name="action_settings">Settings</string>
7 <string name="title_activity_main">MainActivity</string> 7 <string name="title_activity_main">MainActivity</string>
......
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
45 android:theme="@style/SDKAppTheme" /> 45 android:theme="@style/SDKAppTheme" />
46 46
47 <activity 47 <activity
48 + android:name=".activities.ProfileActivity"
49 + android:exported="false"
50 + android:screenOrientation="portrait"
51 + android:theme="@style/SDKAppTheme" />
52 +
53 + <activity
48 android:name=".dexter.PermissionsActivity" 54 android:name=".dexter.PermissionsActivity"
49 android:exported="false" 55 android:exported="false"
50 android:launchMode="singleInstance" 56 android:launchMode="singleInstance"
......
...@@ -76,6 +76,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -76,6 +76,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
76 76
77 private TextView mTvAllOffers, mTvAllFavorites, mTvAllViability, mTvAllFamily, 77 private TextView mTvAllOffers, mTvAllFavorites, mTvAllViability, mTvAllFamily,
78 mTvAllCoffee, mTvAllTravelling, mTvAllKids, mTvAllPurchases; 78 mTvAllCoffee, mTvAllTravelling, mTvAllKids, mTvAllPurchases;
79 + private ImageView mIvProfile;
79 80
80 // =========================================================== 81 // ===========================================================
81 // Methods for/from SuperClass/Interfaces 82 // Methods for/from SuperClass/Interfaces
...@@ -106,7 +107,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -106,7 +107,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
106 107
107 @Override 108 @Override
108 public void onClick(View v) { 109 public void onClick(View v) {
109 - // No longer needed as banner clicks are handled by the adapter 110 + if (v.getId() == R.id.profile_icon) {
111 + Intent myIntent = new Intent(HomeActivity.this, ProfileActivity.class);
112 + startActivity(myIntent);
113 + }
110 } 114 }
111 115
112 @Override 116 @Override
...@@ -129,6 +133,9 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -129,6 +133,9 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
129 // Initialize banner carousel 133 // Initialize banner carousel
130 setupBannerCarousel(); 134 setupBannerCarousel();
131 135
136 + mIvProfile = findViewById(R.id.profile_icon);
137 + mIvProfile.setOnClickListener(this);
138 +
132 // Initialize Top Offers section 139 // Initialize Top Offers section
133 mTvCategoryTopOffers = findViewById(R.id.tv_recycler_category1); 140 mTvCategoryTopOffers = findViewById(R.id.tv_recycler_category1);
134 mRvTopOffers = findViewById(R.id.rl_recycler1); 141 mRvTopOffers = findViewById(R.id.rl_recycler1);
...@@ -191,6 +198,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -191,6 +198,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
191 // Set up RecyclerView 198 // Set up RecyclerView
192 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); 199 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
193 mRvTopOffers.setLayoutManager(layoutManager); 200 mRvTopOffers.setLayoutManager(layoutManager);
201 + mRvTopOffers.setHasFixedSize(true);
194 202
195 // Add spacing between items 203 // Add spacing between items
196 int spacingInPixels = (int) TypedValue.applyDimension( 204 int spacingInPixels = (int) TypedValue.applyDimension(
...@@ -217,6 +225,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -217,6 +225,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
217 // Set up RecyclerView 225 // Set up RecyclerView
218 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); 226 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
219 mRvFavorites.setLayoutManager(layoutManager); 227 mRvFavorites.setLayoutManager(layoutManager);
228 + mRvFavorites.setHasFixedSize(true);
220 229
221 // Add spacing between items 230 // Add spacing between items
222 int spacingInPixels = (int) TypedValue.applyDimension( 231 int spacingInPixels = (int) TypedValue.applyDimension(
...@@ -243,6 +252,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -243,6 +252,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
243 // Set up RecyclerView 252 // Set up RecyclerView
244 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); 253 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
245 mRvViability.setLayoutManager(layoutManager); 254 mRvViability.setLayoutManager(layoutManager);
255 + mRvViability.setHasFixedSize(true);
246 256
247 // Add spacing between items 257 // Add spacing between items
248 int spacingInPixels = (int) TypedValue.applyDimension( 258 int spacingInPixels = (int) TypedValue.applyDimension(
...@@ -269,6 +279,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -269,6 +279,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
269 // Set up RecyclerView 279 // Set up RecyclerView
270 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); 280 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
271 mRvFamily.setLayoutManager(layoutManager); 281 mRvFamily.setLayoutManager(layoutManager);
282 + mRvFamily.setHasFixedSize(true);
272 283
273 // Add spacing between items 284 // Add spacing between items
274 int spacingInPixels = (int) TypedValue.applyDimension( 285 int spacingInPixels = (int) TypedValue.applyDimension(
...@@ -295,6 +306,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -295,6 +306,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
295 // Set up RecyclerView 306 // Set up RecyclerView
296 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); 307 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
297 mRvFoodCoffee.setLayoutManager(layoutManager); 308 mRvFoodCoffee.setLayoutManager(layoutManager);
309 + mRvFoodCoffee.setHasFixedSize(true);
298 310
299 // Add spacing between items 311 // Add spacing between items
300 int spacingInPixels = (int) TypedValue.applyDimension( 312 int spacingInPixels = (int) TypedValue.applyDimension(
...@@ -321,6 +333,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -321,6 +333,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
321 // Set up RecyclerView 333 // Set up RecyclerView
322 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); 334 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
323 mRvTravelling.setLayoutManager(layoutManager); 335 mRvTravelling.setLayoutManager(layoutManager);
336 + mRvTravelling.setHasFixedSize(true);
324 337
325 // Add spacing between items 338 // Add spacing between items
326 int spacingInPixels = (int) TypedValue.applyDimension( 339 int spacingInPixels = (int) TypedValue.applyDimension(
...@@ -347,6 +360,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -347,6 +360,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
347 // Set up RecyclerView 360 // Set up RecyclerView
348 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); 361 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
349 mRvKids.setLayoutManager(layoutManager); 362 mRvKids.setLayoutManager(layoutManager);
363 + mRvKids.setHasFixedSize(true);
350 364
351 // Add spacing between items 365 // Add spacing between items
352 int spacingInPixels = (int) TypedValue.applyDimension( 366 int spacingInPixels = (int) TypedValue.applyDimension(
...@@ -373,6 +387,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -373,6 +387,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
373 // Set up RecyclerView 387 // Set up RecyclerView
374 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); 388 LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
375 mRvPurchases.setLayoutManager(layoutManager); 389 mRvPurchases.setLayoutManager(layoutManager);
390 + mRvPurchases.setHasFixedSize(true);
376 391
377 // Add spacing between items 392 // Add spacing between items
378 int spacingInPixels = (int) TypedValue.applyDimension( 393 int spacingInPixels = (int) TypedValue.applyDimension(
...@@ -388,14 +403,14 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -388,14 +403,14 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
388 // =========================================================== 403 // ===========================================================
389 // Methods 404 // Methods
390 // =========================================================== 405 // ===========================================================
391 - 406 +
392 /** 407 /**
393 * Sets up the banner carousel with ViewPager2 and pagination dots 408 * Sets up the banner carousel with ViewPager2 and pagination dots
394 */ 409 */
395 private void setupBannerCarousel() { 410 private void setupBannerCarousel() {
396 mBannerViewPager = findViewById(R.id.banner_viewpager); 411 mBannerViewPager = findViewById(R.id.banner_viewpager);
397 mDotsContainer = findViewById(R.id.dots_container); 412 mDotsContainer = findViewById(R.id.dots_container);
398 - 413 +
399 // Setup adapter with 5 banner images 414 // Setup adapter with 5 banner images
400 List<Integer> bannerImages = getBannerImages(); 415 List<Integer> bannerImages = getBannerImages();
401 mBannerAdapter = new BannerAdapter(this, bannerImages); 416 mBannerAdapter = new BannerAdapter(this, bannerImages);
...@@ -403,12 +418,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -403,12 +418,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
403 // Handle banner click (same as the original banner click) 418 // Handle banner click (same as the original banner click)
404 WarplyManagerHelper.openContest(this); 419 WarplyManagerHelper.openContest(this);
405 }); 420 });
406 - 421 +
407 mBannerViewPager.setAdapter(mBannerAdapter); 422 mBannerViewPager.setAdapter(mBannerAdapter);
408 - 423 +
409 // Setup pagination dots 424 // Setup pagination dots
410 setupPaginationDots(bannerImages.size()); 425 setupPaginationDots(bannerImages.size());
411 - 426 +
412 // Handle page changes 427 // Handle page changes
413 mBannerViewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { 428 mBannerViewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
414 @Override 429 @Override
...@@ -417,53 +432,55 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe ...@@ -417,53 +432,55 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
417 } 432 }
418 }); 433 });
419 } 434 }
420 - 435 +
421 /** 436 /**
422 * Returns a list of banner image resource IDs 437 * Returns a list of banner image resource IDs
423 */ 438 */
424 private List<Integer> getBannerImages() { 439 private List<Integer> getBannerImages() {
425 return Arrays.asList( 440 return Arrays.asList(
426 - R.drawable.demo_home_banner1, 441 + R.drawable.demo_home_banner1,
427 - R.drawable.demo_home_banner2, 442 + R.drawable.demo_home_banner2,
428 - R.drawable.demo_home_banner3, 443 + R.drawable.demo_home_banner3,
429 - R.drawable.demo_home_banner4, 444 + R.drawable.demo_home_banner4,
430 - R.drawable.demo_home_banner5 445 + R.drawable.demo_home_banner5
431 ); 446 );
432 } 447 }
433 - 448 +
434 /** 449 /**
435 * Sets up the pagination dots 450 * Sets up the pagination dots
451 + *
436 * @param count Number of dots to display 452 * @param count Number of dots to display
437 */ 453 */
438 private void setupPaginationDots(int count) { 454 private void setupPaginationDots(int count) {
439 mDots = new ArrayList<>(); 455 mDots = new ArrayList<>();
440 mDotsContainer.removeAllViews(); 456 mDotsContainer.removeAllViews();
441 - 457 +
442 // Create dots 458 // Create dots
443 for (int i = 0; i < count; i++) { 459 for (int i = 0; i < count; i++) {
444 ImageView dot = new ImageView(this); 460 ImageView dot = new ImageView(this);
445 - 461 +
446 // Set dot appearance 462 // Set dot appearance
447 LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( 463 LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
448 LinearLayout.LayoutParams.WRAP_CONTENT, 464 LinearLayout.LayoutParams.WRAP_CONTENT,
449 LinearLayout.LayoutParams.WRAP_CONTENT 465 LinearLayout.LayoutParams.WRAP_CONTENT
450 ); 466 );
451 - 467 +
452 // Add margin between dots 468 // Add margin between dots
453 params.setMargins(8, 0, 8, 0); 469 params.setMargins(8, 0, 8, 0);
454 dot.setLayoutParams(params); 470 dot.setLayoutParams(params);
455 - 471 +
456 // Set initial state (first dot active, others inactive) 472 // Set initial state (first dot active, others inactive)
457 dot.setImageResource(i == 0 ? R.drawable.dot_active : R.drawable.dot_inactive); 473 dot.setImageResource(i == 0 ? R.drawable.dot_active : R.drawable.dot_inactive);
458 - 474 +
459 // Add to container and list 475 // Add to container and list
460 mDotsContainer.addView(dot); 476 mDotsContainer.addView(dot);
461 mDots.add(dot); 477 mDots.add(dot);
462 } 478 }
463 } 479 }
464 - 480 +
465 /** 481 /**
466 * Updates the dots to reflect the current page 482 * Updates the dots to reflect the current page
483 + *
467 * @param position Current page position 484 * @param position Current page position
468 */ 485 */
469 private void updateDots(int position) { 486 private void updateDots(int position) {
......
1 +package ly.warp.sdk.activities;
2 +
3 +import android.app.Activity;
4 +import android.content.Intent;
5 +import android.graphics.Color;
6 +import android.os.Build;
7 +import android.os.Bundle;
8 +import android.util.TypedValue;
9 +import android.view.View;
10 +import android.view.WindowInsetsController;
11 +import android.widget.ImageView;
12 +import android.widget.TextView;
13 +
14 +import androidx.recyclerview.widget.LinearLayoutManager;
15 +import androidx.recyclerview.widget.RecyclerView;
16 +
17 +import java.util.List;
18 +
19 +import ly.warp.sdk.R;
20 +import ly.warp.sdk.io.adapters.CouponAdapter;
21 +import ly.warp.sdk.io.adapters.OfferAdapter;
22 +import ly.warp.sdk.io.models.CouponItem;
23 +import ly.warp.sdk.io.models.DummyDataProvider;
24 +import ly.warp.sdk.io.models.OfferCategory;
25 +import ly.warp.sdk.io.models.OfferItem;
26 +import ly.warp.sdk.utils.WarpUtils;
27 +import ly.warp.sdk.views.HorizontalSpaceItemDecoration;
28 +import ly.warp.sdk.views.VerticalSpaceItemDecoration;
29 +
30 +public class ProfileActivity extends Activity implements View.OnClickListener, OfferAdapter.OnOfferClickListener, CouponAdapter.OnCouponClickListener {
31 + // ===========================================================
32 + // Constants
33 + // ===========================================================
34 +
35 +
36 + // ===========================================================
37 + // Fields
38 + // ===========================================================
39 +
40 + private TextView mTvHeaderTitle;
41 + private ImageView mIvBack;
42 +
43 + // Profile suggestions section
44 + private TextView mTvCategoryProfileSuggestions;
45 + private RecyclerView mRvProfileSuggestions;
46 + private OfferAdapter mProfileSuggestionsAdapter;
47 + private TextView mTvAllProfileSuggestions;
48 +
49 + // My coupons section
50 + private TextView mTvMyCouponsTitle;
51 + private RecyclerView mRvCoupons;
52 + private CouponAdapter mCouponsAdapter;
53 + private TextView mBtnFilterActive, mBtnFilterFavorites, mBtnFilterRedeemed;
54 + private List<CouponItem> mCouponItems;
55 +
56 + // ===========================================================
57 + // Methods for/from SuperClass/Interfaces
58 + // ===========================================================
59 +
60 + @Override
61 + public void onCreate(Bundle savedInstanceState) {
62 + super.onCreate(savedInstanceState);
63 + setContentView(R.layout.activity_profile);
64 +
65 + // Setup white status bar
66 + setupStatusBar();
67 +
68 + initViews();
69 +
70 + // Setup profile suggestions section
71 + setupProfileSuggestionsSection();
72 +
73 + // Setup my coupons section
74 + setupMyCouponsSection();
75 + }
76 +
77 + @Override
78 + public void onResume() {
79 + super.onResume();
80 + }
81 +
82 + @Override
83 + public void onClick(View v) {
84 + int id = v.getId();
85 + if (id == R.id.iv_back) {
86 + onBackPressed();
87 + } else if (id == R.id.btn_filter_active) {
88 + filterCoupons(CouponItem.STATUS_ACTIVE);
89 + } else if (id == R.id.btn_filter_favorites) {
90 + filterCoupons(CouponItem.STATUS_FAVORITE);
91 + } else if (id == R.id.btn_filter_redeemed) {
92 + filterCoupons(CouponItem.STATUS_REDEEMED);
93 + }
94 + }
95 +
96 + @Override
97 + public void onOfferClick(OfferItem offerItem, int position) {
98 + Intent myIntent = new Intent(ProfileActivity.this, SingleCouponActivity.class);
99 + myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, offerItem);
100 + startActivity(myIntent);
101 + }
102 +
103 + @Override
104 + public void onFavoriteClick(OfferItem offerItem, int position) {
105 + // Handle favorite click if needed
106 + }
107 +
108 + @Override
109 + public void onCouponClick(CouponItem couponItem, int position) {
110 + Intent myIntent = new Intent(ProfileActivity.this, SingleCouponActivity.class);
111 + myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, couponItem);
112 + startActivity(myIntent);
113 + }
114 +
115 + @Override
116 + public void onFavoriteClick(CouponItem couponItem, int position) {
117 + // Handle favorite click if needed
118 + }
119 +
120 + // ===========================================================
121 + // Methods
122 + // ===========================================================
123 +
124 + private void initViews() {
125 + mIvBack = findViewById(R.id.iv_back);
126 + mIvBack.setOnClickListener(this);
127 +
128 + mTvHeaderTitle = findViewById(R.id.tv_header_title);
129 +
130 + // Initialize Profile Suggestions section
131 + mTvCategoryProfileSuggestions = findViewById(R.id.tv_recycler_category);
132 + mRvProfileSuggestions = findViewById(R.id.rl_recycler1);
133 + mTvAllProfileSuggestions = findViewById(R.id.tv_recycler_all);
134 +
135 + // Initialize My Coupons section
136 + mTvMyCouponsTitle = findViewById(R.id.tv_my_coupons_title);
137 + mRvCoupons = findViewById(R.id.rv_coupons);
138 + mBtnFilterActive = findViewById(R.id.btn_filter_active);
139 + mBtnFilterFavorites = findViewById(R.id.btn_filter_favorites);
140 + mBtnFilterRedeemed = findViewById(R.id.btn_filter_redeemed);
141 +
142 + // Set click listeners for filter buttons
143 + mBtnFilterActive.setOnClickListener(this);
144 + mBtnFilterFavorites.setOnClickListener(this);
145 + mBtnFilterRedeemed.setOnClickListener(this);
146 +
147 + WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle,
148 + mTvCategoryProfileSuggestions, mTvMyCouponsTitle);
149 + WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, mTvAllProfileSuggestions,
150 + mBtnFilterActive, mBtnFilterFavorites, mBtnFilterRedeemed);
151 + }
152 +
153 + /**
154 + * Set up the Profile Suggestions section with dummy data
155 + */
156 + private void setupProfileSuggestionsSection() {
157 + // Get Profile Suggestions data
158 + OfferCategory profileSuggestionsCategory = DummyDataProvider.getProfileSuggestions();
159 +
160 + // Set category title with item count
161 + String categoryTitle = profileSuggestionsCategory.getName() + " (" + profileSuggestionsCategory.getItems().size() + ")";
162 + mTvCategoryProfileSuggestions.setText(categoryTitle);
163 +
164 + // Set up RecyclerView
165 + LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
166 + mRvProfileSuggestions.setLayoutManager(layoutManager);
167 +
168 + // Add spacing between items
169 + int spacingInPixels = (int) TypedValue.applyDimension(
170 + TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
171 + mRvProfileSuggestions.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
172 +
173 + // Create and set adapter
174 + mProfileSuggestionsAdapter = new OfferAdapter(this, profileSuggestionsCategory.getItems());
175 + mProfileSuggestionsAdapter.setOnOfferClickListener(this);
176 + mRvProfileSuggestions.setAdapter(mProfileSuggestionsAdapter);
177 + }
178 +
179 + /**
180 + * Set up the My Coupons section with dummy data and filters
181 + */
182 + private void setupMyCouponsSection() {
183 + // Get coupons data
184 + mCouponItems = DummyDataProvider.getCoupons();
185 +
186 + // Set up RecyclerView
187 + LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
188 + mRvCoupons.setLayoutManager(layoutManager);
189 + mRvCoupons.setHasFixedSize(true);
190 +
191 + // Create and set adapter
192 + mCouponsAdapter = new CouponAdapter(this, mCouponItems);
193 + mCouponsAdapter.setOnCouponClickListener(this);
194 + mRvCoupons.setAdapter(mCouponsAdapter);
195 +
196 + // Add 16dp spacing between coupon items
197 + int verticalSpacingInPixels = (int) TypedValue.applyDimension(
198 + TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics());
199 + mRvCoupons.addItemDecoration(new VerticalSpaceItemDecoration(verticalSpacingInPixels));
200 +
201 + // Filter by active coupons by default
202 + filterCoupons(CouponItem.STATUS_ACTIVE);
203 + }
204 +
205 + /**
206 + * Filter coupons by status
207 + *
208 + * @param status The status to filter by
209 + */
210 + private void filterCoupons(String status) {
211 + // Reset all filter button styles
212 + mBtnFilterActive.setBackgroundResource(R.drawable.shape_transparent_black_border);
213 + mBtnFilterActive.setTextColor(getResources().getColor(R.color.black2));
214 +
215 + mBtnFilterFavorites.setBackgroundResource(R.drawable.shape_transparent_black_border);
216 + mBtnFilterFavorites.setTextColor(getResources().getColor(R.color.black2));
217 +
218 + mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_transparent_black_border);
219 + mBtnFilterRedeemed.setTextColor(getResources().getColor(R.color.black2));
220 +
221 + // Set selected filter button style
222 + if (CouponItem.STATUS_ACTIVE.equals(status)) {
223 + mBtnFilterActive.setBackgroundResource(R.drawable.shape_cos_black);
224 + mBtnFilterActive.setTextColor(Color.WHITE);
225 + } else if (CouponItem.STATUS_FAVORITE.equals(status)) {
226 + mBtnFilterFavorites.setBackgroundResource(R.drawable.shape_cos_black);
227 + mBtnFilterFavorites.setTextColor(Color.WHITE);
228 + } else if (CouponItem.STATUS_REDEEMED.equals(status)) {
229 + mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_cos_black);
230 + mBtnFilterRedeemed.setTextColor(Color.WHITE);
231 + }
232 +
233 + // Apply filter to adapter
234 + mCouponsAdapter.filterByStatus(status);
235 + }
236 +
237 + /**
238 + * Sets up the status bar to be white with dark icons
239 + */
240 + private void setupStatusBar() {
241 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
242 + // API 30+
243 + WindowInsetsController controller = getWindow().getInsetsController();
244 + if (controller != null) {
245 + controller.setSystemBarsAppearance(
246 + WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
247 + WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
248 + );
249 + }
250 + getWindow().setStatusBarColor(Color.WHITE);
251 + } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
252 + // API 23+
253 + getWindow().getDecorView().setSystemUiVisibility(
254 + View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
255 + );
256 + getWindow().setStatusBarColor(Color.WHITE);
257 + } else {
258 + // For older versions, just set a light gray color
259 + getWindow().setStatusBarColor(Color.parseColor("#F5F5F5"));
260 + }
261 + }
262 +
263 + // ===========================================================
264 + // Inner and Anonymous Classes
265 + // ===========================================================
266 +}
1 +package ly.warp.sdk.io.adapters;
2 +
3 +import android.content.Context;
4 +import android.util.TypedValue;
5 +import android.view.LayoutInflater;
6 +import android.view.View;
7 +import android.view.ViewGroup;
8 +import android.widget.ImageView;
9 +import android.widget.TextView;
10 +
11 +import androidx.annotation.NonNull;
12 +import androidx.recyclerview.widget.RecyclerView;
13 +
14 +import com.bumptech.glide.Glide;
15 +import com.bumptech.glide.load.resource.bitmap.CenterCrop;
16 +
17 +import java.text.ParseException;
18 +import java.text.SimpleDateFormat;
19 +import java.util.ArrayList;
20 +import java.util.Date;
21 +import java.util.List;
22 +import java.util.Locale;
23 +
24 +import ly.warp.sdk.R;
25 +import ly.warp.sdk.io.models.CouponItem;
26 +import ly.warp.sdk.utils.TopRoundedCornersTransformation;
27 +import ly.warp.sdk.utils.WarpUtils;
28 +
29 +/**
30 + * Adapter for displaying coupon items in a vertical RecyclerView
31 + */
32 +public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponViewHolder> {
33 +
34 + private final List<CouponItem> allCouponItems;
35 + private List<CouponItem> filteredCouponItems;
36 + private final Context context;
37 + private OnCouponClickListener listener;
38 + private String currentFilter = null;
39 +
40 + /**
41 + * Interface for handling coupon item clicks
42 + */
43 + public interface OnCouponClickListener {
44 + void onCouponClick(CouponItem couponItem, int position);
45 + void onFavoriteClick(CouponItem couponItem, int position);
46 + }
47 +
48 + /**
49 + * Constructor
50 + *
51 + * @param context The context
52 + * @param couponItems List of coupon items to display
53 + */
54 + public CouponAdapter(Context context, List<CouponItem> couponItems) {
55 + this.context = context;
56 + this.allCouponItems = couponItems;
57 + this.filteredCouponItems = new ArrayList<>(couponItems);
58 + }
59 +
60 + /**
61 + * Set click listener for coupon items
62 + *
63 + * @param listener The listener
64 + */
65 + public void setOnCouponClickListener(OnCouponClickListener listener) {
66 + this.listener = listener;
67 + }
68 +
69 + /**
70 + * Filter coupons by status
71 + *
72 + * @param status The status to filter by (active, favorite, redeemed) or null for all
73 + */
74 + public void filterByStatus(String status) {
75 + currentFilter = status;
76 + filteredCouponItems.clear();
77 +
78 + if (status == null) {
79 + // Show all coupons
80 + filteredCouponItems.addAll(allCouponItems);
81 + } else {
82 + // Filter by status
83 + for (CouponItem coupon : allCouponItems) {
84 + if (status.equals(coupon.getStatus())) {
85 + filteredCouponItems.add(coupon);
86 + }
87 + }
88 + }
89 +
90 + notifyDataSetChanged();
91 + }
92 +
93 + @NonNull
94 + @Override
95 + public CouponViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
96 + View view = LayoutInflater.from(context).inflate(R.layout.demo_item_coupon, parent, false);
97 + return new CouponViewHolder(view);
98 + }
99 +
100 + @Override
101 + public void onBindViewHolder(@NonNull CouponViewHolder holder, int position) {
102 + CouponItem couponItem = filteredCouponItems.get(position);
103 + holder.bind(couponItem, position);
104 + }
105 +
106 + @Override
107 + public int getItemCount() {
108 + return filteredCouponItems.size();
109 + }
110 +
111 + /**
112 + * ViewHolder for coupon items
113 + */
114 + class CouponViewHolder extends RecyclerView.ViewHolder {
115 + private final ImageView ivOfferImage;
116 + private final ImageView ivFavorite;
117 + private final ImageView ivLogo;
118 + private final TextView tvPrice;
119 + private final TextView tvTitle;
120 + private final TextView tvDescription;
121 + private final TextView tvValidity;
122 +
123 + CouponViewHolder(@NonNull View itemView) {
124 + 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);
128 + tvPrice = itemView.findViewById(R.id.tv_price);
129 + tvTitle = itemView.findViewById(R.id.tv_title);
130 + tvDescription = itemView.findViewById(R.id.tv_description);
131 + tvValidity = itemView.findViewById(R.id.tv_validity);
132 +
133 + WarpUtils.renderCustomFont(context, R.font.ping_lcg_bold, tvPrice, tvTitle);
134 + WarpUtils.renderCustomFont(context, R.font.ping_lcg_regular, tvDescription, tvValidity);
135 +
136 + // Set click listeners
137 + itemView.setOnClickListener(v -> {
138 + int position = getAdapterPosition();
139 + if (listener != null && position != RecyclerView.NO_POSITION) {
140 + listener.onCouponClick(filteredCouponItems.get(position), position);
141 + }
142 + });
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 + }
151 +
152 + void bind(CouponItem couponItem, int position) {
153 + // Set coupon data to views
154 + tvTitle.setText(couponItem.getTitle());
155 + tvDescription.setText(couponItem.getDescription());
156 + tvPrice.setText(couponItem.getValue());
157 + tvValidity.setText(formatValidityDate(couponItem.getEndDate()));
158 +
159 + // Set heart icon based on favorite status
160 + if (couponItem.isFavorite()) {
161 + // Use pressed/filled heart for Favorites
162 + ivFavorite.setImageResource(R.drawable.demo_heart_pressed);
163 + } else {
164 + // Use default/empty heart for other statuses
165 + ivFavorite.setImageResource(R.drawable.demo_heart);
166 + }
167 +
168 + // Load images from resources
169 + loadOfferImage(couponItem.getImageUrl());
170 + loadLogoImage(couponItem.getLogoUrl());
171 + }
172 +
173 + /**
174 + * Format the end date to "έως dd-MM" format
175 + *
176 + * @param endDate The end date in "dd/MM/yyyy" format
177 + * @return Formatted date string
178 + */
179 + private String formatValidityDate(String endDate) {
180 + try {
181 + SimpleDateFormat inputFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault());
182 + Date date = inputFormat.parse(endDate);
183 +
184 + SimpleDateFormat outputFormat = new SimpleDateFormat("dd-MM", Locale.getDefault());
185 + return "έως " + outputFormat.format(date);
186 +
187 + } catch (ParseException e) {
188 + // Fallback to original if parsing fails
189 + return endDate;
190 + }
191 + }
192 +
193 + /**
194 + * Load offer image with rounded top corners using Glide
195 + *
196 + * @param imageName The image resource name
197 + */
198 + private void loadOfferImage(String imageName) {
199 + try {
200 + // Remove file extension if present
201 + if (imageName.contains(".")) {
202 + imageName = imageName.substring(0, imageName.lastIndexOf('.'));
203 + }
204 +
205 + // Get resource ID by name
206 + int resourceId = context.getResources().getIdentifier(
207 + imageName, "drawable", context.getPackageName());
208 +
209 + if (resourceId != 0) {
210 + // Convert 9dp to pixels
211 + int radiusInPixels = (int) TypedValue.applyDimension(
212 + TypedValue.COMPLEX_UNIT_DIP, 9,
213 + context.getResources().getDisplayMetrics());
214 +
215 + // Load with Glide and apply transformations
216 + Glide.with(context)
217 + .load(resourceId)
218 + .transform(new CenterCrop(), new TopRoundedCornersTransformation(radiusInPixels))
219 + .into(ivOfferImage);
220 + }
221 + } catch (Exception e) {
222 + e.printStackTrace();
223 + }
224 + }
225 +
226 + /**
227 + * Load logo image without transformations
228 + *
229 + * @param imageName The image resource name
230 + */
231 + private void loadLogoImage(String imageName) {
232 + try {
233 + // Remove file extension if present
234 + if (imageName.contains(".")) {
235 + imageName = imageName.substring(0, imageName.lastIndexOf('.'));
236 + }
237 +
238 + // Get resource ID by name
239 + int resourceId = context.getResources().getIdentifier(
240 + imageName, "drawable", context.getPackageName());
241 +
242 + if (resourceId != 0) {
243 + // Load logo normally without transformations
244 + ivLogo.setImageResource(resourceId);
245 + }
246 + } catch (Exception e) {
247 + e.printStackTrace();
248 + }
249 + }
250 + }
251 +}
1 +package ly.warp.sdk.io.models;
2 +
3 +/**
4 + * Model class representing a coupon item to be displayed in the profile screen.
5 + * Extends OfferItem with additional status field.
6 + */
7 +public class CouponItem extends OfferItem {
8 +
9 + // Coupon status constants
10 + public static final String STATUS_ACTIVE = "active";
11 + public static final String STATUS_FAVORITE = "favorite";
12 + public static final String STATUS_REDEEMED = "redeemed";
13 +
14 + private String status;
15 +
16 + /**
17 + * Default constructor
18 + */
19 + public CouponItem() {
20 + super();
21 + }
22 +
23 + /**
24 + * Full constructor for creating a coupon item
25 + *
26 + * @param id Unique identifier for the coupon
27 + * @param title Title of the coupon
28 + * @param description Short description of the coupon
29 + * @param fullDescription Detailed description of the coupon
30 + * @param endDate End date of the coupon (formatted as string)
31 + * @param value Value of the coupon (formatted as string, e.g., "50%", "€20")
32 + * @param imageUrl URL or resource name for the coupon image
33 + * @param logoUrl URL or resource name for the merchant logo
34 + * @param category Category this coupon belongs to
35 + * @param status Status of the coupon (active, favorite, redeemed)
36 + */
37 + public CouponItem(String id, String title, String description, String fullDescription, String endDate,
38 + String value, String imageUrl, String logoUrl, String category, String status) {
39 + super(id, title, description, fullDescription, endDate, value, imageUrl, logoUrl, category);
40 + this.status = status;
41 + }
42 +
43 + /**
44 + * Constructor for backward compatibility
45 + *
46 + * @param id Unique identifier for the coupon
47 + * @param title Title of the coupon
48 + * @param description Description of the coupon
49 + * @param endDate End date of the coupon (formatted as string)
50 + * @param value Value of the coupon (formatted as string, e.g., "50%", "€20")
51 + * @param imageUrl URL or resource name for the coupon image
52 + * @param logoUrl URL or resource name for the merchant logo
53 + * @param category Category this coupon belongs to
54 + * @param status Status of the coupon (active, favorite, redeemed)
55 + */
56 + public CouponItem(String id, String title, String description, String endDate,
57 + String value, String imageUrl, String logoUrl, String category, String status) {
58 + super(id, title, description, endDate, value, imageUrl, logoUrl, category);
59 + this.status = status;
60 + }
61 +
62 + /**
63 + * Constructor from an existing OfferItem with added status
64 + *
65 + * @param offerItem The offer item to convert
66 + * @param status Status of the coupon (active, favorite, redeemed)
67 + */
68 + public CouponItem(OfferItem offerItem, String status) {
69 + super(offerItem.getId(), offerItem.getTitle(), offerItem.getDescription(),
70 + offerItem.getFullDescription(), offerItem.getEndDate(), offerItem.getValue(),
71 + offerItem.getImageUrl(), offerItem.getLogoUrl(), offerItem.getCategory());
72 + this.status = status;
73 + }
74 +
75 + // Getters and Setters
76 +
77 + public String getStatus() {
78 + return status;
79 + }
80 +
81 + public void setStatus(String status) {
82 + this.status = status;
83 + }
84 +
85 + /**
86 + * Check if the coupon is active
87 + * @return true if active, false otherwise
88 + */
89 + public boolean isActive() {
90 + return STATUS_ACTIVE.equals(status);
91 + }
92 +
93 + /**
94 + * Check if the coupon is a favorite
95 + * @return true if favorite, false otherwise
96 + */
97 + public boolean isFavorite() {
98 + return STATUS_FAVORITE.equals(status);
99 + }
100 +
101 + /**
102 + * Check if the coupon is redeemed
103 + * @return true if redeemed, false otherwise
104 + */
105 + public boolean isRedeemed() {
106 + return STATUS_REDEEMED.equals(status);
107 + }
108 +}
...@@ -21,9 +21,14 @@ public class DummyDataProvider { ...@@ -21,9 +21,14 @@ public class DummyDataProvider {
21 public static final String CATEGORY_TRAVELLING = "travelling"; 21 public static final String CATEGORY_TRAVELLING = "travelling";
22 public static final String CATEGORY_KIDS = "kids"; 22 public static final String CATEGORY_KIDS = "kids";
23 public static final String CATEGORY_PURCHASES = "purchases"; 23 public static final String CATEGORY_PURCHASES = "purchases";
24 + public static final String CATEGORY_PROFILE_SUGGESTIONS = "profile_suggestions";
25 + public static final String CATEGORY_MY_COUPONS = "my_coupons";
24 26
25 // Cache for categories 27 // Cache for categories
26 private static Map<String, OfferCategory> categoryCache = new HashMap<>(); 28 private static Map<String, OfferCategory> categoryCache = new HashMap<>();
29 +
30 + // Cache for coupons
31 + private static List<CouponItem> couponCache;
27 32
28 /** 33 /**
29 * Get all categories with their items 34 * Get all categories with their items
...@@ -40,6 +45,7 @@ public class DummyDataProvider { ...@@ -40,6 +45,7 @@ public class DummyDataProvider {
40 categories.add(getTravelling()); 45 categories.add(getTravelling());
41 categories.add(getKids()); 46 categories.add(getKids());
42 categories.add(getPurchases()); 47 categories.add(getPurchases());
48 + categories.add(getProfileSuggestions());
43 return categories; 49 return categories;
44 } 50 }
45 51
...@@ -80,6 +86,14 @@ public class DummyDataProvider { ...@@ -80,6 +86,14 @@ public class DummyDataProvider {
80 case CATEGORY_PURCHASES: 86 case CATEGORY_PURCHASES:
81 category = getPurchases(); 87 category = getPurchases();
82 break; 88 break;
89 + case CATEGORY_PROFILE_SUGGESTIONS:
90 + category = getProfileSuggestions();
91 + break;
92 + case CATEGORY_MY_COUPONS:
93 + // For coupons, we don't return a category but individual items
94 + // This is just a placeholder to maintain consistency
95 + category = new OfferCategory(CATEGORY_MY_COUPONS, "Τα κουπόνια μου");
96 + break;
83 } 97 }
84 98
85 if (category != null) { 99 if (category != null) {
...@@ -735,4 +749,123 @@ public class DummyDataProvider { ...@@ -735,4 +749,123 @@ public class DummyDataProvider {
735 749
736 return category; 750 return category;
737 } 751 }
752 +
753 + /**
754 + * Get Profile Suggestions category with items
755 + *
756 + * @return Profile Suggestions category
757 + */
758 + public static OfferCategory getProfileSuggestions() {
759 + OfferCategory category = new OfferCategory(CATEGORY_PROFILE_SUGGESTIONS, "Προτάσεις για εσένα");
760 +
761 + category.addItem(new OfferItem("ps1", "Έκπτωση 30% σε Online Αγορές",
762 + "Αποκλειστική έκπτωση για αγορές από το e-shop μας",
763 + "Απολαύστε έκπτωση 30% σε όλες τις online αγορές σας από το e-shop μας. Η προσφορά ισχύει για όλες τις κατηγορίες προϊόντων, συμπεριλαμβανομένων ηλεκτρονικών συσκευών, ρούχων, αξεσουάρ και ειδών σπιτιού. Δωρεάν παράδοση για παραγγελίες άνω των €50 και εύκολη διαδικασία επιστροφής εντός 30 ημερών.",
764 + "31/08/2025", "30%", "demo_profile_offer1.png", "demo_profile_offer1.png", CATEGORY_PROFILE_SUGGESTIONS));
765 +
766 + category.addItem(new OfferItem("ps2", "Δωρεάν Μεταφορικά στο Online Φαρμακείο",
767 + "Για αγορές άνω των €30 σε προϊόντα υγείας και ομορφιάς",
768 + "Κάντε τις αγορές σας από το online φαρμακείο μας και απολαύστε δωρεάν μεταφορικά για παραγγελίες άνω των €30. Η προσφορά ισχύει για όλα τα προϊόντα υγείας, ομορφιάς, προσωπικής φροντίδας και συμπληρώματα διατροφής. Παράδοση την επόμενη εργάσιμη ημέρα για παραγγελίες έως τις 2μμ.",
769 + "30/09/2025", "€0", "demo_profile_offer2.png", "demo_profile_offer2.png", CATEGORY_PROFILE_SUGGESTIONS));
770 +
771 + category.addItem(new OfferItem("ps3", "Online Αγορές Σούπερ Μάρκετ",
772 + "15% έκπτωση στην πρώτη σας online παραγγελία",
773 + "Ανακαλύψτε την ευκολία των online αγορών σούπερ μάρκετ με 15% έκπτωση στην πρώτη σας παραγγελία. Επιλέξτε από χιλιάδες προϊόντα, από φρέσκα τρόφιμα μέχρι είδη καθαρισμού και προσωπικής φροντίδας. Παράδοση την ίδια μέρα για παραγγελίες έως τις 12μμ ή επιλέξτε την ημέρα και ώρα που σας εξυπηρετεί.",
774 + "31/12/2025", "15%", "demo_profile_offer3.png", "demo_profile_offer3.png", CATEGORY_PROFILE_SUGGESTIONS));
775 +
776 + category.addItem(new OfferItem("ps4", "Ηλεκτρονικά Είδη με Έκπτωση",
777 + "Έως 25% έκπτωση σε επιλεγμένα ηλεκτρονικά είδη online",
778 + "Αναβαθμίστε τις συσκευές σας με έως 25% έκπτωση σε επιλεγμένα ηλεκτρονικά είδη από το online κατάστημά μας. Η προσφορά περιλαμβάνει smartphones, tablets, laptops, τηλεοράσεις και αξεσουάρ από κορυφαίες μάρκες. Δωρεάν τεχνική υποστήριξη για 1 χρόνο και εγγύηση 2 ετών σε όλα τα προϊόντα.",
779 + "31/07/2025", "25%", "demo_profile_offer4.png", "demo_profile_offer4.png", CATEGORY_PROFILE_SUGGESTIONS));
780 +
781 + category.addItem(new OfferItem("ps5", "Online Αγορές Ρούχων",
782 + "Αγοράστε 2 είδη και πάρτε το 3ο δωρεάν",
783 + "Ανανεώστε τη γκαρνταρόμπα σας με την προσφορά 2+1 στο online κατάστημα ρούχων μας. Αγοράστε 2 είδη και πάρτε το 3ο εντελώς δωρεάν. Η προσφορά ισχύει για όλες τις κατηγορίες ρούχων και αξεσουάρ, συμπεριλαμβανομένων των νέων συλλογών. Το είδος με τη χαμηλότερη τιμή προσφέρεται δωρεάν.",
784 + "31/08/2025", "100%", "demo_profile_offer5.png", "demo_profile_offer5.png", CATEGORY_PROFILE_SUGGESTIONS));
785 +
786 + return category;
787 + }
788 +
789 + /**
790 + * Get all coupons
791 + *
792 + * @return List of all coupon items
793 + */
794 + public static List<CouponItem> getCoupons() {
795 + if (couponCache != null) {
796 + return couponCache;
797 + }
798 +
799 + List<CouponItem> coupons = new ArrayList<>();
800 +
801 + // Add 5 dummy coupon items with different statuses
802 +
803 + // Active coupon - Pizza offer
804 + coupons.add(new CouponItem(
805 + "c1",
806 + "Μόνο 17,95",
807 + "2 πίτσες & Coca-Cola 1,5lt",
808 + "Απολαύστε 2 μεσαίες πίτσες της επιλογής σας και ένα αναψυκτικό Coca-Cola 1,5lt σε ειδική τιμή. Η προσφορά ισχύει για παραλαβή από το κατάστημα ή delivery. Μπορείτε να επιλέξετε οποιαδήποτε πίτσα από τον κατάλογο εκτός από τις premium επιλογές. Ιδανικό για οικογενειακό γεύμα ή παρέα με φίλους.",
809 + "30/09/2025",
810 + "17,95€",
811 + "demo_image_dominos.png",
812 + "demo_dominos.png",
813 + CATEGORY_MY_COUPONS,
814 + CouponItem.STATUS_ACTIVE));
815 +
816 + // Active coupon - Coffee offer
817 + coupons.add(new CouponItem(
818 + "c2",
819 + "Καφές & Σνακ",
820 + "Combo προσφορά για όλη την ημέρα",
821 + "Απολαύστε έναν καφέ της επιλογής σας (espresso, cappuccino, latte) και ένα σνακ (κρουασάν, σάντουιτς ή μπισκότα) σε ειδική τιμή. Η προσφορά ισχύει όλη την ημέρα σε όλα τα καταστήματα της αλυσίδας. Ιδανικό για ένα γρήγορο διάλειμμα ή πρωινό στο δρόμο για τη δουλειά.",
822 + "31/08/2025",
823 + "3,50€",
824 + "demo_image_coffee.png",
825 + "demo_coffee.png",
826 + CATEGORY_MY_COUPONS,
827 + CouponItem.STATUS_ACTIVE));
828 +
829 + // Favorite coupon - Car rental
830 + coupons.add(new CouponItem(
831 + "c3",
832 + "Ενοικίαση Αυτοκινήτου",
833 + "20% έκπτωση για Σαββατοκύριακο",
834 + "Εξοικονομήστε 20% στην ενοικίαση αυτοκινήτου για το Σαββατοκύριακο. Η προσφορά ισχύει για όλες τις κατηγορίες οχημάτων και περιλαμβάνει απεριόριστα χιλιόμετρα και βασική ασφάλεια. Κάντε κράτηση τουλάχιστον 3 ημέρες πριν και απολαύστε το ταξίδι σας με άνεση και οικονομία.",
835 + "31/12/2025",
836 + "20%",
837 + "demo_image_avis.png",
838 + "demo_avis.png",
839 + CATEGORY_MY_COUPONS,
840 + CouponItem.STATUS_FAVORITE));
841 +
842 + // Redeemed coupon - Restaurant
843 + coupons.add(new CouponItem(
844 + "c4",
845 + "Γεύμα για Δύο",
846 + "Πλήρες μενού με κρασί",
847 + "Απολαύστε ένα πλήρες γεύμα για δύο άτομα που περιλαμβάνει ορεκτικό, σαλάτα, κυρίως πιάτο, επιδόρπιο και ένα μπουκάλι κρασί. Η προσφορά ισχύει για όλα τα καταστήματα της αλυσίδας, από Δευτέρα έως Πέμπτη. Απαραίτητη η κράτηση τουλάχιστον 24 ώρες νωρίτερα.",
848 + "30/06/2025",
849 + "45€",
850 + "demo_image_ranch.png",
851 + "demo_ranch.png",
852 + CATEGORY_MY_COUPONS,
853 + CouponItem.STATUS_REDEEMED));
854 +
855 + // Favorite coupon - Electronics
856 + coupons.add(new CouponItem(
857 + "c5",
858 + "Έκπτωση σε Ηλεκτρονικά",
859 + "15% σε όλα τα αξεσουάρ κινητών",
860 + "Αποκτήστε όλα τα αξεσουάρ για το κινητό σας με έκπτωση 15%. Η προσφορά περιλαμβάνει θήκες, προστατευτικά οθόνης, φορτιστές, ακουστικά και power banks. Όλα τα προϊόντα είναι επώνυμα και συνοδεύονται από εγγύηση 2 ετών. Η προσφορά ισχύει τόσο online όσο και στα φυσικά καταστήματα.",
861 + "31/07/2025",
862 + "15%",
863 + "demo_image_migato.png",
864 + "demo_migato.png",
865 + CATEGORY_MY_COUPONS,
866 + CouponItem.STATUS_FAVORITE));
867 +
868 + couponCache = coupons;
869 + return coupons;
870 + }
738 } 871 }
......
...@@ -179,7 +179,6 @@ public class WarplyManagerHelper { ...@@ -179,7 +179,6 @@ public class WarplyManagerHelper {
179 params.putOpt("refresh_token", WarplyDBHelper.getInstance(context).getAuthValue("refresh_token")); 179 params.putOpt("refresh_token", WarplyDBHelper.getInstance(context).getAuthValue("refresh_token"));
180 params.putOpt("client_id", WarplyDBHelper.getInstance(context).getClientValue("client_id")); 180 params.putOpt("client_id", WarplyDBHelper.getInstance(context).getClientValue("client_id"));
181 params.putOpt("client_secret", WarplyDBHelper.getInstance(context).getClientValue("client_secret")); 181 params.putOpt("client_secret", WarplyDBHelper.getInstance(context).getClientValue("client_secret"));
182 - params.putOpt("map", "true");
183 params.putOpt("lan", WarpUtils.getApplicationLocale(context)); 182 params.putOpt("lan", WarpUtils.getApplicationLocale(context));
184 params.putOpt("dark", String.valueOf(WarpUtils.getIsDarkModeEnabled(context))); 183 params.putOpt("dark", String.valueOf(WarpUtils.getIsDarkModeEnabled(context)));
185 } catch (JSONException e) { 184 } catch (JSONException e) {
......
1 +package ly.warp.sdk.views;
2 +
3 +import android.graphics.Rect;
4 +import android.view.View;
5 +
6 +import androidx.annotation.NonNull;
7 +import androidx.recyclerview.widget.RecyclerView;
8 +
9 +/**
10 + * ItemDecoration for adding vertical spacing between RecyclerView items.
11 + * Adds spacing to the bottom of each item except the last one.
12 + */
13 +public class VerticalSpaceItemDecoration extends RecyclerView.ItemDecoration {
14 + private final int spaceHeight;
15 +
16 + /**
17 + * Constructor
18 + *
19 + * @param spaceHeight Space height in pixels
20 + */
21 + public VerticalSpaceItemDecoration(int spaceHeight) {
22 + this.spaceHeight = spaceHeight;
23 + }
24 +
25 + @Override
26 + public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
27 + // Add spacing to the bottom of each item except the last one
28 + int position = parent.getChildAdapterPosition(view);
29 + if (position != RecyclerView.NO_POSITION && position != parent.getAdapter().getItemCount() - 1) {
30 + outRect.bottom = spaceHeight;
31 + }
32 + }
33 +}
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
84 <RelativeLayout 84 <RelativeLayout
85 android:layout_width="match_parent" 85 android:layout_width="match_parent"
86 android:layout_height="wrap_content" 86 android:layout_height="wrap_content"
87 - android:layout_marginTop="48dp"> 87 + android:layout_marginTop="24dp">
88 88
89 <LinearLayout 89 <LinearLayout
90 android:id="@+id/ll_recycler1" 90 android:id="@+id/ll_recycler1"
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
109 android:layout_height="wrap_content" 109 android:layout_height="wrap_content"
110 android:background="@drawable/demo_shape_transparent_border_black" 110 android:background="@drawable/demo_shape_transparent_border_black"
111 android:paddingHorizontal="16dp" 111 android:paddingHorizontal="16dp"
112 - android:paddingVertical="6dp" 112 + android:paddingVertical="5dp"
113 android:text="@string/demo_all" 113 android:text="@string/demo_all"
114 android:textColor="@color/black3" 114 android:textColor="@color/black3"
115 android:textSize="14sp" /> 115 android:textSize="14sp" />
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
155 android:layout_height="wrap_content" 155 android:layout_height="wrap_content"
156 android:background="@drawable/demo_shape_transparent_border_black" 156 android:background="@drawable/demo_shape_transparent_border_black"
157 android:paddingHorizontal="16dp" 157 android:paddingHorizontal="16dp"
158 - android:paddingVertical="6dp" 158 + android:paddingVertical="5dp"
159 android:text="@string/demo_all" 159 android:text="@string/demo_all"
160 android:textColor="@color/black3" 160 android:textColor="@color/black3"
161 android:textSize="14sp" /> 161 android:textSize="14sp" />
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
201 android:layout_height="wrap_content" 201 android:layout_height="wrap_content"
202 android:background="@drawable/demo_shape_transparent_border_black" 202 android:background="@drawable/demo_shape_transparent_border_black"
203 android:paddingHorizontal="16dp" 203 android:paddingHorizontal="16dp"
204 - android:paddingVertical="6dp" 204 + android:paddingVertical="5dp"
205 android:text="@string/demo_all" 205 android:text="@string/demo_all"
206 android:textColor="@color/black3" 206 android:textColor="@color/black3"
207 android:textSize="14sp" /> 207 android:textSize="14sp" />
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
247 android:layout_height="wrap_content" 247 android:layout_height="wrap_content"
248 android:background="@drawable/demo_shape_transparent_border_black" 248 android:background="@drawable/demo_shape_transparent_border_black"
249 android:paddingHorizontal="16dp" 249 android:paddingHorizontal="16dp"
250 - android:paddingVertical="6dp" 250 + android:paddingVertical="5dp"
251 android:text="@string/demo_all" 251 android:text="@string/demo_all"
252 android:textColor="@color/black3" 252 android:textColor="@color/black3"
253 android:textSize="14sp" /> 253 android:textSize="14sp" />
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
293 android:layout_height="wrap_content" 293 android:layout_height="wrap_content"
294 android:background="@drawable/demo_shape_transparent_border_black" 294 android:background="@drawable/demo_shape_transparent_border_black"
295 android:paddingHorizontal="16dp" 295 android:paddingHorizontal="16dp"
296 - android:paddingVertical="6dp" 296 + android:paddingVertical="5dp"
297 android:text="@string/demo_all" 297 android:text="@string/demo_all"
298 android:textColor="@color/black3" 298 android:textColor="@color/black3"
299 android:textSize="14sp" /> 299 android:textSize="14sp" />
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
339 android:layout_height="wrap_content" 339 android:layout_height="wrap_content"
340 android:background="@drawable/demo_shape_transparent_border_black" 340 android:background="@drawable/demo_shape_transparent_border_black"
341 android:paddingHorizontal="16dp" 341 android:paddingHorizontal="16dp"
342 - android:paddingVertical="6dp" 342 + android:paddingVertical="5dp"
343 android:text="@string/demo_all" 343 android:text="@string/demo_all"
344 android:textColor="@color/black3" 344 android:textColor="@color/black3"
345 android:textSize="14sp" /> 345 android:textSize="14sp" />
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
385 android:layout_height="wrap_content" 385 android:layout_height="wrap_content"
386 android:background="@drawable/demo_shape_transparent_border_black" 386 android:background="@drawable/demo_shape_transparent_border_black"
387 android:paddingHorizontal="16dp" 387 android:paddingHorizontal="16dp"
388 - android:paddingVertical="6dp" 388 + android:paddingVertical="5dp"
389 android:text="@string/demo_all" 389 android:text="@string/demo_all"
390 android:textColor="@color/black3" 390 android:textColor="@color/black3"
391 android:textSize="14sp" /> 391 android:textSize="14sp" />
...@@ -432,7 +432,7 @@ ...@@ -432,7 +432,7 @@
432 android:layout_height="wrap_content" 432 android:layout_height="wrap_content"
433 android:background="@drawable/demo_shape_transparent_border_black" 433 android:background="@drawable/demo_shape_transparent_border_black"
434 android:paddingHorizontal="16dp" 434 android:paddingHorizontal="16dp"
435 - android:paddingVertical="6dp" 435 + android:paddingVertical="5dp"
436 android:text="@string/demo_all" 436 android:text="@string/demo_all"
437 android:textColor="@color/black3" 437 android:textColor="@color/black3"
438 android:textSize="14sp" /> 438 android:textSize="14sp" />
......
1 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 + xmlns:app="http://schemas.android.com/apk/res-auto"
3 + xmlns:tools="http://schemas.android.com/tools"
4 + android:layout_width="match_parent"
5 + android:layout_height="match_parent"
6 + android:background="@color/cos_grey_light">
7 +
8 + <androidx.core.widget.NestedScrollView
9 + android:id="@+id/profile_scrollview"
10 + android:layout_width="match_parent"
11 + android:layout_height="match_parent"
12 + android:fillViewport="true">
13 +
14 + <LinearLayout
15 + android:id="@+id/profile_content_container"
16 + android:layout_width="match_parent"
17 + android:layout_height="wrap_content"
18 + android:orientation="vertical">
19 +
20 + <LinearLayout
21 + android:id="@+id/header_layout"
22 + android:layout_width="match_parent"
23 + android:layout_height="wrap_content"
24 + android:layout_gravity="center"
25 + android:background="@color/white"
26 + android:orientation="horizontal"
27 + android:padding="16dp">
28 +
29 + <LinearLayout
30 + android:layout_width="0dp"
31 + android:layout_height="wrap_content"
32 + android:gravity="center_vertical"
33 + android:layout_weight="1"
34 + android:orientation="horizontal">
35 +
36 + <ImageView
37 + android:id="@+id/iv_back"
38 + android:layout_width="16dp"
39 + android:layout_height="16dp"
40 + android:layout_marginEnd="24dp"
41 + android:src="@drawable/ic_back" />
42 +
43 + <TextView
44 + android:id="@+id/tv_header_title"
45 + android:layout_width="wrap_content"
46 + android:layout_height="wrap_content"
47 + android:includeFontPadding="false"
48 + android:text="@string/demo_profile"
49 + android:textColor="@color/black4"
50 + android:textSize="16sp" />
51 + </LinearLayout>
52 + </LinearLayout>
53 +
54 + <LinearLayout
55 + android:id="@+id/profile_layout"
56 + android:layout_width="match_parent"
57 + android:layout_height="wrap_content"
58 + android:layout_gravity="center"
59 + android:layout_marginTop="8dp"
60 + android:background="@color/cos_grey_light"
61 + android:orientation="horizontal"
62 + android:padding="16dp">
63 +
64 + <LinearLayout
65 + android:layout_width="0dp"
66 + android:layout_height="wrap_content"
67 + android:layout_gravity="center"
68 + android:layout_weight="1"
69 + android:orientation="horizontal">
70 +
71 + <ImageView
72 + android:id="@+id/green_icon"
73 + android:layout_width="58dp"
74 + android:layout_height="22dp"
75 + android:layout_marginEnd="8dp"
76 + android:src="@drawable/demo_green" />
77 +
78 + <ImageView
79 + android:id="@+id/family_icon"
80 + android:layout_width="58dp"
81 + android:layout_height="22dp"
82 + android:src="@drawable/demo_family" />
83 + </LinearLayout>
84 +
85 + <ImageView
86 + android:id="@+id/profile_icon"
87 + android:layout_width="40dp"
88 + android:layout_height="40dp"
89 + android:src="@drawable/demo_profile" />
90 + </LinearLayout>
91 +
92 + <ImageView
93 + android:id="@+id/profile_questionnaire"
94 + android:layout_width="match_parent"
95 + android:layout_height="160dp"
96 + android:layout_marginTop="16dp"
97 + android:paddingHorizontal="16dp"
98 + android:src="@drawable/demo_questionnaire" />
99 +
100 + <!-- Profile Suggestions Section -->
101 + <RelativeLayout
102 + android:id="@+id/profile_suggestions_section"
103 + android:layout_width="match_parent"
104 + android:layout_height="wrap_content"
105 + android:layout_marginTop="40dp">
106 +
107 + <LinearLayout
108 + android:id="@+id/ll_recycler"
109 + android:layout_width="match_parent"
110 + android:layout_height="wrap_content"
111 + android:layout_gravity="center"
112 + android:orientation="horizontal"
113 + android:paddingHorizontal="16dp">
114 +
115 + <TextView
116 + android:id="@+id/tv_recycler_category"
117 + android:layout_width="0dp"
118 + android:layout_height="wrap_content"
119 + android:layout_weight="1"
120 + android:textColor="@color/black2"
121 + android:textSize="16sp"
122 + tools:text="Προτάσεις για εσένα (5)" />
123 +
124 + <TextView
125 + android:id="@+id/tv_recycler_all"
126 + android:layout_width="wrap_content"
127 + android:layout_height="wrap_content"
128 + android:background="@drawable/demo_shape_transparent_border_black"
129 + android:paddingHorizontal="16dp"
130 + android:paddingVertical="5dp"
131 + android:text="@string/demo_all"
132 + android:textColor="@color/black3"
133 + android:textSize="14sp" />
134 + </LinearLayout>
135 +
136 + <androidx.recyclerview.widget.RecyclerView
137 + android:id="@+id/rl_recycler1"
138 + android:layout_width="match_parent"
139 + android:layout_height="wrap_content"
140 + android:layout_below="@+id/ll_recycler"
141 + android:layout_marginTop="16dp"
142 + android:clipToPadding="false"
143 + android:orientation="horizontal"
144 + android:paddingHorizontal="16dp" />
145 + </RelativeLayout>
146 +
147 + <!-- My Coupons Section -->
148 + <RelativeLayout
149 + android:id="@+id/my_coupons_section"
150 + android:layout_width="match_parent"
151 + android:layout_height="wrap_content"
152 + android:layout_marginTop="40dp"
153 + android:background="@color/white"
154 + android:paddingVertical="16dp">
155 +
156 + <TextView
157 + android:id="@+id/tv_my_coupons_title"
158 + android:layout_width="match_parent"
159 + android:layout_height="wrap_content"
160 + android:layout_marginVertical="8dp"
161 + android:paddingHorizontal="16dp"
162 + android:text="@string/demo_my_coupons"
163 + android:textColor="@color/black2"
164 + android:textSize="16sp" />
165 +
166 + <!-- Filter Buttons -->
167 + <LinearLayout
168 + android:id="@+id/ll_coupon_filters"
169 + android:layout_width="match_parent"
170 + android:layout_height="wrap_content"
171 + android:layout_below="@id/tv_my_coupons_title"
172 + android:layout_marginTop="32dp"
173 + android:orientation="horizontal"
174 + android:paddingHorizontal="16dp">
175 +
176 + <TextView
177 + android:id="@+id/btn_filter_active"
178 + android:layout_width="0dp"
179 + android:layout_height="wrap_content"
180 + android:layout_marginEnd="8dp"
181 + android:layout_weight="1"
182 + android:background="@drawable/shape_cos_black"
183 + android:gravity="center"
184 + android:paddingVertical="8dp"
185 + android:text="@string/demo_active"
186 + android:textColor="@android:color/white"
187 + android:textSize="14sp" />
188 +
189 + <TextView
190 + android:id="@+id/btn_filter_favorites"
191 + android:layout_width="0dp"
192 + android:layout_height="wrap_content"
193 + android:layout_marginEnd="8dp"
194 + android:layout_weight="1"
195 + android:background="@drawable/shape_transparent_black_border"
196 + android:gravity="center"
197 + android:paddingVertical="8dp"
198 + android:text="@string/demo_favorites"
199 + android:textColor="@color/black2"
200 + android:textSize="14sp" />
201 +
202 + <TextView
203 + android:id="@+id/btn_filter_redeemed"
204 + android:layout_width="0dp"
205 + android:layout_height="wrap_content"
206 + android:layout_weight="1"
207 + android:background="@drawable/shape_transparent_black_border"
208 + android:gravity="center"
209 + android:paddingVertical="8dp"
210 + android:text="@string/demo_redeemed"
211 + android:textColor="@color/black2"
212 + android:textSize="14sp" />
213 + </LinearLayout>
214 +
215 + <!-- Vertical RecyclerView for Coupons -->
216 + <androidx.recyclerview.widget.RecyclerView
217 + android:id="@+id/rv_coupons"
218 + android:layout_width="match_parent"
219 + android:layout_height="wrap_content"
220 + android:layout_below="@id/ll_coupon_filters"
221 + android:layout_marginTop="32dp"
222 + android:clipToPadding="false"
223 + android:nestedScrollingEnabled="false"
224 + android:paddingHorizontal="16dp" />
225 + </RelativeLayout>
226 + </LinearLayout>
227 + </androidx.core.widget.NestedScrollView>
228 +</RelativeLayout>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <LinearLayout 29 <LinearLayout
30 android:layout_width="0dp" 30 android:layout_width="0dp"
31 android:layout_height="wrap_content" 31 android:layout_height="wrap_content"
32 - android:layout_gravity="center" 32 + android:gravity="center_vertical"
33 android:layout_weight="1" 33 android:layout_weight="1"
34 android:orientation="horizontal"> 34 android:orientation="horizontal">
35 35
......
1 +<?xml version="1.0" encoding="utf-8"?>
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"
5 + android:layout_width="match_parent"
6 + android:layout_height="280dp"
7 + android:background="@drawable/demo_shape_white_border_grey">
8 +
9 + <ImageView
10 + android:id="@+id/iv_offer_image"
11 + android:layout_width="match_parent"
12 + android:layout_height="160dp"
13 + android:scaleType="centerCrop"
14 + tools:src="@drawable/demo_home_banner1" />
15 +
16 + <ImageView
17 + android:id="@+id/iv_favorite"
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"
46 + android:orientation="vertical"
47 + app:layout_constraintGuide_percent="0.7" />
48 +
49 + <!-- Title -->
50 + <TextView
51 + android:id="@+id/tv_title"
52 + android:layout_width="0dp"
53 + android:layout_height="wrap_content"
54 + android:maxLines="1"
55 + android:textColor="@color/black2"
56 + android:textSize="21sp"
57 + app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
58 + app:layout_constraintStart_toStartOf="parent"
59 + app:layout_constraintTop_toTopOf="parent"
60 + tools:text="Móvo 17,95" />
61 +
62 + <!-- Description -->
63 + <TextView
64 + android:id="@+id/tv_description"
65 + android:layout_width="0dp"
66 + android:layout_height="wrap_content"
67 + android:maxLines="2"
68 + android:textColor="@color/black3"
69 + android:textSize="15sp"
70 + app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
71 + app:layout_constraintStart_toStartOf="parent"
72 + app:layout_constraintTop_toBottomOf="@+id/tv_title"
73 + tools:text="2 πίτσες &amp; Coca-COLA 1,5lt" />
74 +
75 + <!-- Validity Date -->
76 + <TextView
77 + android:id="@+id/tv_validity"
78 + android:layout_width="wrap_content"
79 + android:layout_height="wrap_content"
80 + android:layout_alignParentStart="true"
81 + android:layout_centerVertical="true"
82 + android:layout_marginTop="24dp"
83 + android:maxLines="1"
84 + android:textColor="@color/black3"
85 + android:textSize="12sp"
86 + app:layout_constraintStart_toStartOf="parent"
87 + app:layout_constraintBottom_toBottomOf="parent"
88 + tools:text="έως 30-09" />
89 +
90 + <!-- Brand Logo -->
91 + <ImageView
92 + android:id="@+id/iv_logo"
93 + android:layout_width="80dp"
94 + android:layout_height="80dp"
95 + android:layout_alignParentEnd="true"
96 + android:layout_centerVertical="true"
97 + android:scaleType="centerInside"
98 + app:layout_constraintBottom_toBottomOf="parent"
99 + app:layout_constraintEnd_toEndOf="parent"
100 + app:layout_constraintTop_toTopOf="parent"
101 + tools:src="@drawable/demo_avis" />
102 + </androidx.constraintlayout.widget.ConstraintLayout>
103 +</RelativeLayout>
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,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" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools" 4 xmlns:tools="http://schemas.android.com/tools"
5 - android:layout_width="260dp" 5 + android:layout_width="270dp"
6 - android:layout_height="250dp" 6 + android:layout_height="260dp"
7 android:background="@drawable/demo_shape_white_border_grey"> 7 android:background="@drawable/demo_shape_white_border_grey">
8 8
9 <!-- Main Offer Image --> 9 <!-- Main Offer Image -->
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
12 android:layout_width="match_parent" 12 android:layout_width="match_parent"
13 android:layout_height="140dp" 13 android:layout_height="140dp"
14 android:scaleType="centerCrop" 14 android:scaleType="centerCrop"
15 - tools:src="@drawable/demo_home_banner" /> 15 + tools:src="@drawable/demo_home_banner1" />
16 16
17 <!-- Heart Icon (Favorite) --> 17 <!-- Heart Icon (Favorite) -->
18 <ImageView 18 <ImageView
...@@ -86,10 +86,10 @@ ...@@ -86,10 +86,10 @@
86 android:layout_centerVertical="true" 86 android:layout_centerVertical="true"
87 android:layout_marginTop="12dp" 87 android:layout_marginTop="12dp"
88 android:maxLines="1" 88 android:maxLines="1"
89 - android:textColor="#757575" 89 + android:textColor="@color/black3"
90 android:textSize="12sp" 90 android:textSize="12sp"
91 app:layout_constraintStart_toStartOf="parent" 91 app:layout_constraintStart_toStartOf="parent"
92 - app:layout_constraintTop_toBottomOf="@+id/tv_description" 92 + app:layout_constraintBottom_toBottomOf="parent"
93 tools:text="έως 30-09" /> 93 tools:text="έως 30-09" />
94 94
95 <!-- Brand Logo --> 95 <!-- Brand Logo -->
......
...@@ -23,4 +23,9 @@ ...@@ -23,4 +23,9 @@
23 <string name="demo_lorem_ipsum">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</string> 23 <string name="demo_lorem_ipsum">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</string>
24 <string name="demo_shops">Καταστήματα κοντά μου</string> 24 <string name="demo_shops">Καταστήματα κοντά μου</string>
25 <string name="demo_website">Δες το website</string> 25 <string name="demo_website">Δες το website</string>
26 + <string name="demo_profile">Το προφίλ μου</string>
27 + <string name="demo_my_coupons">Τα κουπόνια μου</string>
28 + <string name="demo_active">Ενεργά</string>
29 + <string name="demo_redeemed">Εξαργυρωμένα</string>
30 + <string name="demo_favorites">Αγαπημένα</string>
26 </resources> 31 </resources>
......