Panagiotis Triantafyllou

deh part5

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Cosmote demo</string>
<string name="app_name">ΔΕΗ demo</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
......
......@@ -45,6 +45,12 @@
android:theme="@style/SDKAppTheme" />
<activity
android:name=".activities.ProfileActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/SDKAppTheme" />
<activity
android:name=".dexter.PermissionsActivity"
android:exported="false"
android:launchMode="singleInstance"
......
......@@ -76,6 +76,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
private TextView mTvAllOffers, mTvAllFavorites, mTvAllViability, mTvAllFamily,
mTvAllCoffee, mTvAllTravelling, mTvAllKids, mTvAllPurchases;
private ImageView mIvProfile;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -106,7 +107,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
@Override
public void onClick(View v) {
// No longer needed as banner clicks are handled by the adapter
if (v.getId() == R.id.profile_icon) {
Intent myIntent = new Intent(HomeActivity.this, ProfileActivity.class);
startActivity(myIntent);
}
}
@Override
......@@ -129,6 +133,9 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Initialize banner carousel
setupBannerCarousel();
mIvProfile = findViewById(R.id.profile_icon);
mIvProfile.setOnClickListener(this);
// Initialize Top Offers section
mTvCategoryTopOffers = findViewById(R.id.tv_recycler_category1);
mRvTopOffers = findViewById(R.id.rl_recycler1);
......@@ -191,6 +198,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvTopOffers.setLayoutManager(layoutManager);
mRvTopOffers.setHasFixedSize(true);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
......@@ -217,6 +225,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvFavorites.setLayoutManager(layoutManager);
mRvFavorites.setHasFixedSize(true);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
......@@ -243,6 +252,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvViability.setLayoutManager(layoutManager);
mRvViability.setHasFixedSize(true);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
......@@ -269,6 +279,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvFamily.setLayoutManager(layoutManager);
mRvFamily.setHasFixedSize(true);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
......@@ -295,6 +306,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvFoodCoffee.setLayoutManager(layoutManager);
mRvFoodCoffee.setHasFixedSize(true);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
......@@ -321,6 +333,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvTravelling.setLayoutManager(layoutManager);
mRvTravelling.setHasFixedSize(true);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
......@@ -347,6 +360,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvKids.setLayoutManager(layoutManager);
mRvKids.setHasFixedSize(true);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
......@@ -373,6 +387,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvPurchases.setLayoutManager(layoutManager);
mRvPurchases.setHasFixedSize(true);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
......@@ -433,6 +448,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
/**
* Sets up the pagination dots
*
* @param count Number of dots to display
*/
private void setupPaginationDots(int count) {
......@@ -464,6 +480,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
/**
* Updates the dots to reflect the current page
*
* @param position Current page position
*/
private void updateDots(int position) {
......
package ly.warp.sdk.activities;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.view.WindowInsetsController;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import ly.warp.sdk.R;
import ly.warp.sdk.io.adapters.CouponAdapter;
import ly.warp.sdk.io.adapters.OfferAdapter;
import ly.warp.sdk.io.models.CouponItem;
import ly.warp.sdk.io.models.DummyDataProvider;
import ly.warp.sdk.io.models.OfferCategory;
import ly.warp.sdk.io.models.OfferItem;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.views.HorizontalSpaceItemDecoration;
import ly.warp.sdk.views.VerticalSpaceItemDecoration;
public class ProfileActivity extends Activity implements View.OnClickListener, OfferAdapter.OnOfferClickListener, CouponAdapter.OnCouponClickListener {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private TextView mTvHeaderTitle;
private ImageView mIvBack;
// Profile suggestions section
private TextView mTvCategoryProfileSuggestions;
private RecyclerView mRvProfileSuggestions;
private OfferAdapter mProfileSuggestionsAdapter;
private TextView mTvAllProfileSuggestions;
// My coupons section
private TextView mTvMyCouponsTitle;
private RecyclerView mRvCoupons;
private CouponAdapter mCouponsAdapter;
private TextView mBtnFilterActive, mBtnFilterFavorites, mBtnFilterRedeemed;
private List<CouponItem> mCouponItems;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
// Setup white status bar
setupStatusBar();
initViews();
// Setup profile suggestions section
setupProfileSuggestionsSection();
// Setup my coupons section
setupMyCouponsSection();
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.iv_back) {
onBackPressed();
} else if (id == R.id.btn_filter_active) {
filterCoupons(CouponItem.STATUS_ACTIVE);
} else if (id == R.id.btn_filter_favorites) {
filterCoupons(CouponItem.STATUS_FAVORITE);
} else if (id == R.id.btn_filter_redeemed) {
filterCoupons(CouponItem.STATUS_REDEEMED);
}
}
@Override
public void onOfferClick(OfferItem offerItem, int position) {
Intent myIntent = new Intent(ProfileActivity.this, SingleCouponActivity.class);
myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, offerItem);
startActivity(myIntent);
}
@Override
public void onFavoriteClick(OfferItem offerItem, int position) {
// Handle favorite click if needed
}
@Override
public void onCouponClick(CouponItem couponItem, int position) {
Intent myIntent = new Intent(ProfileActivity.this, SingleCouponActivity.class);
myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, couponItem);
startActivity(myIntent);
}
@Override
public void onFavoriteClick(CouponItem couponItem, int position) {
// Handle favorite click if needed
}
// ===========================================================
// Methods
// ===========================================================
private void initViews() {
mIvBack = findViewById(R.id.iv_back);
mIvBack.setOnClickListener(this);
mTvHeaderTitle = findViewById(R.id.tv_header_title);
// Initialize Profile Suggestions section
mTvCategoryProfileSuggestions = findViewById(R.id.tv_recycler_category);
mRvProfileSuggestions = findViewById(R.id.rl_recycler1);
mTvAllProfileSuggestions = findViewById(R.id.tv_recycler_all);
// Initialize My Coupons section
mTvMyCouponsTitle = findViewById(R.id.tv_my_coupons_title);
mRvCoupons = findViewById(R.id.rv_coupons);
mBtnFilterActive = findViewById(R.id.btn_filter_active);
mBtnFilterFavorites = findViewById(R.id.btn_filter_favorites);
mBtnFilterRedeemed = findViewById(R.id.btn_filter_redeemed);
// Set click listeners for filter buttons
mBtnFilterActive.setOnClickListener(this);
mBtnFilterFavorites.setOnClickListener(this);
mBtnFilterRedeemed.setOnClickListener(this);
WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle,
mTvCategoryProfileSuggestions, mTvMyCouponsTitle);
WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, mTvAllProfileSuggestions,
mBtnFilterActive, mBtnFilterFavorites, mBtnFilterRedeemed);
}
/**
* Set up the Profile Suggestions section with dummy data
*/
private void setupProfileSuggestionsSection() {
// Get Profile Suggestions data
OfferCategory profileSuggestionsCategory = DummyDataProvider.getProfileSuggestions();
// Set category title with item count
String categoryTitle = profileSuggestionsCategory.getName() + " (" + profileSuggestionsCategory.getItems().size() + ")";
mTvCategoryProfileSuggestions.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvProfileSuggestions.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvProfileSuggestions.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mProfileSuggestionsAdapter = new OfferAdapter(this, profileSuggestionsCategory.getItems());
mProfileSuggestionsAdapter.setOnOfferClickListener(this);
mRvProfileSuggestions.setAdapter(mProfileSuggestionsAdapter);
}
/**
* Set up the My Coupons section with dummy data and filters
*/
private void setupMyCouponsSection() {
// Get coupons data
mCouponItems = DummyDataProvider.getCoupons();
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
mRvCoupons.setLayoutManager(layoutManager);
mRvCoupons.setHasFixedSize(true);
// Create and set adapter
mCouponsAdapter = new CouponAdapter(this, mCouponItems);
mCouponsAdapter.setOnCouponClickListener(this);
mRvCoupons.setAdapter(mCouponsAdapter);
// Add 16dp spacing between coupon items
int verticalSpacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics());
mRvCoupons.addItemDecoration(new VerticalSpaceItemDecoration(verticalSpacingInPixels));
// Filter by active coupons by default
filterCoupons(CouponItem.STATUS_ACTIVE);
}
/**
* Filter coupons by status
*
* @param status The status to filter by
*/
private void filterCoupons(String status) {
// Reset all filter button styles
mBtnFilterActive.setBackgroundResource(R.drawable.shape_transparent_black_border);
mBtnFilterActive.setTextColor(getResources().getColor(R.color.black2));
mBtnFilterFavorites.setBackgroundResource(R.drawable.shape_transparent_black_border);
mBtnFilterFavorites.setTextColor(getResources().getColor(R.color.black2));
mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_transparent_black_border);
mBtnFilterRedeemed.setTextColor(getResources().getColor(R.color.black2));
// Set selected filter button style
if (CouponItem.STATUS_ACTIVE.equals(status)) {
mBtnFilterActive.setBackgroundResource(R.drawable.shape_cos_black);
mBtnFilterActive.setTextColor(Color.WHITE);
} else if (CouponItem.STATUS_FAVORITE.equals(status)) {
mBtnFilterFavorites.setBackgroundResource(R.drawable.shape_cos_black);
mBtnFilterFavorites.setTextColor(Color.WHITE);
} else if (CouponItem.STATUS_REDEEMED.equals(status)) {
mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_cos_black);
mBtnFilterRedeemed.setTextColor(Color.WHITE);
}
// Apply filter to adapter
mCouponsAdapter.filterByStatus(status);
}
/**
* Sets up the status bar to be white with dark icons
*/
private void setupStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// API 30+
WindowInsetsController controller = getWindow().getInsetsController();
if (controller != null) {
controller.setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
}
getWindow().setStatusBarColor(Color.WHITE);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// API 23+
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
getWindow().setStatusBarColor(Color.WHITE);
} else {
// For older versions, just set a light gray color
getWindow().setStatusBarColor(Color.parseColor("#F5F5F5"));
}
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
package ly.warp.sdk.io.adapters;
import android.content.Context;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.CouponItem;
import ly.warp.sdk.utils.TopRoundedCornersTransformation;
import ly.warp.sdk.utils.WarpUtils;
/**
* Adapter for displaying coupon items in a vertical RecyclerView
*/
public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponViewHolder> {
private final List<CouponItem> allCouponItems;
private List<CouponItem> filteredCouponItems;
private final Context context;
private OnCouponClickListener listener;
private String currentFilter = null;
/**
* Interface for handling coupon item clicks
*/
public interface OnCouponClickListener {
void onCouponClick(CouponItem couponItem, int position);
void onFavoriteClick(CouponItem couponItem, int position);
}
/**
* Constructor
*
* @param context The context
* @param couponItems List of coupon items to display
*/
public CouponAdapter(Context context, List<CouponItem> couponItems) {
this.context = context;
this.allCouponItems = couponItems;
this.filteredCouponItems = new ArrayList<>(couponItems);
}
/**
* Set click listener for coupon items
*
* @param listener The listener
*/
public void setOnCouponClickListener(OnCouponClickListener listener) {
this.listener = listener;
}
/**
* Filter coupons by status
*
* @param status The status to filter by (active, favorite, redeemed) or null for all
*/
public void filterByStatus(String status) {
currentFilter = status;
filteredCouponItems.clear();
if (status == null) {
// Show all coupons
filteredCouponItems.addAll(allCouponItems);
} else {
// Filter by status
for (CouponItem coupon : allCouponItems) {
if (status.equals(coupon.getStatus())) {
filteredCouponItems.add(coupon);
}
}
}
notifyDataSetChanged();
}
@NonNull
@Override
public CouponViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.demo_item_coupon, parent, false);
return new CouponViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull CouponViewHolder holder, int position) {
CouponItem couponItem = filteredCouponItems.get(position);
holder.bind(couponItem, position);
}
@Override
public int getItemCount() {
return filteredCouponItems.size();
}
/**
* ViewHolder for coupon items
*/
class CouponViewHolder extends RecyclerView.ViewHolder {
private final ImageView ivOfferImage;
private final ImageView ivFavorite;
private final ImageView ivLogo;
private final TextView tvPrice;
private final TextView tvTitle;
private final TextView tvDescription;
private final TextView tvValidity;
CouponViewHolder(@NonNull View itemView) {
super(itemView);
ivOfferImage = itemView.findViewById(R.id.iv_offer_image);
ivFavorite = itemView.findViewById(R.id.iv_favorite);
ivLogo = itemView.findViewById(R.id.iv_logo);
tvPrice = itemView.findViewById(R.id.tv_price);
tvTitle = itemView.findViewById(R.id.tv_title);
tvDescription = itemView.findViewById(R.id.tv_description);
tvValidity = itemView.findViewById(R.id.tv_validity);
WarpUtils.renderCustomFont(context, R.font.ping_lcg_bold, tvPrice, tvTitle);
WarpUtils.renderCustomFont(context, R.font.ping_lcg_regular, tvDescription, tvValidity);
// Set click listeners
itemView.setOnClickListener(v -> {
int position = getAdapterPosition();
if (listener != null && position != RecyclerView.NO_POSITION) {
listener.onCouponClick(filteredCouponItems.get(position), position);
}
});
ivFavorite.setOnClickListener(v -> {
int position = getAdapterPosition();
if (listener != null && position != RecyclerView.NO_POSITION) {
listener.onFavoriteClick(filteredCouponItems.get(position), position);
}
});
}
void bind(CouponItem couponItem, int position) {
// Set coupon data to views
tvTitle.setText(couponItem.getTitle());
tvDescription.setText(couponItem.getDescription());
tvPrice.setText(couponItem.getValue());
tvValidity.setText(formatValidityDate(couponItem.getEndDate()));
// Set heart icon based on favorite status
if (couponItem.isFavorite()) {
// Use pressed/filled heart for Favorites
ivFavorite.setImageResource(R.drawable.demo_heart_pressed);
} else {
// Use default/empty heart for other statuses
ivFavorite.setImageResource(R.drawable.demo_heart);
}
// Load images from resources
loadOfferImage(couponItem.getImageUrl());
loadLogoImage(couponItem.getLogoUrl());
}
/**
* Format the end date to "έως dd-MM" format
*
* @param endDate The end date in "dd/MM/yyyy" format
* @return Formatted date string
*/
private String formatValidityDate(String endDate) {
try {
SimpleDateFormat inputFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault());
Date date = inputFormat.parse(endDate);
SimpleDateFormat outputFormat = new SimpleDateFormat("dd-MM", Locale.getDefault());
return "έως " + outputFormat.format(date);
} catch (ParseException e) {
// Fallback to original if parsing fails
return endDate;
}
}
/**
* Load offer image with rounded top corners using Glide
*
* @param imageName The image resource name
*/
private void loadOfferImage(String imageName) {
try {
// Remove file extension if present
if (imageName.contains(".")) {
imageName = imageName.substring(0, imageName.lastIndexOf('.'));
}
// Get resource ID by name
int resourceId = context.getResources().getIdentifier(
imageName, "drawable", context.getPackageName());
if (resourceId != 0) {
// Convert 9dp to pixels
int radiusInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 9,
context.getResources().getDisplayMetrics());
// Load with Glide and apply transformations
Glide.with(context)
.load(resourceId)
.transform(new CenterCrop(), new TopRoundedCornersTransformation(radiusInPixels))
.into(ivOfferImage);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Load logo image without transformations
*
* @param imageName The image resource name
*/
private void loadLogoImage(String imageName) {
try {
// Remove file extension if present
if (imageName.contains(".")) {
imageName = imageName.substring(0, imageName.lastIndexOf('.'));
}
// Get resource ID by name
int resourceId = context.getResources().getIdentifier(
imageName, "drawable", context.getPackageName());
if (resourceId != 0) {
// Load logo normally without transformations
ivLogo.setImageResource(resourceId);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
package ly.warp.sdk.io.models;
/**
* Model class representing a coupon item to be displayed in the profile screen.
* Extends OfferItem with additional status field.
*/
public class CouponItem extends OfferItem {
// Coupon status constants
public static final String STATUS_ACTIVE = "active";
public static final String STATUS_FAVORITE = "favorite";
public static final String STATUS_REDEEMED = "redeemed";
private String status;
/**
* Default constructor
*/
public CouponItem() {
super();
}
/**
* Full constructor for creating a coupon item
*
* @param id Unique identifier for the coupon
* @param title Title of the coupon
* @param description Short description of the coupon
* @param fullDescription Detailed description of the coupon
* @param endDate End date of the coupon (formatted as string)
* @param value Value of the coupon (formatted as string, e.g., "50%", "€20")
* @param imageUrl URL or resource name for the coupon image
* @param logoUrl URL or resource name for the merchant logo
* @param category Category this coupon belongs to
* @param status Status of the coupon (active, favorite, redeemed)
*/
public CouponItem(String id, String title, String description, String fullDescription, String endDate,
String value, String imageUrl, String logoUrl, String category, String status) {
super(id, title, description, fullDescription, endDate, value, imageUrl, logoUrl, category);
this.status = status;
}
/**
* Constructor for backward compatibility
*
* @param id Unique identifier for the coupon
* @param title Title of the coupon
* @param description Description of the coupon
* @param endDate End date of the coupon (formatted as string)
* @param value Value of the coupon (formatted as string, e.g., "50%", "€20")
* @param imageUrl URL or resource name for the coupon image
* @param logoUrl URL or resource name for the merchant logo
* @param category Category this coupon belongs to
* @param status Status of the coupon (active, favorite, redeemed)
*/
public CouponItem(String id, String title, String description, String endDate,
String value, String imageUrl, String logoUrl, String category, String status) {
super(id, title, description, endDate, value, imageUrl, logoUrl, category);
this.status = status;
}
/**
* Constructor from an existing OfferItem with added status
*
* @param offerItem The offer item to convert
* @param status Status of the coupon (active, favorite, redeemed)
*/
public CouponItem(OfferItem offerItem, String status) {
super(offerItem.getId(), offerItem.getTitle(), offerItem.getDescription(),
offerItem.getFullDescription(), offerItem.getEndDate(), offerItem.getValue(),
offerItem.getImageUrl(), offerItem.getLogoUrl(), offerItem.getCategory());
this.status = status;
}
// Getters and Setters
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
/**
* Check if the coupon is active
* @return true if active, false otherwise
*/
public boolean isActive() {
return STATUS_ACTIVE.equals(status);
}
/**
* Check if the coupon is a favorite
* @return true if favorite, false otherwise
*/
public boolean isFavorite() {
return STATUS_FAVORITE.equals(status);
}
/**
* Check if the coupon is redeemed
* @return true if redeemed, false otherwise
*/
public boolean isRedeemed() {
return STATUS_REDEEMED.equals(status);
}
}
......@@ -21,10 +21,15 @@ public class DummyDataProvider {
public static final String CATEGORY_TRAVELLING = "travelling";
public static final String CATEGORY_KIDS = "kids";
public static final String CATEGORY_PURCHASES = "purchases";
public static final String CATEGORY_PROFILE_SUGGESTIONS = "profile_suggestions";
public static final String CATEGORY_MY_COUPONS = "my_coupons";
// Cache for categories
private static Map<String, OfferCategory> categoryCache = new HashMap<>();
// Cache for coupons
private static List<CouponItem> couponCache;
/**
* Get all categories with their items
*
......@@ -40,6 +45,7 @@ public class DummyDataProvider {
categories.add(getTravelling());
categories.add(getKids());
categories.add(getPurchases());
categories.add(getProfileSuggestions());
return categories;
}
......@@ -80,6 +86,14 @@ public class DummyDataProvider {
case CATEGORY_PURCHASES:
category = getPurchases();
break;
case CATEGORY_PROFILE_SUGGESTIONS:
category = getProfileSuggestions();
break;
case CATEGORY_MY_COUPONS:
// For coupons, we don't return a category but individual items
// This is just a placeholder to maintain consistency
category = new OfferCategory(CATEGORY_MY_COUPONS, "Τα κουπόνια μου");
break;
}
if (category != null) {
......@@ -735,4 +749,123 @@ public class DummyDataProvider {
return category;
}
/**
* Get Profile Suggestions category with items
*
* @return Profile Suggestions category
*/
public static OfferCategory getProfileSuggestions() {
OfferCategory category = new OfferCategory(CATEGORY_PROFILE_SUGGESTIONS, "Προτάσεις για εσένα");
category.addItem(new OfferItem("ps1", "Έκπτωση 30% σε Online Αγορές",
"Αποκλειστική έκπτωση για αγορές από το e-shop μας",
"Απολαύστε έκπτωση 30% σε όλες τις online αγορές σας από το e-shop μας. Η προσφορά ισχύει για όλες τις κατηγορίες προϊόντων, συμπεριλαμβανομένων ηλεκτρονικών συσκευών, ρούχων, αξεσουάρ και ειδών σπιτιού. Δωρεάν παράδοση για παραγγελίες άνω των €50 και εύκολη διαδικασία επιστροφής εντός 30 ημερών.",
"31/08/2025", "30%", "demo_profile_offer1.png", "demo_profile_offer1.png", CATEGORY_PROFILE_SUGGESTIONS));
category.addItem(new OfferItem("ps2", "Δωρεάν Μεταφορικά στο Online Φαρμακείο",
"Για αγορές άνω των €30 σε προϊόντα υγείας και ομορφιάς",
"Κάντε τις αγορές σας από το online φαρμακείο μας και απολαύστε δωρεάν μεταφορικά για παραγγελίες άνω των €30. Η προσφορά ισχύει για όλα τα προϊόντα υγείας, ομορφιάς, προσωπικής φροντίδας και συμπληρώματα διατροφής. Παράδοση την επόμενη εργάσιμη ημέρα για παραγγελίες έως τις 2μμ.",
"30/09/2025", "€0", "demo_profile_offer2.png", "demo_profile_offer2.png", CATEGORY_PROFILE_SUGGESTIONS));
category.addItem(new OfferItem("ps3", "Online Αγορές Σούπερ Μάρκετ",
"15% έκπτωση στην πρώτη σας online παραγγελία",
"Ανακαλύψτε την ευκολία των online αγορών σούπερ μάρκετ με 15% έκπτωση στην πρώτη σας παραγγελία. Επιλέξτε από χιλιάδες προϊόντα, από φρέσκα τρόφιμα μέχρι είδη καθαρισμού και προσωπικής φροντίδας. Παράδοση την ίδια μέρα για παραγγελίες έως τις 12μμ ή επιλέξτε την ημέρα και ώρα που σας εξυπηρετεί.",
"31/12/2025", "15%", "demo_profile_offer3.png", "demo_profile_offer3.png", CATEGORY_PROFILE_SUGGESTIONS));
category.addItem(new OfferItem("ps4", "Ηλεκτρονικά Είδη με Έκπτωση",
"Έως 25% έκπτωση σε επιλεγμένα ηλεκτρονικά είδη online",
"Αναβαθμίστε τις συσκευές σας με έως 25% έκπτωση σε επιλεγμένα ηλεκτρονικά είδη από το online κατάστημά μας. Η προσφορά περιλαμβάνει smartphones, tablets, laptops, τηλεοράσεις και αξεσουάρ από κορυφαίες μάρκες. Δωρεάν τεχνική υποστήριξη για 1 χρόνο και εγγύηση 2 ετών σε όλα τα προϊόντα.",
"31/07/2025", "25%", "demo_profile_offer4.png", "demo_profile_offer4.png", CATEGORY_PROFILE_SUGGESTIONS));
category.addItem(new OfferItem("ps5", "Online Αγορές Ρούχων",
"Αγοράστε 2 είδη και πάρτε το 3ο δωρεάν",
"Ανανεώστε τη γκαρνταρόμπα σας με την προσφορά 2+1 στο online κατάστημα ρούχων μας. Αγοράστε 2 είδη και πάρτε το 3ο εντελώς δωρεάν. Η προσφορά ισχύει για όλες τις κατηγορίες ρούχων και αξεσουάρ, συμπεριλαμβανομένων των νέων συλλογών. Το είδος με τη χαμηλότερη τιμή προσφέρεται δωρεάν.",
"31/08/2025", "100%", "demo_profile_offer5.png", "demo_profile_offer5.png", CATEGORY_PROFILE_SUGGESTIONS));
return category;
}
/**
* Get all coupons
*
* @return List of all coupon items
*/
public static List<CouponItem> getCoupons() {
if (couponCache != null) {
return couponCache;
}
List<CouponItem> coupons = new ArrayList<>();
// Add 5 dummy coupon items with different statuses
// Active coupon - Pizza offer
coupons.add(new CouponItem(
"c1",
"Μόνο 17,95",
"2 πίτσες & Coca-Cola 1,5lt",
"Απολαύστε 2 μεσαίες πίτσες της επιλογής σας και ένα αναψυκτικό Coca-Cola 1,5lt σε ειδική τιμή. Η προσφορά ισχύει για παραλαβή από το κατάστημα ή delivery. Μπορείτε να επιλέξετε οποιαδήποτε πίτσα από τον κατάλογο εκτός από τις premium επιλογές. Ιδανικό για οικογενειακό γεύμα ή παρέα με φίλους.",
"30/09/2025",
"17,95€",
"demo_image_dominos.png",
"demo_dominos.png",
CATEGORY_MY_COUPONS,
CouponItem.STATUS_ACTIVE));
// Active coupon - Coffee offer
coupons.add(new CouponItem(
"c2",
"Καφές & Σνακ",
"Combo προσφορά για όλη την ημέρα",
"Απολαύστε έναν καφέ της επιλογής σας (espresso, cappuccino, latte) και ένα σνακ (κρουασάν, σάντουιτς ή μπισκότα) σε ειδική τιμή. Η προσφορά ισχύει όλη την ημέρα σε όλα τα καταστήματα της αλυσίδας. Ιδανικό για ένα γρήγορο διάλειμμα ή πρωινό στο δρόμο για τη δουλειά.",
"31/08/2025",
"3,50€",
"demo_image_coffee.png",
"demo_coffee.png",
CATEGORY_MY_COUPONS,
CouponItem.STATUS_ACTIVE));
// Favorite coupon - Car rental
coupons.add(new CouponItem(
"c3",
"Ενοικίαση Αυτοκινήτου",
"20% έκπτωση για Σαββατοκύριακο",
"Εξοικονομήστε 20% στην ενοικίαση αυτοκινήτου για το Σαββατοκύριακο. Η προσφορά ισχύει για όλες τις κατηγορίες οχημάτων και περιλαμβάνει απεριόριστα χιλιόμετρα και βασική ασφάλεια. Κάντε κράτηση τουλάχιστον 3 ημέρες πριν και απολαύστε το ταξίδι σας με άνεση και οικονομία.",
"31/12/2025",
"20%",
"demo_image_avis.png",
"demo_avis.png",
CATEGORY_MY_COUPONS,
CouponItem.STATUS_FAVORITE));
// Redeemed coupon - Restaurant
coupons.add(new CouponItem(
"c4",
"Γεύμα για Δύο",
"Πλήρες μενού με κρασί",
"Απολαύστε ένα πλήρες γεύμα για δύο άτομα που περιλαμβάνει ορεκτικό, σαλάτα, κυρίως πιάτο, επιδόρπιο και ένα μπουκάλι κρασί. Η προσφορά ισχύει για όλα τα καταστήματα της αλυσίδας, από Δευτέρα έως Πέμπτη. Απαραίτητη η κράτηση τουλάχιστον 24 ώρες νωρίτερα.",
"30/06/2025",
"45€",
"demo_image_ranch.png",
"demo_ranch.png",
CATEGORY_MY_COUPONS,
CouponItem.STATUS_REDEEMED));
// Favorite coupon - Electronics
coupons.add(new CouponItem(
"c5",
"Έκπτωση σε Ηλεκτρονικά",
"15% σε όλα τα αξεσουάρ κινητών",
"Αποκτήστε όλα τα αξεσουάρ για το κινητό σας με έκπτωση 15%. Η προσφορά περιλαμβάνει θήκες, προστατευτικά οθόνης, φορτιστές, ακουστικά και power banks. Όλα τα προϊόντα είναι επώνυμα και συνοδεύονται από εγγύηση 2 ετών. Η προσφορά ισχύει τόσο online όσο και στα φυσικά καταστήματα.",
"31/07/2025",
"15%",
"demo_image_migato.png",
"demo_migato.png",
CATEGORY_MY_COUPONS,
CouponItem.STATUS_FAVORITE));
couponCache = coupons;
return coupons;
}
}
......
......@@ -179,7 +179,6 @@ public class WarplyManagerHelper {
params.putOpt("refresh_token", WarplyDBHelper.getInstance(context).getAuthValue("refresh_token"));
params.putOpt("client_id", WarplyDBHelper.getInstance(context).getClientValue("client_id"));
params.putOpt("client_secret", WarplyDBHelper.getInstance(context).getClientValue("client_secret"));
params.putOpt("map", "true");
params.putOpt("lan", WarpUtils.getApplicationLocale(context));
params.putOpt("dark", String.valueOf(WarpUtils.getIsDarkModeEnabled(context)));
} catch (JSONException e) {
......
package ly.warp.sdk.views;
import android.graphics.Rect;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
/**
* ItemDecoration for adding vertical spacing between RecyclerView items.
* Adds spacing to the bottom of each item except the last one.
*/
public class VerticalSpaceItemDecoration extends RecyclerView.ItemDecoration {
private final int spaceHeight;
/**
* Constructor
*
* @param spaceHeight Space height in pixels
*/
public VerticalSpaceItemDecoration(int spaceHeight) {
this.spaceHeight = spaceHeight;
}
@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
// Add spacing to the bottom of each item except the last one
int position = parent.getChildAdapterPosition(view);
if (position != RecyclerView.NO_POSITION && position != parent.getAdapter().getItemCount() - 1) {
outRect.bottom = spaceHeight;
}
}
}
......@@ -84,7 +84,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp">
android:layout_marginTop="24dp">
<LinearLayout
android:id="@+id/ll_recycler1"
......@@ -109,7 +109,7 @@
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
......@@ -155,7 +155,7 @@
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
......@@ -201,7 +201,7 @@
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
......@@ -247,7 +247,7 @@
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
......@@ -293,7 +293,7 @@
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
......@@ -339,7 +339,7 @@
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
......@@ -385,7 +385,7 @@
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
......@@ -432,7 +432,7 @@
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_grey_light">
<androidx.core.widget.NestedScrollView
android:id="@+id/profile_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:id="@+id/profile_content_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/header_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="horizontal"
android:padding="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_back"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="24dp"
android:src="@drawable/ic_back" />
<TextView
android:id="@+id/tv_header_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/demo_profile"
android:textColor="@color/black4"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/profile_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:background="@color/cos_grey_light"
android:orientation="horizontal"
android:padding="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="@+id/green_icon"
android:layout_width="58dp"
android:layout_height="22dp"
android:layout_marginEnd="8dp"
android:src="@drawable/demo_green" />
<ImageView
android:id="@+id/family_icon"
android:layout_width="58dp"
android:layout_height="22dp"
android:src="@drawable/demo_family" />
</LinearLayout>
<ImageView
android:id="@+id/profile_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/demo_profile" />
</LinearLayout>
<ImageView
android:id="@+id/profile_questionnaire"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_marginTop="16dp"
android:paddingHorizontal="16dp"
android:src="@drawable/demo_questionnaire" />
<!-- Profile Suggestions Section -->
<RelativeLayout
android:id="@+id/profile_suggestions_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp">
<LinearLayout
android:id="@+id/ll_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<TextView
android:id="@+id/tv_recycler_category"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textSize="16sp"
tools:text="Προτάσεις για εσένα (5)" />
<TextView
android:id="@+id/tv_recycler_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="5dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_recycler1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_recycler"
android:layout_marginTop="16dp"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingHorizontal="16dp" />
</RelativeLayout>
<!-- My Coupons Section -->
<RelativeLayout
android:id="@+id/my_coupons_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:background="@color/white"
android:paddingVertical="16dp">
<TextView
android:id="@+id/tv_my_coupons_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:paddingHorizontal="16dp"
android:text="@string/demo_my_coupons"
android:textColor="@color/black2"
android:textSize="16sp" />
<!-- Filter Buttons -->
<LinearLayout
android:id="@+id/ll_coupon_filters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_my_coupons_title"
android:layout_marginTop="32dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<TextView
android:id="@+id/btn_filter_active"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@drawable/shape_cos_black"
android:gravity="center"
android:paddingVertical="8dp"
android:text="@string/demo_active"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/btn_filter_favorites"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@drawable/shape_transparent_black_border"
android:gravity="center"
android:paddingVertical="8dp"
android:text="@string/demo_favorites"
android:textColor="@color/black2"
android:textSize="14sp" />
<TextView
android:id="@+id/btn_filter_redeemed"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/shape_transparent_black_border"
android:gravity="center"
android:paddingVertical="8dp"
android:text="@string/demo_redeemed"
android:textColor="@color/black2"
android:textSize="14sp" />
</LinearLayout>
<!-- Vertical RecyclerView for Coupons -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_coupons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_coupon_filters"
android:layout_marginTop="32dp"
android:clipToPadding="false"
android:nestedScrollingEnabled="false"
android:paddingHorizontal="16dp" />
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
......@@ -29,7 +29,7 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical"
android:layout_weight="1"
android:orientation="horizontal">
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="280dp"
android:background="@drawable/demo_shape_white_border_grey">
<ImageView
android:id="@+id/iv_offer_image"
android:layout_width="match_parent"
android:layout_height="160dp"
android:scaleType="centerCrop"
tools:src="@drawable/demo_home_banner1" />
<ImageView
android:id="@+id/iv_favorite"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_margin="8dp"
android:src="@drawable/demo_heart" />
<TextView
android:id="@+id/tv_price"
android:layout_width="84dp"
android:layout_height="84dp"
android:layout_alignParentEnd="true"
android:layout_margin="8dp"
android:background="@drawable/demo_shape_pink"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="23sp"
tools:text="17,95€" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/iv_offer_image"
android:orientation="vertical"
android:padding="12dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_70"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.7" />
<!-- Title -->
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/black2"
android:textSize="21sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Móvo 17,95" />
<!-- Description -->
<TextView
android:id="@+id/tv_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="2"
android:textColor="@color/black3"
android:textSize="15sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_title"
tools:text="2 πίτσες &amp; Coca-COLA 1,5lt" />
<!-- Validity Date -->
<TextView
android:id="@+id/tv_validity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginTop="24dp"
android:maxLines="1"
android:textColor="@color/black3"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="έως 30-09" />
<!-- Brand Logo -->
<ImageView
android:id="@+id/iv_logo"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/demo_avis" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
......@@ -2,8 +2,8 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="260dp"
android:layout_height="250dp"
android:layout_width="270dp"
android:layout_height="260dp"
android:background="@drawable/demo_shape_white_border_grey">
<!-- Main Offer Image -->
......@@ -12,7 +12,7 @@
android:layout_width="match_parent"
android:layout_height="140dp"
android:scaleType="centerCrop"
tools:src="@drawable/demo_home_banner" />
tools:src="@drawable/demo_home_banner1" />
<!-- Heart Icon (Favorite) -->
<ImageView
......@@ -86,10 +86,10 @@
android:layout_centerVertical="true"
android:layout_marginTop="12dp"
android:maxLines="1"
android:textColor="#757575"
android:textColor="@color/black3"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_description"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="έως 30-09" />
<!-- Brand Logo -->
......
......@@ -23,4 +23,9 @@
<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>
<string name="demo_shops">Καταστήματα κοντά μου</string>
<string name="demo_website">Δες το website</string>
<string name="demo_profile">Το προφίλ μου</string>
<string name="demo_my_coupons">Τα κουπόνια μου</string>
<string name="demo_active">Ενεργά</string>
<string name="demo_redeemed">Εξαργυρωμένα</string>
<string name="demo_favorites">Αγαπημένα</string>
</resources>
......