Panagiotis Triantafyllou

redesign part5

Showing 23 changed files with 587 additions and 158 deletions
......@@ -57,6 +57,12 @@
android:theme="@style/SDKAppTheme" />
<activity
android:name=".activities.CouponsActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/SDKAppTheme" />
<activity
android:name=".dexter.PermissionsActivity"
android:exported="false"
android:launchMode="singleInstance"
......@@ -66,7 +72,7 @@
<activity
android:name=".activities.BaseFragmentActivity"
android:exported="true"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"/>
<!-- Service used for updating user's location. -->
<service
......
package ly.warp.sdk.activities;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.TypedValue;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import ly.warp.sdk.R;
import ly.warp.sdk.io.adapters.CouponAdapter;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.views.VerticalSpaceItemDecoration;
public class CouponsActivity extends Activity implements View.OnClickListener,
CouponAdapter.OnCouponClickListener {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private ImageView mIvBack;
private LinearLayout mLlFilterActive, mLlFilterExpired;
private RecyclerView mRvCoupons;
private CouponAdapter mCouponsAdapter;
private TextView mBtnFilterActive, mBtnFilterExpired, mTvHeaderTitle;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_coupons);
initViews();
WarpUtils.applyEdgeToEdge(this,
findViewById(R.id.header_layout),
null);
setupMyCouponsSection();
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.iv_back) {
onBackPressed();
} else if (id == R.id.ll_filter_active) {
// filterCoupons(CouponItem.STATUS_ACTIVE);
} else if (id == R.id.ll_filter_redeemed) {
// filterCoupons(CouponItem.STATUS_REDEEMED);
}
}
@Override
public void onCouponClick(Coupon couponItem, int position) {
Intent myIntent = new Intent(CouponsActivity.this, SingleCouponActivity.class);
myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, (Parcelable) couponItem);
startActivity(myIntent);
}
@Override
public void onFavoriteClick(Coupon couponItem, int position) {
// Handle favorite click if needed
}
// ===========================================================
// Methods
// ===========================================================
private void initViews() {
mIvBack = findViewById(R.id.iv_back);
mIvBack.setOnClickListener(this);
// Initialize My Coupons section
mRvCoupons = findViewById(R.id.rv_coupons);
mLlFilterActive = findViewById(R.id.ll_filter_active);
mBtnFilterActive = findViewById(R.id.btn_filter_active);
mLlFilterExpired = findViewById(R.id.ll_filter_redeemed);
mBtnFilterExpired = findViewById(R.id.btn_filter_redeemed);
mTvHeaderTitle = findViewById(R.id.tv_header_title);
// Set click listeners for filter buttons
mLlFilterActive.setOnClickListener(this);
mLlFilterExpired.setOnClickListener(this);
WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle,
mBtnFilterActive, mBtnFilterExpired);
}
private void setupMyCouponsSection() {
LinearLayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
mRvCoupons.setLayoutManager(layoutManager);
mRvCoupons.setHasFixedSize(true);
mCouponsAdapter = new CouponAdapter(this, WarplyManagerHelper.getCoupons());
mCouponsAdapter.setOnCouponClickListener(this);
mRvCoupons.setAdapter(mCouponsAdapter);
int verticalSpacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics());
mRvCoupons.addItemDecoration(new VerticalSpaceItemDecoration(verticalSpacingInPixels));
// filterCoupons(CouponItem.STATUS_ACTIVE);
}
private void filterCoupons(String status) {
// Reset all filter button styles
// mBtnFilterActive.setBackgroundResource(R.drawable.shape_transparent_black_border);
// mBtnFilterActive.setTextColor(getResources().getColor(R.color.custom_black2));
// mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_transparent_black_border);
// mBtnFilterRedeemed.setTextColor(getResources().getColor(R.color.custom_black2));
// Set selected filter button style
// if (CouponItem.STATUS_ACTIVE.equals(status)) {
// mBtnFilterActive.setBackgroundResource(R.drawable.shape_rectangle_rounded_black);
// mBtnFilterActive.setTextColor(Color.WHITE);
// } else if (CouponItem.STATUS_REDEEMED.equals(status)) {
// mBtnFilterRedeemed.setBackgroundResource(R.drawable.shape_rectangle_rounded_black);
// mBtnFilterRedeemed.setTextColor(Color.WHITE);
// }
// Apply filter to adapter
// mCouponsAdapter.filterByStatus(status);
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
......@@ -31,6 +31,7 @@ import ly.warp.sdk.io.adapters.BannerAdapter;
import ly.warp.sdk.io.adapters.CouponsetAdapter;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.BannerItem;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.io.models.User;
import ly.warp.sdk.utils.WarpUtils;
......@@ -51,8 +52,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
// ===========================================================
private RelativeLayout mPbLoading;
private TextView mTvHeaderTitle;
private LinearLayout mLlUserTags;
private TextView mTvHeaderTitle, mTvMyCouponsTitle, mTvMyCouponsValue;
private LinearLayout mLlUserTags, mLlMyCoupons;
/* View Pager */
// private ViewPager2 mBannerViewPager;
private RecyclerView mRvBannerViewPager;
......@@ -84,6 +85,8 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
mPbLoading.setVisibility(View.VISIBLE);
mSectionsLoading.setVisibility(View.VISIBLE);
WarplyManager.getCoupons(mCouponsCallback);
WarplyManager.getCampaigns(mCampaignsCallback);
WarplyManager.getCouponsets(mCouponsetsCallback);
}
......@@ -96,7 +99,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
@Override
public void onClick(View v) {
if (v.getId() == R.id.profile_icon) {
Intent myIntent = new Intent(HomeActivity.this, ProfileActivity.class);
// Intent myIntent = new Intent(HomeActivity.this, ProfileActivity.class);
// startActivity(myIntent);
return;
}
if (v.getId() == R.id.ll_my_coupons) {
Intent myIntent = new Intent(HomeActivity.this, CouponsActivity.class);
startActivity(myIntent);
}
}
......@@ -115,18 +123,21 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
private void initViews() {
mPbLoading = findViewById(R.id.pb_loading);
mPbLoading.setOnTouchListener((v, event) -> true);
mLlMyCoupons = findViewById(R.id.ll_my_coupons);
mLlMyCoupons.setOnClickListener(this);
mViewPager = findViewById(R.id.cl_viewpager);
mSectionsContainer = findViewById(R.id.ll_sections_container);
mSectionsLoading = findViewById(R.id.rl_sections_loading);
mTvMyCouponsTitle = findViewById(R.id.tv_my_coupons_title);
mTvMyCouponsValue = findViewById(R.id.tv_my_coupons_value);
mIvProfile = findViewById(R.id.profile_icon);
mIvProfile.setOnClickListener(this);
mTvHeaderTitle = findViewById(R.id.tv_header_title);
mLlUserTags = findViewById(R.id.ll_user_tags);
mRvBannerViewPager = findViewById(R.id.banner_viewpager);
WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle);
WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle, mTvMyCouponsValue);
WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, mTvMyCouponsTitle);
}
private void setUpUser() {
......@@ -270,7 +281,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
LayoutInflater inflater = LayoutInflater.from(this);
int spacingInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
int sectionMarginTopPx = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 40, getResources().getDisplayMetrics());
// int sectionIndex = 0;
for (Map.Entry<String, ArrayList<Couponset>> entry : categorizedMap.entrySet()) {
String categoryName = entry.getKey();
ArrayList<Couponset> couponsets = entry.getValue();
......@@ -281,6 +295,12 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
View sectionView = inflater.inflate(R.layout.item_couponset_section, mSectionsContainer, false);
// if (sectionIndex > 0) {
LinearLayout.LayoutParams sectionParams = (LinearLayout.LayoutParams) sectionView.getLayoutParams();
sectionParams.topMargin = sectionMarginTopPx;
sectionView.setLayoutParams(sectionParams);
// }
TextView tvTitle = sectionView.findViewById(R.id.tv_section_title);
String titleText = categoryName + " (" + couponsets.size() + ")";
tvTitle.setText(titleText);
......@@ -304,6 +324,7 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
rvSection.setAdapter(adapter);
mSectionsContainer.addView(sectionView);
// sectionIndex++;
}
mSectionsLoading.setVisibility(View.GONE);
}
......@@ -362,4 +383,16 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
mSectionsLoading.setVisibility(View.GONE);
}
};
private final CallbackReceiver<ArrayList<Coupon>> mCouponsCallback = new CallbackReceiver<ArrayList<Coupon>>() {
@Override
public void onSuccess(ArrayList<Coupon> result) {
mTvMyCouponsValue.setText(String.valueOf(result.size()));
}
@Override
public void onFailure(int errorCode) {
}
};
}
......
......@@ -141,9 +141,6 @@ public class SingleCouponActivity extends Activity implements View.OnClickListen
if (mOfferItem.getExpiration() != null && !mOfferItem.getExpiration().isEmpty()) {
String formattedDate = formatValidityDate(mOfferItem.getExpiration());
mTvEndDate.setText(getString(R.string.demo_valid_until, formattedDate));
mTvEndDate.setVisibility(View.VISIBLE);
} else {
mTvEndDate.setVisibility(View.GONE);
}
if (mOfferItem.getCouponsetDetails() != null && mOfferItem.getCouponsetDetails().getImg_preview() != null && !TextUtils.isEmpty(mOfferItem.getCouponsetDetails().getImg_preview())) {
......
......@@ -154,9 +154,6 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
if (mOfferItem.getEndDate() != null && !mOfferItem.getEndDate().isEmpty()) {
String formattedDate = formatValidityDate(mOfferItem.getEndDate());
mTvEndDate.setText(getString(R.string.demo_valid_until, formattedDate));
mTvEndDate.setVisibility(View.VISIBLE);
} else {
mTvEndDate.setVisibility(View.GONE);
}
if (!TextUtils.isEmpty(mOfferItem.getImg_preview())) {
......
......@@ -112,26 +112,23 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
* 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 tvMerchant;
private final TextView tvTitle;
private final TextView tvDescription;
private final TextView tvValidity;
private final TextView tvEndDate;
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);
tvMerchant = itemView.findViewById(R.id.tv_merchant);
tvTitle = itemView.findViewById(R.id.tv_title);
tvDescription = itemView.findViewById(R.id.tv_description);
tvValidity = itemView.findViewById(R.id.tv_validity);
tvEndDate = itemView.findViewById(R.id.tv_coupon_end_date);
WarpUtils.renderCustomFont(context, R.font.ping_lcg_bold, tvPrice, tvTitle);
WarpUtils.renderCustomFont(context, R.font.ping_lcg_regular, tvDescription, tvValidity);
WarpUtils.renderCustomFont(context, R.font.ping_lcg_bold, tvTitle,
tvMerchant, tvEndDate);
WarpUtils.renderCustomFont(context, R.font.ping_lcg_regular, tvDescription);
// Set click listeners
itemView.setOnClickListener(v -> {
......@@ -140,36 +137,17 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
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(Coupon couponItem, int position) {
tvTitle.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getName()) ? couponItem.getCouponsetDetails().getName() : "");
tvDescription.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getShort_description()) ? couponItem.getCouponsetDetails().getShort_description() : "");
tvPrice.setText(!TextUtils.isEmpty(couponItem.getDiscount()) ? couponItem.getDiscount() : "");
tvMerchant.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getAdmin_name()) ? couponItem.getCouponsetDetails().getAdmin_name().trim() : "");
tvTitle.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getName()) ? couponItem.getCouponsetDetails().getName().trim() : "");
tvDescription.setText(!TextUtils.isEmpty(couponItem.getCouponsetDetails().getShort_description()) ? couponItem.getCouponsetDetails().getShort_description().trim() : "");
if (couponItem.getCouponsetDetails().getEndDate() != null && !couponItem.getCouponsetDetails().getEndDate().isEmpty()) {
tvValidity.setText(formatValidityDate(couponItem.getCouponsetDetails().getEndDate()));
tvValidity.setVisibility(View.VISIBLE);
} else {
tvValidity.setVisibility(View.GONE);
String formattedDate = formatValidityDate(couponItem.getCouponsetDetails().getEndDate().trim());
tvEndDate.setText(context.getString(R.string.demo_valid_until, formattedDate));
}
// 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);
// }
loadCouponImage(couponItem.getCouponsetDetails().getImg_preview());
loadMerchantLogo(couponItem.getMerchantDetails().getImgPreview());
}
......@@ -177,41 +155,40 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
try {
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
Date date = inputFormat.parse(endDate);
SimpleDateFormat outputFormat = new SimpleDateFormat("dd-MM", Locale.getDefault());
return "έως " + outputFormat.format(date);
SimpleDateFormat outputFormat = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);
return outputFormat.format(date);
} catch (ParseException e) {
try {
SimpleDateFormat inputFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault());
Date date = inputFormat2.parse(endDate);
SimpleDateFormat outputFormat = new SimpleDateFormat("dd-MM", Locale.getDefault());
return "έως " + outputFormat.format(date);
SimpleDateFormat outputFormat = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);
return outputFormat.format(date);
} catch (ParseException e2) {
try {
SimpleDateFormat inputFormat3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.getDefault());
Date date = inputFormat3.parse(endDate);
SimpleDateFormat outputFormat = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);
return outputFormat.format(date);
} catch (ParseException e3) {
return endDate;
}
}
}
private void loadCouponImage(String imageUrl) {
if (imageUrl != null && !imageUrl.isEmpty()) {
int radiusInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 9,
context.getResources().getDisplayMetrics());
Glide.with(context)
.load(imageUrl)
.diskCacheStrategy(DiskCacheStrategy.DATA)
.transform(new CenterCrop(), new TopRoundedCornersTransformation(radiusInPixels))
.into(ivOfferImage);
}
}
private void loadMerchantLogo(String logoUrl) {
if (logoUrl != null && !logoUrl.isEmpty()) {
ivLogo.setVisibility(View.VISIBLE);
int radiusInPixels = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 10,
context.getResources().getDisplayMetrics());
Glide.with(context)
.load(logoUrl)
.diskCacheStrategy(DiskCacheStrategy.DATA)
.transform(new CenterCrop(), new TopRoundedCornersTransformation(radiusInPixels, true))
.into(ivLogo);
ivLogo.setVisibility(View.VISIBLE);
} else {
ivLogo.setVisibility(View.GONE);
}
......
......@@ -21,7 +21,6 @@ import java.util.List;
import java.util.Locale;
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;
import ly.warp.sdk.utils.WarpUtils;
......@@ -86,7 +85,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol
*/
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;
......@@ -96,7 +94,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol
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);
......@@ -113,13 +110,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol
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) {
......@@ -129,15 +119,6 @@ public class OfferAdapter extends RecyclerView.Adapter<OfferAdapter.OfferViewHol
tvPrice.setText(offerItem.getValue());
tvValidity.setText(formatValidityDate(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());
......
This diff could not be displayed because it is too large.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="6dp" />
<solid android:color="@color/custom_grey5" />
<stroke
android:width="1dp"
android:color="@color/custom_grey7" />
</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="28dp" />
<solid
android:color="@color/custom_black7" />
</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="28dp" />
<solid
android:color="@color/custom_grey8" />
</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="28dp" />
<solid
android:color="@color/custom_grey5" />
</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="13dp" />
<solid android:color="@color/custom_skyblue4" />
<stroke
android:width="2dp"
android:color="@color/custom_skyblue6" />
</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="1000dp" />
<solid android:color="@android:color/transparent" />
<stroke
android:width="2dp"
android:color="@color/white" />
</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/white">
<androidx.core.widget.NestedScrollView
android:id="@+id/profile_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:id="@+id/profile_content_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/header_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="horizontal"
android:padding="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_back"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="24dp"
android:src="@drawable/ic_back" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/header_layout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_header_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/demo_my_coupons_header"
android:textColor="@color/custom_black6"
android:textSize="28sp" />
</LinearLayout>
<ImageView
android:id="@+id/profile_icon"
android:layout_width="46dp"
android:layout_height="46dp"
android:background="@drawable/shape_rectangle_rounded_grey"
android:padding="14dp"
android:src="@drawable/demo_search" />
</LinearLayout>
<RelativeLayout
android:id="@+id/my_coupons_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginBottom="48dp"
android:background="@color/white"
android:paddingBottom="16dp">
<LinearLayout
android:id="@+id/ll_coupon_filters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<LinearLayout
android:id="@+id/ll_filter_active"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:background="@drawable/shape_rectangle_rounded_black2"
android:paddingHorizontal="20dp"
android:paddingVertical="12dp">
<TextView
android:id="@+id/btn_filter_active"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/demo_active"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_filter_redeemed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:background="@drawable/shape_rectangle_rounded_grey4"
android:paddingHorizontal="20dp"
android:paddingVertical="12dp">
<TextView
android:id="@+id/btn_filter_redeemed"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/demo_expired"
android:textColor="@color/custom_black6"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_coupons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_coupon_filters"
android:layout_marginTop="32dp"
android:clipToPadding="false"
android:nestedScrollingEnabled="false"
android:paddingHorizontal="16dp" />
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
......@@ -66,7 +66,8 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginTop="16dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/banner_viewpager"
......@@ -151,4 +152,50 @@
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:id="@+id/ll_my_coupons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="8dp"
android:layout_marginBottom="64dp"
android:background="@drawable/shape_rectangle_rounded_grey3"
android:gravity="center"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:paddingVertical="18dp"
android:translationZ="100dp">
<TextView
android:id="@+id/tv_my_coupons_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/demo_my_coupons_title"
android:textColor="@color/white"
android:textSize="15sp" />
<View
android:layout_width="12dp"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="21dp"
android:layout_height="21dp"
android:orientation="horizontal"
android:gravity="center"
android:background="@drawable/shape_rounded_transparent_white_border">
<TextView
android:id="@+id/tv_my_coupons_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="0"
android:textColor="@color/white"
android:textSize="13sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
......
......@@ -76,17 +76,19 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_share_coupon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_merchant_value"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/custom_grey4"
android:textSize="16sp"
tools:text="@string/demo_more" />
......@@ -98,6 +100,7 @@
android:layout_marginTop="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/custom_black2"
android:textSize="23sp"
tools:text="@string/demo_more" />
......
......@@ -82,6 +82,7 @@
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/custom_grey4"
android:textSize="16sp"
tools:text="@string/demo_more" />
......@@ -93,6 +94,7 @@
android:layout_marginTop="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/custom_black2"
android:textSize="23sp"
tools:text="@string/demo_more" />
......
<?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">
android:layout_height="150dp"
android:background="@drawable/shape_rounded_skyblue_skyblue_border">
<ImageView
android:id="@+id/iv_offer_image"
<LinearLayout
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€" />
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/iv_offer_image"
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_weight="1"
android:orientation="vertical"
android:padding="12dp">
android:paddingHorizontal="16dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_vertical_70"
<TextView
android:id="@+id/tv_merchant"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.7" />
android:includeFontPadding="false"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/custom_grey3"
android:textSize="14sp"
tools:text="2 πίτσες &amp; Coca-COLA 1,5lt" />
<!-- Title -->
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/custom_black2"
android:ellipsize="end"
android:textColor="@color/custom_black6"
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_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:includeFontPadding="false"
android:maxLines="2"
android:textColor="@color/custom_black3"
android:textSize="15sp"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_title"
android:textColor="@color/custom_grey3"
android:textSize="13sp"
tools:text="2 πίτσες &amp; Coca-COLA 1,5lt" />
</LinearLayout>
<ImageView
android:id="@+id/iv_logo"
android:layout_width="68dp"
android:layout_height="68dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:scaleType="centerInside"
tools:src="@drawable/demo_avis" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingEnd="10dp"
android:layout_marginBottom="8dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:id="@+id/ll_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/demo_shape_grey_border_grey"
android:gravity="center"
android:orientation="horizontal"
android:paddingHorizontal="8dp"
android:paddingVertical="6dp">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/demo_time" />
<View
android:layout_width="4dp"
android:layout_height="match_parent" />
<!-- Validity Date -->
<TextView
android:id="@+id/tv_validity"
android:id="@+id/tv_coupon_end_date"
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/custom_black3"
android:includeFontPadding="false"
android:textColor="@color/custom_black7"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="έως 30-09" />
tools:text="@string/demo_purchases" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/header_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<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>
android:id="@+id/iv_back"
android:layout_width="38dp"
android:layout_height="38dp"
android:background="@drawable/demo_shape_white"
android:padding="13dp"
android:rotation="180"
android:src="@drawable/ic_back" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
......
......@@ -17,6 +17,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:includeFontPadding="false"
android:textColor="@color/custom_black2"
android:textSize="15sp"
tools:text="Top Offers (10)" />
......@@ -34,6 +35,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/demo_all"
android:includeFontPadding="false"
android:textColor="@color/custom_black3"
android:textSize="15sp" />
......
......@@ -35,4 +35,6 @@
<color name="custom_grey5">#F1F2F4</color>
<color name="custom_grey6">#CBCBCB</color>
<color name="custom_grey7">#D2D6D9</color>
<color name="custom_grey8">#8F8F8F</color>
<color name="custom_skyblue6">#A5DAF8</color>
</resources>
......
......@@ -25,10 +25,13 @@
<string name="demo_success_redeem">Saved to My Coupons</string>
<string name="demo_profile">Το προφίλ μου</string>
<string name="demo_my_coupons">Τα κουπόνια μου</string>
<string name="demo_active">Ενεργά</string>
<string name="demo_active">Valid</string>
<string name="demo_redeemed">Εξαργυρωμένα</string>
<string name="demo_expired">Expired</string>
<string name="demo_favorites">Αγαπημένα</string>
<string name="demo_rewards_title">Rewards</string>
<string name="demo_green_title">green</string>
<string name="demo_family_title">family</string>
<string name="demo_my_coupons_title">My coupons</string>
<string name="demo_my_coupons_header">My Coupons</string>
</resources>
......