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(
......@@ -388,14 +403,14 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// ===========================================================
// Methods
// ===========================================================
/**
* Sets up the banner carousel with ViewPager2 and pagination dots
*/
private void setupBannerCarousel() {
mBannerViewPager = findViewById(R.id.banner_viewpager);
mDotsContainer = findViewById(R.id.dots_container);
// Setup adapter with 5 banner images
List<Integer> bannerImages = getBannerImages();
mBannerAdapter = new BannerAdapter(this, bannerImages);
......@@ -403,12 +418,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
// Handle banner click (same as the original banner click)
WarplyManagerHelper.openContest(this);
});
mBannerViewPager.setAdapter(mBannerAdapter);
// Setup pagination dots
setupPaginationDots(bannerImages.size());
// Handle page changes
mBannerViewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
@Override
......@@ -417,53 +432,55 @@ public class HomeActivity extends Activity implements View.OnClickListener, Offe
}
});
}
/**
* Returns a list of banner image resource IDs
*/
private List<Integer> getBannerImages() {
return Arrays.asList(
R.drawable.demo_home_banner1,
R.drawable.demo_home_banner2,
R.drawable.demo_home_banner3,
R.drawable.demo_home_banner4,
R.drawable.demo_home_banner5
R.drawable.demo_home_banner1,
R.drawable.demo_home_banner2,
R.drawable.demo_home_banner3,
R.drawable.demo_home_banner4,
R.drawable.demo_home_banner5
);
}
/**
* Sets up the pagination dots
*
* @param count Number of dots to display
*/
private void setupPaginationDots(int count) {
mDots = new ArrayList<>();
mDotsContainer.removeAllViews();
// Create dots
for (int i = 0; i < count; i++) {
ImageView dot = new ImageView(this);
// Set dot appearance
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
);
// Add margin between dots
params.setMargins(8, 0, 8, 0);
dot.setLayoutParams(params);
// Set initial state (first dot active, others inactive)
dot.setImageResource(i == 0 ? R.drawable.dot_active : R.drawable.dot_inactive);
// Add to container and list
mDotsContainer.addView(dot);
mDots.add(dot);
}
}
/**
* Updates the dots to reflect the current page
*
* @param position Current page position
*/
private void updateDots(int position) {
......
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);
}
}
......@@ -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" />
......
This diff is collapsed. Click to expand it.
......@@ -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>
......