Panagiotis Triantafyllou

deh part1

Showing 34 changed files with 2034 additions and 8 deletions
......@@ -2,12 +2,25 @@ package ly.warp.sdk.activities;
import android.app.Activity;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import ly.warp.sdk.R;
import ly.warp.sdk.io.adapters.OfferAdapter;
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.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyManager;
import ly.warp.sdk.views.HorizontalSpaceItemDecoration;
public class HomeActivity extends Activity implements View.OnClickListener {
public class HomeActivity extends Activity implements View.OnClickListener, OfferAdapter.OnOfferClickListener {
// ===========================================================
// Constants
// ===========================================================
......@@ -17,6 +30,39 @@ public class HomeActivity extends Activity implements View.OnClickListener {
// ===========================================================
private ImageView mIvBanner;
// Category sections
private TextView mTvCategoryTopOffers;
private RecyclerView mRvTopOffers;
private OfferAdapter mTopOffersAdapter;
private TextView mTvCategoryFavorites;
private RecyclerView mRvFavorites;
private OfferAdapter mFavoritesAdapter;
private TextView mTvCategoryViability;
private RecyclerView mRvViability;
private OfferAdapter mViabilityAdapter;
private TextView mTvCategoryFamily;
private RecyclerView mRvFamily;
private OfferAdapter mFamilyAdapter;
private TextView mTvCategoryFoodCoffee;
private RecyclerView mRvFoodCoffee;
private OfferAdapter mFoodCoffeeAdapter;
private TextView mTvCategoryTravelling;
private RecyclerView mRvTravelling;
private OfferAdapter mTravellingAdapter;
private TextView mTvCategoryKids;
private RecyclerView mRvKids;
private OfferAdapter mKidsAdapter;
private TextView mTvCategoryPurchases;
private RecyclerView mRvPurchases;
private OfferAdapter mPurchasesAdapter;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
......@@ -29,6 +75,16 @@ public class HomeActivity extends Activity implements View.OnClickListener {
mIvBanner = findViewById(R.id.banner_icon);
initViews();
// Setup all category sections
setupTopOffersSection();
setupFavoritesSection();
setupViabilitySection();
setupFamilySection();
setupFoodCoffeeSection();
setupTravellingSection();
setupKidsSection();
setupPurchasesSection();
}
@Override
......@@ -41,14 +97,265 @@ public class HomeActivity extends Activity implements View.OnClickListener {
// ===========================================================
private void initViews() {
// Initialize banner
mIvBanner.setOnClickListener(this);
// Initialize Top Offers section
mTvCategoryTopOffers = findViewById(R.id.tv_recycler_category1);
mRvTopOffers = findViewById(R.id.rl_recycler1);
// Initialize Favorites section
mTvCategoryFavorites = findViewById(R.id.tv_recycler_category2);
mRvFavorites = findViewById(R.id.rl_recycler2);
// Initialize Viability section
mTvCategoryViability = findViewById(R.id.tv_recycler_category3);
mRvViability = findViewById(R.id.rl_recycler3);
// Initialize Family section
mTvCategoryFamily = findViewById(R.id.tv_recycler_category4);
mRvFamily = findViewById(R.id.rl_recycler4);
// Initialize Food & Coffee section
mTvCategoryFoodCoffee = findViewById(R.id.tv_recycler_category5);
mRvFoodCoffee = findViewById(R.id.rl_recycler5);
// Initialize Travelling section
mTvCategoryTravelling = findViewById(R.id.tv_recycler_category6);
mRvTravelling = findViewById(R.id.rl_recycler6);
// Initialize Kids section
mTvCategoryKids = findViewById(R.id.tv_recycler_category7);
mRvKids = findViewById(R.id.rl_recycler7);
// Initialize Purchases section
mTvCategoryPurchases = findViewById(R.id.tv_recycler_category8);
mRvPurchases = findViewById(R.id.rl_recycler8);
}
/**
* Set up the Top Offers section with dummy data
*/
private void setupTopOffersSection() {
// Get Top Offers data
OfferCategory topOffersCategory = DummyDataProvider.getTopOffers();
// Set category title with item count
String categoryTitle = topOffersCategory.getName() + " (" + topOffersCategory.getItems().size() + ")";
mTvCategoryTopOffers.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvTopOffers.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvTopOffers.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mTopOffersAdapter = new OfferAdapter(this, topOffersCategory.getItems());
mTopOffersAdapter.setOnOfferClickListener(this);
mRvTopOffers.setAdapter(mTopOffersAdapter);
}
/**
* Set up the Favorites section with dummy data
*/
private void setupFavoritesSection() {
// Get Favorites data
OfferCategory favoritesCategory = DummyDataProvider.getFavorites();
// Set category title with item count
String categoryTitle = favoritesCategory.getName() + " (" + favoritesCategory.getItems().size() + ")";
mTvCategoryFavorites.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvFavorites.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvFavorites.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mFavoritesAdapter = new OfferAdapter(this, favoritesCategory.getItems());
mFavoritesAdapter.setOnOfferClickListener(this);
mRvFavorites.setAdapter(mFavoritesAdapter);
}
/**
* Set up the Viability section with dummy data
*/
private void setupViabilitySection() {
// Get Viability data
OfferCategory viabilityCategory = DummyDataProvider.getViability();
// Set category title with item count
String categoryTitle = viabilityCategory.getName() + " (" + viabilityCategory.getItems().size() + ")";
mTvCategoryViability.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvViability.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvViability.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mViabilityAdapter = new OfferAdapter(this, viabilityCategory.getItems());
mViabilityAdapter.setOnOfferClickListener(this);
mRvViability.setAdapter(mViabilityAdapter);
}
/**
* Set up the Family section with dummy data
*/
private void setupFamilySection() {
// Get Family data
OfferCategory familyCategory = DummyDataProvider.getFamily();
// Set category title with item count
String categoryTitle = familyCategory.getName() + " (" + familyCategory.getItems().size() + ")";
mTvCategoryFamily.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvFamily.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvFamily.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mFamilyAdapter = new OfferAdapter(this, familyCategory.getItems());
mFamilyAdapter.setOnOfferClickListener(this);
mRvFamily.setAdapter(mFamilyAdapter);
}
/**
* Set up the Food & Coffee section with dummy data
*/
private void setupFoodCoffeeSection() {
// Get Food & Coffee data
OfferCategory foodCoffeeCategory = DummyDataProvider.getFoodAndCoffee();
// Set category title with item count
String categoryTitle = foodCoffeeCategory.getName() + " (" + foodCoffeeCategory.getItems().size() + ")";
mTvCategoryFoodCoffee.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvFoodCoffee.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvFoodCoffee.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mFoodCoffeeAdapter = new OfferAdapter(this, foodCoffeeCategory.getItems());
mFoodCoffeeAdapter.setOnOfferClickListener(this);
mRvFoodCoffee.setAdapter(mFoodCoffeeAdapter);
}
/**
* Set up the Travelling section with dummy data
*/
private void setupTravellingSection() {
// Get Travelling data
OfferCategory travellingCategory = DummyDataProvider.getTravelling();
// Set category title with item count
String categoryTitle = travellingCategory.getName() + " (" + travellingCategory.getItems().size() + ")";
mTvCategoryTravelling.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvTravelling.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvTravelling.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mTravellingAdapter = new OfferAdapter(this, travellingCategory.getItems());
mTravellingAdapter.setOnOfferClickListener(this);
mRvTravelling.setAdapter(mTravellingAdapter);
}
/**
* Set up the Kids section with dummy data
*/
private void setupKidsSection() {
// Get Kids data
OfferCategory kidsCategory = DummyDataProvider.getKids();
// Set category title with item count
String categoryTitle = kidsCategory.getName() + " (" + kidsCategory.getItems().size() + ")";
mTvCategoryKids.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvKids.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvKids.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mKidsAdapter = new OfferAdapter(this, kidsCategory.getItems());
mKidsAdapter.setOnOfferClickListener(this);
mRvKids.setAdapter(mKidsAdapter);
}
/**
* Set up the Purchases section with dummy data
*/
private void setupPurchasesSection() {
// Get Purchases data
OfferCategory purchasesCategory = DummyDataProvider.getPurchases();
// Set category title with item count
String categoryTitle = purchasesCategory.getName() + " (" + purchasesCategory.getItems().size() + ")";
mTvCategoryPurchases.setText(categoryTitle);
// Set up RecyclerView
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRvPurchases.setLayoutManager(layoutManager);
// Add spacing between items
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
mRvPurchases.addItemDecoration(new HorizontalSpaceItemDecoration(spacingInPixels));
// Create and set adapter
mPurchasesAdapter = new OfferAdapter(this, purchasesCategory.getItems());
mPurchasesAdapter.setOnOfferClickListener(this);
mRvPurchases.setAdapter(mPurchasesAdapter);
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.banner_icon) {
WarplyManagerHelper.openContest(this);
}
}
@Override
public void onOfferClick(OfferItem offerItem, int position) {
// Toast.makeText(this, "Offer clicked: " + offerItem.getTitle(), Toast.LENGTH_SHORT).show();
}
@Override
public void onFavoriteClick(OfferItem offerItem, int position) {
// Toast.makeText(this, "Favorite clicked for: " + offerItem.getTitle(), Toast.LENGTH_SHORT).show();
}
// ===========================================================
......
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.util.List;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.DummyDataProvider;
import ly.warp.sdk.io.models.OfferItem;
import ly.warp.sdk.utils.TopRoundedCornersTransformation;
/**
* Adapter for displaying offer items in a RecyclerView
*/
public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHolder> {
private final List<OfferItem> offerItems;
private final Context context;
private OnOfferClickListener listener;
/**
* Interface for handling offer item clicks
*/
public interface OnOfferClickListener {
void onOfferClick(OfferItem offerItem, int position);
void onFavoriteClick(OfferItem offerItem, int position);
}
/**
* Constructor
*
* @param context The context
* @param offerItems List of offer items to display
*/
public OfferAdapter(Context context, List<OfferItem> offerItems) {
this.context = context;
this.offerItems = offerItems;
}
/**
* Set click listener for offer items
*
* @param listener The listener
*/
public void setOnOfferClickListener(OnOfferClickListener listener) {
this.listener = listener;
}
@NonNull
@Override
public OfferViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.demo_item_offer, parent, false);
return new OfferViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull OfferViewHolder holder, int position) {
OfferItem offerItem = offerItems.get(position);
holder.bind(offerItem, position);
}
@Override
public int getItemCount() {
return offerItems.size();
}
/**
* ViewHolder for offer items
*/
class OfferViewHolder 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;
OfferViewHolder(@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);
// Set click listeners
// itemView.setOnClickListener(v -> {
// int position = getAdapterPosition();
// if (listener != null && position != RecyclerView.NO_POSITION) {
// listener.onOfferClick(offerItems.get(position), position);
// }
// });
// ivFavorite.setOnClickListener(v -> {
// int position = getAdapterPosition();
// if (listener != null && position != RecyclerView.NO_POSITION) {
// listener.onFavoriteClick(offerItems.get(position), position);
// }
// });
}
void bind(OfferItem offerItem, int position) {
// Set offer data to views
tvTitle.setText(offerItem.getTitle());
tvDescription.setText(offerItem.getDescription());
tvPrice.setText(offerItem.getValue());
tvValidity.setText(offerItem.getEndDate());
// Set heart icon based on category
if (DummyDataProvider.CATEGORY_FAVORITES.equals(offerItem.getCategory())) {
// Use pressed/filled heart for Favorites category
ivFavorite.setImageResource(R.drawable.demo_heart_pressed);
} else {
// Use default/empty heart for other categories
ivFavorite.setImageResource(R.drawable.demo_heart);
}
// Load images from resources
loadOfferImage(offerItem.getImageUrl());
loadLogoImage(offerItem.getLogoUrl());
}
/**
* 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;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Provider class for dummy data to be used in the home screen.
* Contains methods to generate sample data for different offer categories.
*/
public class DummyDataProvider {
// Category IDs
public static final String CATEGORY_TOP_OFFERS = "top_offers";
public static final String CATEGORY_FAVORITES = "favorites";
public static final String CATEGORY_VIABILITY = "viability";
public static final String CATEGORY_FAMILY = "family";
public static final String CATEGORY_FOOD_COFFEE = "food_coffee";
public static final String CATEGORY_TRAVELLING = "travelling";
public static final String CATEGORY_KIDS = "kids";
public static final String CATEGORY_PURCHASES = "purchases";
// Cache for categories
private static Map<String, OfferCategory> categoryCache = new HashMap<>();
/**
* Get all categories with their items
*
* @return List of all offer categories with items
*/
public static List<OfferCategory> getAllCategories() {
List<OfferCategory> categories = new ArrayList<>();
categories.add(getTopOffers());
categories.add(getFavorites());
categories.add(getViability());
categories.add(getFamily());
categories.add(getFoodAndCoffee());
categories.add(getTravelling());
categories.add(getKids());
categories.add(getPurchases());
return categories;
}
/**
* Get a specific category by ID
*
* @param categoryId The category ID to retrieve
* @return The requested category or null if not found
*/
public static OfferCategory getCategoryById(String categoryId) {
if (categoryCache.containsKey(categoryId)) {
return categoryCache.get(categoryId);
}
OfferCategory category = null;
switch (categoryId) {
case CATEGORY_TOP_OFFERS:
category = getTopOffers();
break;
case CATEGORY_FAVORITES:
category = getFavorites();
break;
case CATEGORY_VIABILITY:
category = getViability();
break;
case CATEGORY_FAMILY:
category = getFamily();
break;
case CATEGORY_FOOD_COFFEE:
category = getFoodAndCoffee();
break;
case CATEGORY_TRAVELLING:
category = getTravelling();
break;
case CATEGORY_KIDS:
category = getKids();
break;
case CATEGORY_PURCHASES:
category = getPurchases();
break;
}
if (category != null) {
categoryCache.put(categoryId, category);
}
return category;
}
/**
* Get Top Offers category with items
*
* @return Top Offers category
*/
public static OfferCategory getTopOffers() {
OfferCategory category = new OfferCategory(CATEGORY_TOP_OFFERS, "Top Offers");
category.addItem(new OfferItem("to1", "50% Έκπτωση σε Πακέτα Κινητής",
"Πάρτε τα πακέτα κινητής στη μισή τιμή μόνο αυτό το μήνα",
"30/06/2025", "50%", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to2", "Δωρεάν Εγκατάσταση Τηλεόρασης",
"Επαγγελματική εγκατάσταση με κάθε αγορά νέας τηλεόρασης",
"15/07/2025", "€0", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to3", "Αγοράζεις 1 Παίρνεις 1 Δώρο",
"Σε όλα τα είδη ρουχισμού της καλοκαιρινής μας συλλογής",
"31/08/2025", "100%", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to4", "30% Έκπτωση στα Τρόφιμα",
"Έκπτωση στην πρώτη σας online παραγγελία τροφίμων",
"10/06/2025", "30%", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to5", "Κουπόνι Εστιατορίου €20",
"Με ελάχιστη κατανάλωση €50 σε συνεργαζόμενα εστιατόρια",
"31/07/2025", "€20", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to6", "25% Έκπτωση σε Κρατήσεις Ξενοδοχείων",
"Για διαμονές Σαββατοκύριακου κατά τους καλοκαιρινούς μήνες",
"30/09/2025", "25%", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to7", "Δωρεάν Παράδοση",
"Σε όλες τις online παραγγελίες άνω των €30",
"Ongoing", "€0", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to8", "40% Έκπτωση σε Συνδρομή Γυμναστηρίου",
"Πρώτοι 3 μήνες με μειωμένη τιμή για νέα μέλη",
"31/08/2025", "40%", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to9", "Εισιτήρια Κινηματογράφου €10",
"Ειδική τιμή για όλες τις προβολές Δευτέρα έως Πέμπτη",
"31/12/2025", "€10", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
category.addItem(new OfferItem("to10", "75% Έκπτωση στο Δεύτερο Είδος",
"Αγοράστε ένα είδος σε πλήρη τιμή, πάρτε το δεύτερο με 75% έκπτωση",
"15/06/2025", "75%", "demo_image_dominos.png", "demo_dominos.png", CATEGORY_TOP_OFFERS));
return category;
}
/**
* Get Favorites category with items
*
* @return Favorites category
*/
public static OfferCategory getFavorites() {
OfferCategory category = new OfferCategory(CATEGORY_FAVORITES, "Αγαπημένα");
category.addItem(new OfferItem("fav1", "Αγαπημένο Καφέ",
"15% έκπτωση στον αγαπημένο σας καφέ κάθε μέρα",
"Ongoing", "15%", "demo_image_avis.png", "demo_avis.png", CATEGORY_FAVORITES));
category.addItem(new OfferItem("fav2", "Εβδομαδιαία Έκπτωση Σούπερ Μάρκετ",
"10% έκπτωση στα εβδομαδιαία ψώνια σας",
"Recurring", "10%", "demo_image_avis.png", "demo_avis.png", CATEGORY_FAVORITES));
category.addItem(new OfferItem("fav3", "Αγαπημένο Εστιατόριο",
"Δωρεάν επιδόρπιο με κάθε κυρίως πιάτο",
"31/12/2025", "€0", "demo_image_avis.png", "demo_avis.png", CATEGORY_FAVORITES));
category.addItem(new OfferItem("fav4", "Συνδρομή Βιβλιοπωλείου",
"20% έκπτωση σε όλες τις αγορές με την κάρτα μέλους",
"Ongoing", "20%", "demo_image_avis.png", "demo_avis.png", CATEGORY_FAVORITES));
category.addItem(new OfferItem("fav5", "Συνδρομή Γυμναστηρίου",
"€45 μηνιαίως για απεριόριστη πρόσβαση",
"Auto-renews", "€45", "demo_image_avis.png", "demo_avis.png", CATEGORY_FAVORITES));
// Only keeping 5 items for Favorites category
return category;
}
/**
* Get Viability category with items
*
* @return Viability category
*/
public static OfferCategory getViability() {
OfferCategory category = new OfferCategory(CATEGORY_VIABILITY, "Βιωσιμότητα");
category.addItem(new OfferItem("via1", "Έκπτωση Ανανεώσιμης Ενέργειας",
"20% έκπτωση όταν αλλάζετε σε πράσινα ενεργειακά προγράμματα",
"31/12/2025", "20%", "demo_image_musa.png", "demo_musa.png", CATEGORY_VIABILITY));
category.addItem(new OfferItem("via2", "Φόρτιση Ηλεκτρικών Οχημάτων",
"50% έκπτωση στη φόρτιση σε συνεργαζόμενους σταθμούς",
"30/06/2026", "50%", "demo_image_musa.png", "demo_musa.png", CATEGORY_VIABILITY));
category.addItem(new OfferItem("via3", "Οικολογικά Προϊόντα",
"Αγοράστε βιώσιμα προϊόντα και κερδίστε €10 έκπτωση",
"Ongoing", "€10", "demo_image_musa.png", "demo_musa.png", CATEGORY_VIABILITY));
category.addItem(new OfferItem("via4", "Κάρτα Μέσων Μαζικής Μεταφοράς",
"Μηνιαία κάρτα σε μειωμένη τιμή €30",
"Monthly", "€30", "demo_image_musa.png", "demo_musa.png", CATEGORY_VIABILITY));
category.addItem(new OfferItem("via5", "Ανταμοιβές Ανακύκλωσης",
"Κερδίστε πόντους για ανακύκλωση που μετατρέπονται σε εκπτώσεις",
"Ongoing", "5%", "demo_image_musa.png", "demo_musa.png", CATEGORY_VIABILITY));
category.addItem(new OfferItem("via6", "Συνδρομή Κοινόχρηστων Ποδηλάτων",
"Ετήσια συνδρομή με 40% έκπτωση",
"31/08/2025", "40%", "demo_image_musa.png", "demo_musa.png", CATEGORY_VIABILITY));
category.addItem(new OfferItem("via7", "Ενεργειακά Αποδοτικές Συσκευές",
"€50 επιστροφή χρημάτων σε συσκευές με βαθμολογία A+++",
"31/07/2025", "€50", "demo_image_musa.png", "demo_musa.png", CATEGORY_VIABILITY));
// Only keeping 7 items for Viability category
return category;
}
/**
* Get Family category with items
*
* @return Family category
*/
public static OfferCategory getFamily() {
OfferCategory category = new OfferCategory(CATEGORY_FAMILY, "Family");
category.addItem(new OfferItem("fam1", "Οικογενειακό Πακέτο Κινητής",
"Μοιραστείτε δεδομένα σε 4 γραμμές για €60/μήνα",
"Ongoing", "€60", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam2", "Εισιτήρια Οικογενειακού Πάρκου",
"30% έκπτωση όταν αγοράζετε 4+ εισιτήρια",
"31/08/2025", "30%", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam3", "Παιδιά Τρώνε Δωρεάν",
"Ένα δωρεάν παιδικό γεύμα με κάθε κυρίως πιάτο ενηλίκου",
"Weekdays only", "€0", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam4", "Οικογενειακό Πακέτο Σινεμά",
"4 εισιτήρια + ποπκόρν + αναψυκτικά για €35",
"Weekends", "€35", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam5", "Οικογενειακή Συνδρομή Γυμναστηρίου",
"50% έκπτωση για επιπλέον μέλη της οικογένειας",
"Annual", "50%", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam6", "Οικογενειακή Φωτογράφιση",
"Επαγγελματική φωτογράφιση για €75",
"31/07/2025", "€75", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam7", "Οικογενειακό Πακέτο Ασφάλισης",
"Εξοικονομήστε 25% συνδυάζοντας ασφάλεια σπιτιού και αυτοκινήτου",
"31/12/2025", "25%", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam8", "Οικογενειακό Πακέτο Διακοπών",
"All-inclusive διαμονή με δωρεάν διαμονή για παιδιά",
"30/09/2025", "€0", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam9", "Οικογενειακό Πακέτο Streaming",
"Πολλαπλές υπηρεσίες streaming για €20/μήνα",
"12-month contract", "€20", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam10", "Πακέτο Επιστροφής στο Σχολείο",
"40% έκπτωση σε σχολικά είδη με αγορές άνω των €100",
"31/08/2025", "40%", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
// Adding 2 more items for Family category (12 total)
category.addItem(new OfferItem("fam11", "Οικογενειακό Οδοντιατρικό Πρόγραμμα",
"Ετήσιοι έλεγχοι για όλη την οικογένεια με 30% έκπτωση",
"31/12/2025", "30%", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
category.addItem(new OfferItem("fam12", "Οικογενειακή Βραδιά Παιχνιδιών",
"Αγοράστε 2 επιτραπέζια παιχνίδια και πάρτε 1 δωρεάν",
"Weekend offer", "100%", "demo_image_ranch.png", "demo_ranch.png", CATEGORY_FAMILY));
return category;
}
/**
* Get Food and Coffee category with items
*
* @return Food and Coffee category
*/
public static OfferCategory getFoodAndCoffee() {
OfferCategory category = new OfferCategory(CATEGORY_FOOD_COFFEE, "Φαγητό και καφές");
category.addItem(new OfferItem("fc1", "Συνδρομή Καφέ",
"Καθημερινός καφές για €2 με μηνιαία συνδρομή",
"Monthly", "€2", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc2", "Προσφορά Μεσημεριανού",
"25% έκπτωση στο μενού μεσημεριανού μεταξύ 12-3μμ",
"Weekdays", "25%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc3", "Κάρτα Επιβράβευσης Φούρνου",
"10ο γλυκό δωρεάν με την κάρτα επιβράβευσης",
"Ongoing", "100%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc4", "Δείπνο για Δύο",
"Γεύμα 3 πιάτων με κρασί για €60",
"31/07/2025", "€60", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc5", "Παράδοση Φαγητού",
"Δωρεάν παράδοση για παραγγελίες άνω των €20",
"Ongoing", "€0", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc6", "Εκλεκτοί Κόκκοι Καφέ",
"20% έκπτωση σε premium κόκκους καφέ",
"30/06/2025", "20%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc7", "Προσφορά Πρωινού",
"Καφές και γλυκό για €5",
"Daily until 11am", "€5", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc8", "Gourmet Burger Γεύμα",
"Burger, πατάτες και αναψυκτικό για €12",
"Ongoing", "€12", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc9", "Γευσιγνωσία Κρασιού",
"50% έκπτωση σε συνεδρίες γευσιγνωσίας κρασιού",
"Thursdays", "50%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc10", "Πακέτο Παγωτού",
"Αγοράστε 2 μπάλες και πάρτε 1 δωρεάν",
"Summer offer", "100%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
// Adding 14 more items for Food & Coffee category (24 total)
category.addItem(new OfferItem("fc11", "Εστιατόριο Sushi",
"Φάτε όσο sushi θέλετε για €25",
"Tuesday & Thursday", "€25", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc12", "Χειροποίητο Ψωμί",
"Αγοράστε ένα καρβέλι και πάρτε το δεύτερο στη μισή τιμή",
"Weekends", "50%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc13", "Κόκκοι Καφέ",
"15% έκπτωση σε premium κόκκους μονής προέλευσης",
"Limited stock", "15%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc14", "Βραδιά Πίτσας",
"Οικογενειακή πίτσα με 2 υλικά για €12",
"Every Wednesday", "€12", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc15", "Μπαρ με Smoothies",
"Αγοράστε ένα smoothie και πάρτε το δεύτερο στη μισή τιμή",
"Morning hours", "50%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc16", "Προσφορά Ζυμαρικών",
"Όλα τα πιάτα ζυμαρικών €10 με δωρεάν ψωμί",
"Monday-Thursday", "€10", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc17", "Πιατέλα Επιδορπίων",
"Επιλογή από 5 επιδόρπια για μοίρασμα για €15",
"After 8pm", "€15", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc18", "Μπουφές Πρωινού",
"Πρωινό όσο θέλετε για €12.99",
"7am-10am daily", "€12.99", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc19", "Εξειδικευμένα Τσάγια",
"Αγοράστε οποιοδήποτε τσάι και πάρτε ένα γλυκό δωρεάν",
"Afternoon tea time", "€0", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc20", "Χορτοφαγικό Μενού",
"20% έκπτωση σε όλα τα χορτοφαγικά κυρίως πιάτα",
"All week", "20%", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc21", "Γευσιγνωσία Μπύρας",
"Δοκιμή 4 χειροποίητων μπυρών για €8",
"Happy hour", "€8", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc22", "Πιατέλα Θαλασσινών",
"Πιατέλα θαλασσινών για δύο με κρασί €45",
"Friday & Saturday", "€45", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc23", "Προσφορά Brunch",
"Brunch με mimosa για €18",
"Weekends 11am-3pm", "€18", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
category.addItem(new OfferItem("fc24", "Gourmet Σάντουιτς",
"Gourmet σάντουιτς με συνδυασμό σούπας €9.50",
"Lunch special", "€9.50", "demo_image_coffee.png", "demo_coffee.png", CATEGORY_FOOD_COFFEE));
return category;
}
/**
* Get Travelling category with items
*
* @return Travelling category
*/
public static OfferCategory getTravelling() {
OfferCategory category = new OfferCategory(CATEGORY_TRAVELLING, "Απόδραση");
category.addItem(new OfferItem("tr1", "Έκπτωση Αεροπορικών",
"15% έκπτωση σε διεθνείς πτήσεις",
"31/08/2025", "15%", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
category.addItem(new OfferItem("tr2", "Διαμονή σε Ξενοδοχείο",
"3 νύχτες στην τιμή των 2 σε συνεργαζόμενα ξενοδοχεία",
"30/09/2025", "33%", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
category.addItem(new OfferItem("tr3", "Ενοικίαση Αυτοκινήτου",
"€25 έκπτωση σε εβδομαδιαίες ενοικιάσεις αυτοκινήτων",
"31/12/2025", "€25", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
category.addItem(new OfferItem("tr4", "Ταξιδιωτική Ασφάλεια",
"20% έκπτωση σε ετήσια ταξιδιωτική ασφάλεια",
"30/06/2025", "20%", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
category.addItem(new OfferItem("tr5", "Ξενάγηση Πόλης",
"Αγοράστε ένα εισιτήριο και πάρτε ένα δωρεάν",
"31/07/2025", "100%", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
category.addItem(new OfferItem("tr6", "Πρόσβαση σε Lounge Αεροδρομίου",
"€15 για πρόσβαση σε lounge ανεξαρτήτως κατηγορίας εισιτηρίου",
"Ongoing", "€15", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
category.addItem(new OfferItem("tr7", "Έκπτωση Κρουαζιέρας",
"30% έκπτωση σε επιλεγμένα πακέτα κρουαζιέρας",
"31/08/2025", "30%", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
category.addItem(new OfferItem("tr8", "Αξεσουάρ Ταξιδιού",
"Αγοράστε 2 και πάρτε 1 δωρεάν σε είδη ταξιδιού",
"While stocks last", "100%", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
category.addItem(new OfferItem("tr9", "Μεταφορά από/προς Αεροδρόμιο",
"€10 έκπτωση σε ιδιωτικές μεταφορές από/προς αεροδρόμιο",
"31/12/2025", "€10", "demo_image_ninemia.png", "demo_ninemia.png", CATEGORY_TRAVELLING));
// Only keeping 9 items for Travelling category
return category;
}
/**
* Get Kids category with items
*
* @return Kids category
*/
public static OfferCategory getKids() {
OfferCategory category = new OfferCategory(CATEGORY_KIDS, "Παιδί");
category.addItem(new OfferItem("kid1", "Έκπτωση σε Κατάστημα Παιχνιδιών",
"25% έκπτωση σε όλα τα παιχνίδια αυτό το Σαββατοκύριακο",
"Sunday", "25%", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid2", "Παιδικά Ρούχα",
"Αγοράστε 2 και πάρτε 1 δωρεάν σε παιδικά ρούχα",
"31/07/2025", "100%", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid3", "Εσωτερική Παιδική Χαρά",
"€5 είσοδος για απεριόριστο παιχνίδι",
"Weekdays", "€5", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid4", "Παιδικά Βιβλία",
"30% έκπτωση σε εκπαιδευτικά βιβλία",
"30/06/2025", "30%", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid5", "Μαθήματα Κολύμβησης",
"Πρώτο μάθημα δωρεάν, μετά €10 ανά μάθημα",
"Summer offer", "€0", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid6", "Παιδικό Κούρεμα",
"Ειδική τιμή €8 για παιδιά κάτω των 12 ετών",
"Ongoing", "€8", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid7", "Παιδικό Μουσείο",
"Οικογενειακό εισιτήριο για €25 (έως 4 άτομα)",
"31/12/2025", "€25", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid8", "Παιδικό Κουτί Γεύματος",
"20% έκπτωση σε συνδρομή υγιεινών γευμάτων",
"First 3 months", "20%", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid9", "Είδη Ζωγραφικής",
"40% έκπτωση σε είδη τέχνης και χειροτεχνίας",
"Back to school offer", "40%", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
category.addItem(new OfferItem("kid10", "Παιδικός Αθλητικός Εξοπλισμός",
"Αγοράστε πλήρες σετ και εξοικονομήστε €15",
"31/08/2025", "€15", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
// Adding 1 more item for Kids category (11 total)
category.addItem(new OfferItem("kid11", "Μαθήματα Προγραμματισμού για Παιδιά",
"Πρώτο μάθημα δωρεάν για παιδιά 8-12 ετών",
"New enrollments", "€0", "demo_image_moustakas.png", "demo_moustakas.png", CATEGORY_KIDS));
return category;
}
/**
* Get Purchases category with items
*
* @return Purchases category
*/
public static OfferCategory getPurchases() {
OfferCategory category = new OfferCategory(CATEGORY_PURCHASES, "Αγορές");
category.addItem(new OfferItem("pur1", "Κατάστημα Ηλεκτρονικών",
"€50 έκπτωση σε αγορές άνω των €300",
"30/06/2025", "€50", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur2", "Προσφορά Επίπλων",
"Έως και 40% έκπτωση σε επιλεγμένα έπιπλα",
"While stocks last", "40%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur3", "Online Αγορές",
"15% έκπτωση στην πρώτη σας αγορά με κωδικό",
"New customers", "15%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur4", "Αναβάθμιση Smartphone",
"Ανταλλάξτε το παλιό σας τηλέφωνο και πάρτε €100 επιπλέον αξία",
"31/07/2025", "€100", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur5", "Οικιακές Συσκευές",
"Δωρεάν παράδοση και εγκατάσταση",
"On purchases over €500", "€0", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur6", "Αθλητικά Ρούχα",
"30% έκπτωση σε παπούτσια για τρέξιμο και ρούχα",
"31/08/2025", "30%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur7", "Προϊόντα Ομορφιάς",
"Αγοράστε 3 και πάρτε 1 δωρεάν στη σειρά περιποίησης δέρματος",
"30/09/2025", "100%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur8", "Συσκευές Κουζίνας",
"25% έκπτωση σε συσκευές κουζίνας",
"Weekend sale", "25%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur9", "Έπιπλα Κήπου",
"Εκκαθάριση τέλους σεζόν - 50% έκπτωση",
"Until sold out", "50%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur10", "Αξεσουάρ Τεχνολογίας",
"Αγοράστε 2 αξεσουάρ και εξοικονομήστε €10",
"31/12/2025", "€10", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
// Adding 22 more items for Purchases category (32 total)
category.addItem(new OfferItem("pur11", "Γυαλιά Ηλίου Επώνυμων Οίκων",
"30% έκπτωση σε γυαλιά ηλίου επώνυμων οίκων",
"Summer sale", "30%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur12", "Αναβάθμιση Laptop",
"Ανταλλάξτε το παλιό σας laptop και πάρτε €150 έκπτωση",
"Back to school", "€150", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur13", "Σετ Κλινοσκεπασμάτων",
"Αγοράστε ένα σετ κλινοσκεπασμάτων και πάρτε το δεύτερο στη μισή τιμή",
"Home sale", "50%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur14", "Συσκευές Έξυπνου Σπιτιού",
"20% έκπτωση σε όλα τα προϊόντα έξυπνου σπιτιού",
"Tech week", "20%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur15", "Έπιπλα Εξωτερικού Χώρου",
"Έως και 40% έκπτωση σε σετ επίπλων εξωτερικού χώρου",
"Garden sale", "40%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur16", "Ρολόγια Επώνυμων Οίκων",
"15% έκπτωση σε πολυτελή ρολόγια",
"Limited time", "15%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur17", "Συσκευές Κουζίνας",
"Αγοράστε 2 μικρές συσκευές και πάρτε 1 δωρεάν",
"Kitchen sale", "100%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur18", "Εξοπλισμός Γυμναστικής",
"25% έκπτωση σε εξοπλισμό γυμναστικής για το σπίτι",
"Fitness sale", "25%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur19", "Πολυτελή Κλινοσκεπάσματα",
"Σεντόνια από αιγυπτιακό βαμβάκι με 30% έκπτωση",
"Bedroom essentials", "30%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur20", "Τσάντες Επώνυμων Οίκων",
"Έως και 25% έκπτωση σε επιλεγμένες επώνυμες τσάντες",
"Accessory sale", "25%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur21", "Έξυπνες Τηλεοράσεις",
"€100 έκπτωση σε τηλεοράσεις 55\" και μεγαλύτερες",
"Entertainment sale", "€100", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur22", "Χειμερινά Ρούχα",
"Αγοράστε 3 χειμερινά είδη και πάρτε 1 δωρεάν",
"Winter collection", "100%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur23", "Σετ Μαγειρικών Σκευών",
"Επαγγελματικά σετ μαγειρικών σκευών με 40% έκπτωση",
"Kitchen essentials", "40%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur24", "Ασύρματα Ακουστικά",
"Premium ασύρματα ακουστικά με €30 έκπτωση",
"Audio sale", "€30", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur25", "Πολυτελή Αρώματα",
"25% έκπτωση σε αρώματα επώνυμων οίκων",
"Beauty sale", "25%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur26", "Κονσόλες Παιχνιδιών",
"Δωρεάν παιχνίδι με την αγορά κονσόλας",
"Gaming sale", "€60", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur27", "Είδη Μπάνιου",
"30% έκπτωση σε είδη ανακαίνισης μπάνιου",
"Home improvement", "30%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur28", "Εξοπλισμός Κάμπινγκ",
"Αγοράστε σκηνή και πάρτε υπνόσακο στη μισή τιμή",
"Outdoor sale", "50%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur29", "Έπιπλα Γραφείου",
"Εργονομικές καρέκλες γραφείου με 20% έκπτωση",
"Work from home", "20%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur30", "Προσφορά Κοσμημάτων",
"40% έκπτωση σε συλλογή ασημένιων κοσμημάτων",
"Accessory sale", "40%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur31", "Έξυπνα Ρολόγια",
"Τελευταία μοντέλα έξυπνων ρολογιών με €50 έκπτωση",
"Tech sale", "€50", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
category.addItem(new OfferItem("pur32", "Σετ Αποσκευών",
"Premium σετ αποσκευών με 35% έκπτωση",
"Travel essentials", "35%", "demo_image_migato.png", "demo_migato.png", CATEGORY_PURCHASES));
return category;
}
}
package ly.warp.sdk.io.models;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Model class representing a category of offers with its associated items.
*/
public class OfferCategory implements Serializable {
private String id;
private String name;
private List<OfferItem> items;
/**
* Default constructor
*/
public OfferCategory() {
this.items = new ArrayList<>();
}
/**
* Constructor with id and name
*
* @param id Unique identifier for the category
* @param name Display name of the category
*/
public OfferCategory(String id, String name) {
this.id = id;
this.name = name;
this.items = new ArrayList<>();
}
/**
* Full constructor
*
* @param id Unique identifier for the category
* @param name Display name of the category
* @param items List of offer items in this category
*/
public OfferCategory(String id, String name, List<OfferItem> items) {
this.id = id;
this.name = name;
this.items = items != null ? items : new ArrayList<>();
}
// Getters and Setters
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<OfferItem> getItems() {
return items;
}
public void setItems(List<OfferItem> items) {
this.items = items != null ? items : new ArrayList<>();
}
/**
* Add a single item to the category
*
* @param item The offer item to add
*/
public void addItem(OfferItem item) {
if (items == null) {
items = new ArrayList<>();
}
items.add(item);
}
/**
* Get the number of items in this category
*
* @return The count of items
*/
public int getItemCount() {
return items != null ? items.size() : 0;
}
/**
* Get the formatted name with item count
*
* @return Category name with item count in parentheses
*/
public String getFormattedName() {
return name + " (" + getItemCount() + ")";
}
}
package ly.warp.sdk.io.models;
import java.io.Serializable;
/**
* Model class representing an offer item to be displayed in the home screen.
*/
public class OfferItem implements Serializable {
private String id;
private String title;
private String description;
private String endDate;
private String value;
private String imageUrl;
private String logoUrl;
private String category;
/**
* Default constructor
*/
public OfferItem() {
}
/**
* Full constructor for creating an offer item
*
* @param id Unique identifier for the offer
* @param title Title of the offer
* @param description Description of the offer
* @param endDate End date of the offer (formatted as string)
* @param value Value of the offer (formatted as string, e.g., "50%", "€20")
* @param imageUrl URL or resource name for the offer image
* @param logoUrl URL or resource name for the merchant logo
* @param category Category this offer belongs to
*/
public OfferItem(String id, String title, String description, String endDate,
String value, String imageUrl, String logoUrl, String category) {
this.id = id;
this.title = title;
this.description = description;
this.endDate = endDate;
this.value = value;
this.imageUrl = imageUrl;
this.logoUrl = logoUrl;
this.category = category;
}
// Getters and Setters
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getLogoUrl() {
return logoUrl;
}
public void setLogoUrl(String logoUrl) {
this.logoUrl = logoUrl;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
/**
* Returns the value (already formatted with % or € symbol)
* @return Value string
*/
public String getFormattedValue() {
return value;
}
}
package ly.warp.sdk.utils;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.Shader;
import androidx.annotation.NonNull;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import java.security.MessageDigest;
/**
* Glide transformation to round only the top corners of an image
*/
public class TopRoundedCornersTransformation extends BitmapTransformation {
private static final String ID = "ly.warp.sdk.utils.TopRoundedCornersTransformation";
private final int radius;
/**
* Constructor
*
* @param radius Corner radius in pixels
*/
public TopRoundedCornersTransformation(int radius) {
this.radius = radius;
}
@Override
protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
return roundTopCorners(pool, toTransform);
}
private Bitmap roundTopCorners(BitmapPool pool, Bitmap source) {
if (source == null) return null;
Bitmap result = pool.get(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
if (result == null) {
result = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
}
Canvas canvas = new Canvas(result);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
// Create path with rounded top corners
Path path = new Path();
RectF rectF = new RectF(0, 0, source.getWidth(), source.getHeight());
float[] radii = new float[]{
radius, radius, // top-left
radius, radius, // top-right
0, 0, // bottom-right
0, 0 // bottom-left
};
path.addRoundRect(rectF, radii, Path.Direction.CW);
// Draw rounded rectangle
canvas.drawPath(path, paint);
return result;
}
@Override
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
messageDigest.update((ID + radius).getBytes());
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TopRoundedCornersTransformation that = (TopRoundedCornersTransformation) o;
return radius == that.radius;
}
@Override
public int hashCode() {
return ID.hashCode() + radius;
}
}
......@@ -167,6 +167,30 @@ public class WarplyManagerHelper {
context.startActivity(WarpViewActivity.createIntentFromURL(context, (WarplyProperty.getSupermarketsUrl(context) + WarpConstants.SUPERMARKETS_MAP)));
}
public static void openContest(Context context) {
final String mContestUrl = "https://warply.s3.amazonaws.com/dei/campaigns/DehEasterContest_stage/index.html";
JSONObject params = new JSONObject();
try {
params.putOpt("web_id", WarpUtils.getWebId(context));
params.putOpt("app_uuid", WarplyProperty.getAppUuid(context));
params.putOpt("api_key", WarpUtils.getApiKey(context));
params.putOpt("session_uuid", "");
params.putOpt("access_token", WarplyDBHelper.getInstance(context).getAuthValue("access_token"));
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) {
e.printStackTrace();
}
WarpUtils.setWebviewParams(context, params);
context.startActivity(WarpViewActivity.createIntentFromURL(context, mContestUrl));
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
......
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 horizontal spacing between RecyclerView items.
* Adds spacing to the right of each item except the last one.
*/
public class HorizontalSpaceItemDecoration extends RecyclerView.ItemDecoration {
private final int spaceWidth;
/**
* Constructor
*
* @param spaceWidth Space width in pixels
*/
public HorizontalSpaceItemDecoration(int spaceWidth) {
this.spaceWidth = spaceWidth;
}
@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
// Add spacing to the right of each item except the last one
int position = parent.getChildAdapterPosition(view);
if (position != RecyclerView.NO_POSITION && position != parent.getAdapter().getItemCount() - 1) {
outRect.right = spaceWidth;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<corners android:radius="1000dp" />
<solid android:color="@color/pink" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="9dp"
android:topRightRadius="9dp" />
<solid android:color="@android:color/transparent" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp" />
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="@color/black2" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="9dp" />
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/grey" />
</shape>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_grey_light">
......@@ -33,15 +34,15 @@
<ImageView
android:id="@+id/green_icon"
android:layout_width="52dp"
android:layout_height="20dp"
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="52dp"
android:layout_height="20dp"
android:layout_width="58dp"
android:layout_height="22dp"
android:src="@drawable/demo_family" />
</LinearLayout>
......@@ -49,7 +50,6 @@
android:id="@+id/profile_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical|end"
android:src="@drawable/demo_profile" />
</LinearLayout>
......@@ -60,6 +60,382 @@
android:scaleType="fitXY"
android:src="@drawable/demo_home_banner" />
<!-- Top Offers Section -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp">
<LinearLayout
android:id="@+id/ll_recycler1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_recycler_category1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textStyle="bold"
android:textSize="16sp"
tools:text="Top Offers (10)" />
<TextView
android:id="@+id/tv_recycler_all1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
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_recycler1"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:clipToPadding="false" />
</RelativeLayout>
<!-- Favorites Section -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp">
<LinearLayout
android:id="@+id/ll_recycler2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_recycler_category2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textStyle="bold"
android:textSize="16sp"
tools:text="Favorites (10)" />
<TextView
android:id="@+id/tv_recycler_all2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_recycler2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_recycler2"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:clipToPadding="false" />
</RelativeLayout>
<!-- Viability Section -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp">
<LinearLayout
android:id="@+id/ll_recycler3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_recycler_category3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textStyle="bold"
android:textSize="16sp"
tools:text="Viability (10)" />
<TextView
android:id="@+id/tv_recycler_all3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_recycler3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_recycler3"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:clipToPadding="false" />
</RelativeLayout>
<!-- Family Section -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp">
<LinearLayout
android:id="@+id/ll_recycler4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_recycler_category4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textStyle="bold"
android:textSize="16sp"
tools:text="Family (10)" />
<TextView
android:id="@+id/tv_recycler_all4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_recycler4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_recycler4"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:clipToPadding="false" />
</RelativeLayout>
<!-- Food and Coffee Section -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp">
<LinearLayout
android:id="@+id/ll_recycler5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_recycler_category5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textStyle="bold"
android:textSize="16sp"
tools:text="Food and Coffee (10)" />
<TextView
android:id="@+id/tv_recycler_all5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_recycler5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_recycler5"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:clipToPadding="false" />
</RelativeLayout>
<!-- Travelling Section -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp">
<LinearLayout
android:id="@+id/ll_recycler6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_recycler_category6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textStyle="bold"
android:textSize="16sp"
tools:text="Travelling (10)" />
<TextView
android:id="@+id/tv_recycler_all6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_recycler6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_recycler6"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:clipToPadding="false" />
</RelativeLayout>
<!-- Kids Section -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp">
<LinearLayout
android:id="@+id/ll_recycler7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_recycler_category7"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textStyle="bold"
android:textSize="16sp"
tools:text="Kids (10)" />
<TextView
android:id="@+id/tv_recycler_all7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_recycler7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_recycler7"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:clipToPadding="false" />
</RelativeLayout>
<!-- Purchases Section -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginBottom="48dp">
<LinearLayout
android:id="@+id/ll_recycler8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingHorizontal="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_recycler_category8"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/black2"
android:textStyle="bold"
android:textSize="16sp"
tools:text="Purchases (10)" />
<TextView
android:id="@+id/tv_recycler_all8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_transparent_border_black"
android:paddingHorizontal="16dp"
android:paddingVertical="6dp"
android:text="@string/demo_all"
android:textColor="@color/black3"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rl_recycler8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_recycler8"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:clipToPadding="false" />
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
......
<?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="260dp"
android:layout_height="250dp"
android:background="@drawable/demo_shape_white_border_grey">
<!-- Main Offer Image -->
<ImageView
android:id="@+id/iv_offer_image"
android:layout_width="match_parent"
android:layout_height="140dp"
android:scaleType="centerCrop"
tools:src="@drawable/demo_home_banner" />
<!-- Heart Icon (Favorite) -->
<ImageView
android:id="@+id/iv_favorite"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="8dp"
android:src="@drawable/demo_heart" />
<!-- Price Badge -->
<TextView
android:id="@+id/tv_price"
android:layout_width="68dp"
android:layout_height="68dp"
android:layout_alignParentEnd="true"
android:layout_margin="8dp"
android:background="@drawable/demo_shape_pink"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="16sp"
android:textStyle="bold"
tools:text="17,95€" />
<!-- Content Section -->
<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="16sp"
android:textStyle="bold"
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:layout_marginTop="2dp"
android:maxLines="2"
android:textColor="@color/black3"
android:textSize="13sp"
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="12dp"
android:maxLines="1"
android:textColor="#757575"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_description"
tools:text="έως 30-09" />
<!-- Brand Logo -->
<ImageView
android:id="@+id/iv_logo"
android:layout_width="60dp"
android:layout_height="60dp"
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>
......@@ -13,6 +13,10 @@
<color name="blue_dark">#3A5266</color>
<color name="white">#FFFFFF</color>
<color name="cos_green5">#79BF14</color>
<color name="black2">#000F1E</color>
<color name="black3">#00111B</color>
<color name="grey">#CCCCCC</color>
<color name="pink">#EE417D</color>
<!-- Used in styles -->
<color name="cos_light_blue">#00A5E3</color>
......
<resources>
<string name="lbl_cosmote_webview_permission_title">COSMOTE</string>
<string name="lbl_cosmote_webview_permission_message">Το COSMOTE ζητάει πρόσβαση στην τοποθεσία σας.</string>
<string name="lbl_cosmote_webview_permission_title">Demo App</string>
<string name="lbl_cosmote_webview_permission_message">Το Demo App ζητάει πρόσβαση στην τοποθεσία σας.</string>
<string name="lbl_take_photo_accept">Οκ</string>
<string name="lbl_take_photo_decline">Άκυρο</string>
<string name="welcome_user">Γεια σου %1$s !</string>
......@@ -10,4 +10,5 @@
<string name="menu_home">Αρχική</string>
<string name="demo_sm_flow">Open SM Flow</string>
<string name="demo_sm_map">Open SM Map</string>
<string name="demo_all">Όλα</string>
</resources>
......