Panagiotis Triantafyllou

vouchers part2

......@@ -19,6 +19,7 @@ android {
minSdkVersion 23
targetSdkVersion 31
consumerProguardFiles 'proguard-rules.pro'
vectorDrawables.useSupportLibrary = true
}
splits {
abi {
......
......@@ -13,6 +13,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
......@@ -53,6 +54,7 @@ import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.models.VouchersActivityEventModel;
import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
......@@ -75,11 +77,12 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
private ImageView mIvBack, mIvDealsLogo, mIvProfilePhoto, mIvExpArrow;
private TextView mTvUsername, mTvDealsValue, mTvDealsValueAll,
mTvUserBadge, mTvGiftsValue, mTvGiftsValueAll, mTvActiveCode, mTvActiveDate,
mTvActiveTitle, mTvActiveCouponsHeader, mTvMarketValue, mTvMarketAll, mTvFavValue, mTvFavValueAll;
mTvActiveTitle, mTvActiveCouponsHeader, mTvMarketValue, mTvMarketAll, mTvFavValue,
mTvFavValueAll, mTvDealsCountBadge, mTvUnifiedCountBadge, mTvGiftsCountBadge;
private ConstraintLayout mClDealsBanner, mClDealsView,
mClGiftsBanner, mClToolbar, mClMarket;
private LinearLayout mLlQuestionnaire, mLlUserBadge, mLlEmptyWallet, mLlDeals, mLlGifts,
mLlMarketView, mLlHistory;
mLlMarketView, mLlHistory, mLlBannerInfo, mLlVouchers;
private FlowLayout mLlActiveCodesView;
private float couponDfyValue = 0.0f, mFavValue = 0.0f;
private RecyclerView mRecyclerCoupons, mRvMarketCoupons;
......@@ -94,10 +97,12 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
private MarketCouponAdapter mAdapterMarketCoupons;
private ExpandableLayout mElGifts;
private boolean mIsStayCollapsed = true;
private CardView mClExp;
private CardView mClExp, mCvVouchers;
private boolean mDfyPressed = false, mDealsBannerPressed = false, mQuestionnairePressed = false,
mHistoryPressed = false, mHistoryMarketPressed = false, mUnifiedPressed = false,
mCouponPressed = false, mHistoryBadgePressed = false;
mCouponPressed = false, mHistoryBadgePressed = false, mUnifiedCountPressed = false,
mGiftsCountPressed = false;
private RelativeLayout mRlDeals, mRlUnified, mRlGifts;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -147,28 +152,26 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mTvFavValue = findViewById(R.id.tv_exp_value);
mTvFavValueAll = findViewById(R.id.tv_exp_value_all);
mLlHistory = findViewById(R.id.ll_loyalty_history);
if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() {
public int compare(ActiveDFYCouponModel o1, ActiveDFYCouponModel o2) {
return o1.getDate().compareTo(o2.getDate());
}
});
// for (ActiveDFYCouponModel dfycoupon : WarplyManagerHelper.getActiveDFYCoupons()) {
// try {
// couponDfyValue += Float.parseFloat(dfycoupon.getValue());
// } catch (NumberFormatException e) {
//
// }
// }
}
mTvDealsCountBadge = findViewById(R.id.tv_deals_count);
mTvUnifiedCountBadge = findViewById(R.id.tv_sm_count);
mTvGiftsCountBadge = findViewById(R.id.tv_gifts_count);
mLlBannerInfo = findViewById(R.id.ll_banner_info_new);
mRlDeals = findViewById(R.id.rv_deals_count);
mRlUnified = findViewById(R.id.rv_sm_count);
mRlGifts = findViewById(R.id.rv_gifts_count);
mRecyclerCoupons = findViewById(R.id.rv_active_coupons);
mRecyclerCoupons.setNestedScrollingEnabled(false);
mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
initViews();
mCvVouchers = findViewById(R.id.cv_vouchers);
mLlVouchers = findViewById(R.id.ll_vouchers);
/** Deals Badge */
// if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
// Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() {
// public int compare(ActiveDFYCouponModel o1, ActiveDFYCouponModel o2) {
// return o1.getDate().compareTo(o2.getDate());
// }
// });
// }
/** Deals Badge */
}
@Override
......@@ -211,6 +214,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mUnifiedPressed = false;
mCouponPressed = false;
mHistoryBadgePressed = false;
mGiftsCountPressed = false;
mUnifiedCountPressed = false;
initViews();
}
@Override
......@@ -248,14 +254,13 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
return;
}
if (view.getId() == R.id.cl_deals_win_inner_cos) {
if (view.getId() == R.id.cl_deals_win_inner_cos || view.getId() == R.id.rv_deals_count) {
if (!mDealsBannerPressed) {
mDealsBannerPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("DealsBanner"));
WarpUtils.log("DFY coupon banner pressed!");
WarplyDealsAnalysisEventModel warplyDealsAnalysisEventModel = new WarplyDealsAnalysisEventModel();
warplyDealsAnalysisEventModel.setPressed(true);
EventBus.getDefault().post(new WarplyEventBusManager(warplyDealsAnalysisEventModel));
......@@ -267,6 +272,40 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
return;
}
if (view.getId() == R.id.rv_sm_count) {
if (!mUnifiedCountPressed) {
mUnifiedCountPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("SMDealsBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_sm_deals_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(LoyaltyWallet.this, ActiveUnifiedCouponsActivity.class);
startActivity(intent);
}
return;
}
if (view.getId() == R.id.rv_gifts_count) {
if (!mGiftsCountPressed) {
mGiftsCountPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("GFYBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_gifts_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(LoyaltyWallet.this, ActiveCouponsActivity.class);
startActivity(intent);
}
return;
}
if (view.getId() == R.id.cl_deals_win_inner) {
if (!mHistoryPressed) {
mHistoryPressed = true;
......@@ -312,8 +351,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
// }
return;
}
if(view.getId() == R.id.ll_loyalty_history) {
if(!mHistoryBadgePressed) {
if (view.getId() == R.id.ll_loyalty_history) {
if (!mHistoryBadgePressed) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("LoyaltyHistoryBadge"));
......@@ -325,6 +364,20 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
return;
}
if (view.getId() == R.id.cv_vouchers) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("VouchersBadge"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_vouchers_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
VouchersActivityEventModel vouchersActivity = new VouchersActivityEventModel();
EventBus.getDefault().post(new WarplyEventBusManager(vouchersActivity));
return;
}
if (view.getId() == R.id.cl_mygifts) {
if (!mDfyPressed) {
mDfyPressed = true;
......@@ -371,161 +424,183 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
@Subscribe()
public void onMessageEvent(WarplyEventBusManager event) {
if (event.getVouchersFetched() != null) {
WarpUtils.log(String.valueOf(event.getVouchersFetched().isFetched()));
WarpUtils.log(WarplyManagerHelper.getShowVouchersBanner());
if (WarplyManagerHelper.getShowVouchersBanner().equals("true")) {
//TODO: hide spinner and enable button
//TODO: hide spinner
runOnUiThread(() -> {
mLlVouchers.setVisibility(View.VISIBLE);
});
} else {
//.equals("false)
//TODO: hide it completely or leave it disabled??
//TODO: hide spinner
}
return;
}
if (event.getUnifiedCouponsAdded() != null) {
mUnifiedPressed = false;
if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) {
ArrayList<UnifiedCoupon> tempCouponList = new ArrayList<UnifiedCoupon>();
tempCouponList.addAll(WarplyManagerHelper.getMarketCouponsList());
ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>();
for (UnifiedCoupon unicpn : tempCouponList) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date newDate = new Date();
try {
newDate = simpleDateFormat.parse(unicpn.getCreated());
} catch (ParseException e) {
e.printStackTrace();
}
unicpn.setExpirationDate(newDate);
unilist.add(unicpn);
}
Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
/** Unified Coupons List */
// if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) {
// ArrayList<UnifiedCoupon> tempCouponList = new ArrayList<UnifiedCoupon>();
// tempCouponList.addAll(WarplyManagerHelper.getMarketCouponsList());
//
// ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>();
// for (UnifiedCoupon unicpn : tempCouponList) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(unicpn.getCreated());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// unicpn.setExpirationDate(newDate);
// unilist.add(unicpn);
// }
//
// Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
//
// runOnUiThread(() -> {
// mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist);
// mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
// mAdapterMarketCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// if (!mUnifiedPressed) {
// mUnifiedPressed = true;
// WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
// Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// intent.putExtra("isFromWallet", true);
// startActivity(intent);
// }
//// startActivityForResult(intent, 1002);
// })
// .doOnError(error -> {
// })
// .subscribe();
// mAdapterMarketCoupons.notifyDataSetChanged();
// mLlMarketView.setVisibility(View.VISIBLE);
//
// // Third Expandable Banner
// if (tempCouponList != null && tempCouponList.size() > 0) {
// countValue = 0.0f;
//
// if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
// if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
// for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
// for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
// if (cou.getCouponsetUuid().equals(couset.getUuid())) {
// countValue += Float.valueOf(cou.getDiscount());
// cou.setDescription(couset.getShortDescription());
// cou.setImage(couset.getImgPreview());
// cou.setName(couset.getName());
// cou.setMerchantUuid(couset.getMerchantUuid());
// cou.setInnerText(couset.getInnerText());
// cou.setDiscount_type(couset.getDiscount_type());
// cou.setFinal_price(couset.getFinal_price());
// break;
// }
// }
// }
// }
// }
//
// mFavValue += countValue;
// String badgeValue = String.format("%.02f", countValue);
// mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// if (String.valueOf(countValue).length() >= 3) {
// mTvMarketValue.setTextSize(12);
// } else {
// mTvMarketValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
// sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
// } else {
// String badgeValue = String.format("%.02f", 0.0f);
// mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
// sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
// }
// });
// } else {
// runOnUiThread(() -> {
// mLlMarketView.setVisibility(View.GONE);
// });
// }
/** Unified Coupons List */
runOnUiThread(() -> {
mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist);
mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
mAdapterMarketCoupons.getPositionClicks()
.doOnNext(coupon -> {
if (!mUnifiedPressed) {
mUnifiedPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivity(intent);
}
// startActivityForResult(intent, 1002);
})
.doOnError(error -> {
})
.subscribe();
mAdapterMarketCoupons.notifyDataSetChanged();
mLlMarketView.setVisibility(View.VISIBLE);
// Third Expandable Banner
if (tempCouponList != null && tempCouponList.size() > 0) {
countValue = 0.0f;
if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetUuid().equals(couset.getUuid())) {
countValue += Float.valueOf(cou.getDiscount());
cou.setDescription(couset.getShortDescription());
cou.setImage(couset.getImgPreview());
cou.setName(couset.getName());
cou.setMerchantUuid(couset.getMerchantUuid());
cou.setInnerText(couset.getInnerText());
cou.setDiscount_type(couset.getDiscount_type());
cou.setFinal_price(couset.getFinal_price());
break;
}
}
}
}
}
mFavValue += countValue;
String badgeValue = String.format("%.02f", countValue);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
if (String.valueOf(countValue).length() >= 3) {
mTvMarketValue.setTextSize(12);
} else {
mTvMarketValue.setTextSize(14);
}
SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
} else {
String badgeValue = String.format("%.02f", 0.0f);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
}
});
} else {
runOnUiThread(() -> {
mLlMarketView.setVisibility(View.GONE);
});
}
runOnUiThread(() -> {
if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0)
mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size()));
else
mTvUnifiedCountBadge.setText("0");
});
return;
}
if (event.getCouponsAdded() != null) {
mCouponPressed = false;
CouponList tempCouponList = new CouponList();
CouponList cpnlist = new CouponList();
tempCouponList.clear();
tempCouponList.addAll(WarplyManagerHelper.getCouponList());
for (Coupon cpn : tempCouponList) {
if (cpn.getStatus() == 1) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date newDate = new Date();
try {
newDate = simpleDateFormat.parse(cpn.getExpiration());
} catch (ParseException e) {
e.printStackTrace();
}
cpn.setExpirationDate(newDate);
cpnlist.add(cpn);
}
}
Collections.sort(cpnlist, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate()));
/** Coupons List */
// CouponList tempCouponList = new CouponList();
// CouponList cpnlist = new CouponList();
// tempCouponList.clear();
// tempCouponList.addAll(WarplyManagerHelper.getCouponList());
//
// for (Coupon cpn : tempCouponList) {
// if (cpn.getStatus() == 1) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(cpn.getExpiration());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// cpn.setExpirationDate(newDate);
// cpnlist.add(cpn);
// }
// }
//
// Collections.sort(cpnlist, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate()));
//
// runOnUiThread(() -> {
// if (cpnlist != null && cpnlist.size() > 0) {
// mAdapterCoupons = new ActiveCouponAdapter(this, cpnlist);
// mRecyclerCoupons.setAdapter(mAdapterCoupons);
// mAdapterCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// if (!mCouponPressed) {
// mCouponPressed = true;
// WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
// Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// intent.putExtra("isFromWallet", true);
// startActivityForResult(intent, 1002);
// }
// })
// .doOnError(error -> {
// })
// .subscribe();
// mAdapterCoupons.notifyDataSetChanged();
//// mLlGifts.setVisibility(View.VISIBLE);
// } else {
// mLlGifts.setVisibility(View.GONE);
// }
// });
/** Coupons List */
runOnUiThread(() -> {
if (cpnlist != null && cpnlist.size() > 0) {
mAdapterCoupons = new ActiveCouponAdapter(this, cpnlist);
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
if (!mCouponPressed) {
mCouponPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivityForResult(intent, 1002);
}
})
.doOnError(error -> {
})
.subscribe();
mAdapterCoupons.notifyDataSetChanged();
// mLlGifts.setVisibility(View.VISIBLE);
} else {
mLlGifts.setVisibility(View.GONE);
}
if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0)
mTvGiftsCountBadge.setText(String.valueOf(WarplyManagerHelper.getCouponList().size()));
else
mTvGiftsCountBadge.setText("0");
});
}
/** Empty View */
runOnUiThread(this::checkForEmpty);
/** Empty View */
}
@Override
......@@ -541,253 +616,281 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
if (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner())) {
//TODO: show spinner
} else if (WarplyManagerHelper.getShowVouchersBanner().equals("true")) {
//TODO: hide spinner and enable button
//TODO: hide spinner
mLlVouchers.setVisibility(View.VISIBLE);
} else {
//.equals("false)
//TODO: hide it completely or leave it disabled??
//TODO: hide spinner
}
if (WarpUtils.getUserNonTelco(this)) {
nonTelcoDialog();
}
if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) {
ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>();
for (UnifiedCoupon unicpn : WarplyManagerHelper.getMarketCouponsList()) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date newDate = new Date();
try {
newDate = simpleDateFormat.parse(unicpn.getCreated());
} catch (ParseException e) {
e.printStackTrace();
}
unicpn.setExpirationDate(newDate);
unilist.add(unicpn);
}
Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist);
mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
mAdapterMarketCoupons.getPositionClicks()
.doOnNext(coupon -> {
if (!mUnifiedPressed) {
mUnifiedPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivity(intent);
}
// startActivityForResult(intent, 1002);
})
.doOnError(error -> {
})
.subscribe();
mLlMarketView.setVisibility(View.VISIBLE);
} else {
mLlMarketView.setVisibility(View.GONE);
}
if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0) {
CouponList cpnlist = new CouponList();
for (Coupon cpn : WarplyManagerHelper.getCouponList()) {
if (cpn.getStatus() == 1) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date newDate = new Date();
try {
newDate = simpleDateFormat.parse(cpn.getExpiration());
} catch (ParseException e) {
e.printStackTrace();
}
cpn.setExpirationDate(newDate);
cpnlist.add(cpn);
}
}
Collections.sort(cpnlist, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate()));
mAdapterCoupons = new ActiveCouponAdapter(this, cpnlist);
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
if (!mCouponPressed) {
mCouponPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivityForResult(intent, 1002);
}
})
.doOnError(error -> {
})
.subscribe();
mLlGifts.setVisibility(View.VISIBLE);
} else {
mLlGifts.setVisibility(View.GONE);
}
// First Expandable Banner
String badgeValueFirst = String.format("%.02f", WarplyManagerHelper.getDealsCouponsSum());
mTvDealsValue.setText(String.format(getString(R.string.cos_value), badgeValueFirst));
if (String.valueOf(WarplyManagerHelper.getDealsCouponsSum()).length() >= 3) {
mTvDealsValue.setTextSize(12);
} else {
mTvDealsValue.setTextSize(14);
}
SpannableStringBuilder sBuilder = new SpannableStringBuilder();
sBuilder.append(String.format(getString(R.string.cos_deals_win_title_cos), badgeValueFirst));
CalligraphyTypefaceSpan typefaceBoldSpanFirst = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilder.setSpan(typefaceBoldSpanFirst, 15, 16 + badgeValueFirst.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvDealsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE);
mFavValue += WarplyManagerHelper.getDealsCouponsSum();
// Second Expandable Banner
if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
String badgeValue = String.format("%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue));
if (String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()).length() >= 3) {
mTvGiftsValue.setTextSize(12);
} else {
mTvGiftsValue.setTextSize(14);
}
SpannableStringBuilder sBuilderSecond = new SpannableStringBuilder();
sBuilderSecond.append(String.format(getString(R.string.cos_deals_win_title), badgeValue));
CalligraphyTypefaceSpan typefaceBoldSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilderSecond.setSpan(typefaceBoldSpanSecond, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE);
mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue();
}
// Third Expandable Banner
if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) {
countValue = 0.0f;
// for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) {
// if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) {
// for (Coupon inncou : unicou.getCoupons()) {
// if (inncou.getStatus() == 0) {
// countValue += Float.valueOf(inncou.getDiscount());
/** Unified Coupons List */
// if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) {
// ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>();
// for (UnifiedCoupon unicpn : WarplyManagerHelper.getMarketCouponsList()) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(unicpn.getCreated());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// unicpn.setExpirationDate(newDate);
// unilist.add(unicpn);
// }
//
// Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
//
// mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist);
// mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
// mAdapterMarketCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// if (!mUnifiedPressed) {
// mUnifiedPressed = true;
// WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
// Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// intent.putExtra("isFromWallet", true);
// startActivity(intent);
// }
//// startActivityForResult(intent, 1002);
// })
// .doOnError(error -> {
// })
// .subscribe();
// mLlMarketView.setVisibility(View.VISIBLE);
// } else {
// mLlMarketView.setVisibility(View.GONE);
// }
/** Unified Coupons List */
if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0)
mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size()));
else
mTvUnifiedCountBadge.setText("0");
/** Coupon List */
// if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0) {
// CouponList cpnlist = new CouponList();
// for (Coupon cpn : WarplyManagerHelper.getCouponList()) {
// if (cpn.getStatus() == 1) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// Date newDate = new Date();
// try {
// newDate = simpleDateFormat.parse(cpn.getExpiration());
// } catch (ParseException e) {
// e.printStackTrace();
// }
// cpn.setExpirationDate(newDate);
// cpnlist.add(cpn);
// }
// }
if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetUuid().equals(couset.getUuid())) {
countValue += Float.valueOf(cou.getDiscount());
cou.setDescription(couset.getShortDescription());
cou.setImage(couset.getImgPreview());
cou.setName(couset.getName());
cou.setMerchantUuid(couset.getMerchantUuid());
cou.setInnerText(couset.getInnerText());
cou.setDiscount_type(couset.getDiscount_type());
cou.setFinal_price(couset.getFinal_price());
break;
}
}
}
}
}
mFavValue += countValue;
String badgeValue = String.format("%.02f", countValue);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
if (String.valueOf(countValue).length() >= 3) {
mTvMarketValue.setTextSize(12);
} else {
mTvMarketValue.setTextSize(14);
}
SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
} else {
String badgeValue = String.format("%.02f", 0.0f);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
}
// Sum Expandable Banner
String allValue = String.format("%.02f", mFavValue);
mTvFavValue.setText(String.format(getString(R.string.cos_value), allValue));
if (String.valueOf(mFavValue).length() >= 3) {
mTvFavValue.setTextSize(12);
} else {
mTvFavValue.setTextSize(14);
}
SpannableStringBuilder sBuilderExp = new SpannableStringBuilder();
sBuilderExp.append(String.format(getString(R.string.cos_for_you_all), allValue));
CalligraphyTypefaceSpan typefaceBoldExp = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilderExp.setSpan(typefaceBoldExp, 26, 27 + allValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvFavValueAll.setText(sBuilderExp, TextView.BufferType.SPANNABLE);
mClExp.setVisibility(View.VISIBLE);
if (WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() > 0) {
String codes = "";
if (WarplyManagerHelper.getActiveDFYCoupons().size() == 1) {
codes = WarplyManagerHelper.getActiveDFYCoupons().get(0).getCode();
mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals), String.valueOf(1)));
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate();
String date2 = dateFormat.format(new Date());
mTvActiveCode.setText(codes);
try {
Date toDate = dateFormat.parse(date2);
Date fromDate = dateFormat.parse(date1);
long diff = TimeUnit.MILLISECONDS.toDays(fromDate.getTime() - toDate.getTime()) + 1;
mTvActiveDate.setText(String.format(getString(R.string.cos_active_coupon_date), String.valueOf(diff)));
mTvActiveDate.setVisibility(View.VISIBLE);
} catch (ParseException e) {
e.printStackTrace();
}
} else {
// for (ActiveDFYCouponModel coupon : WarplyManagerHelper.getActiveDFYCoupons()) {
// codes = codes + coupon.getCode() + ",";
//
// Collections.sort(cpnlist, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate()));
//
// mRecyclerCoupons.setNestedScrollingEnabled(false);
// mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
// mAdapterCoupons = new ActiveCouponAdapter(this, cpnlist);
// mRecyclerCoupons.setAdapter(mAdapterCoupons);
// mAdapterCoupons.getPositionClicks()
// .doOnNext(coupon -> {
// if (!mCouponPressed) {
// mCouponPressed = true;
// WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
// Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
// intent.putExtra("coupon", (Serializable) coupon);
// intent.putExtra("isFromWallet", true);
// startActivityForResult(intent, 1002);
// }
// })
// .doOnError(error -> {
// })
// .subscribe();
// mLlGifts.setVisibility(View.VISIBLE);
// } else {
// mLlGifts.setVisibility(View.GONE);
// }
/** Coupon List */
if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0)
mTvGiftsCountBadge.setText(String.valueOf(WarplyManagerHelper.getCouponList().size()));
else
mTvGiftsCountBadge.setText("0");
/** First Expandable Banner */
// String badgeValueFirst = String.format("%.02f", WarplyManagerHelper.getDealsCouponsSum());
// mTvDealsValue.setText(String.format(getString(R.string.cos_value), badgeValueFirst));
// if (String.valueOf(WarplyManagerHelper.getDealsCouponsSum()).length() >= 3) {
// mTvDealsValue.setTextSize(12);
// } else {
// mTvDealsValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilder = new SpannableStringBuilder();
// sBuilder.append(String.format(getString(R.string.cos_deals_win_title_cos), badgeValueFirst));
// CalligraphyTypefaceSpan typefaceBoldSpanFirst = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilder.setSpan(typefaceBoldSpanFirst, 15, 16 + badgeValueFirst.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvDealsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE);
// mFavValue += WarplyManagerHelper.getDealsCouponsSum();
/** First Expandable Banner */
/** Second Expandable Banner */
// if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
// String badgeValue = String.format("%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
// mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// if (String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()).length() >= 3) {
// mTvGiftsValue.setTextSize(12);
// } else {
// mTvGiftsValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilderSecond = new SpannableStringBuilder();
// sBuilderSecond.append(String.format(getString(R.string.cos_deals_win_title), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderSecond.setSpan(typefaceBoldSpanSecond, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE);
// mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue();
// }
/** Second Expandable Banner */
/** Third Expandable Banner */
// if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) {
// countValue = 0.0f;
//// for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) {
//// if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) {
//// for (Coupon inncou : unicou.getCoupons()) {
//// if (inncou.getStatus() == 0) {
//// countValue += Float.valueOf(inncou.getDiscount());
//// }
//// }
//// }
//// }
//
// if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
// if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
// for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
// for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
// if (cou.getCouponsetUuid().equals(couset.getUuid())) {
// countValue += Float.valueOf(cou.getDiscount());
// cou.setDescription(couset.getShortDescription());
// cou.setImage(couset.getImgPreview());
// cou.setName(couset.getName());
// cou.setMerchantUuid(couset.getMerchantUuid());
// cou.setInnerText(couset.getInnerText());
// cou.setDiscount_type(couset.getDiscount_type());
// cou.setFinal_price(couset.getFinal_price());
// break;
// }
// }
// }
// }
// codes = codes.substring(0, codes.length() - 1);
mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size())));
mTvActiveCode.setVisibility(View.GONE);
// Collections.reverse(WarplyManagerHelper.getActiveDFYCoupons());
for (int i = 0; i < WarplyManagerHelper.getActiveDFYCoupons().size(); i++) {
LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_selectable, null);
TextView textView = (TextView) v.findViewById(R.id.tv_code_copy);
TextView textViewComma = (TextView) v.findViewById(R.id.tv_code_comma);
CalligraphyTypefaceSpan typefaceBoldSpanDFY = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
SpannableStringBuilder sBuilderDFY = new SpannableStringBuilder(WarplyManagerHelper.getActiveDFYCoupons().get(i).getCode());
SpannableStringBuilder sBuilderComma = new SpannableStringBuilder(getString(R.string.cos_comma));
sBuilderDFY.setSpan(typefaceBoldSpanDFY, 0, sBuilderDFY.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sBuilderComma.setSpan(typefaceBoldSpanDFY, 0, sBuilderComma.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(sBuilderDFY, TextView.BufferType.SPANNABLE);
textView.setTextIsSelectable(true);
textViewComma.setText(sBuilderComma, TextView.BufferType.SPANNABLE);
mLlActiveCodesView.addView(v, 0, new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
}
mScActiveCodes.setVisibility(View.VISIBLE);
mLlActiveCodesView.setVisibility(View.VISIBLE);
}
// mTvActiveCode.setText(codes);
mLlDeals.setVisibility(View.VISIBLE);
} else {
mLlDeals.setVisibility(View.GONE);
}
// }
//
// mFavValue += countValue;
// String badgeValue = String.format("%.02f", countValue);
// mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// if (String.valueOf(countValue).length() >= 3) {
// mTvMarketValue.setTextSize(12);
// } else {
// mTvMarketValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
// sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
// } else {
// String badgeValue = String.format("%.02f", 0.0f);
// mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
// SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
// sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
// CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
// }
/** First Expandable Banner */
/** Sum Expandable Banner */
// String allValue = String.format("%.02f", mFavValue);
// mTvFavValue.setText(String.format(getString(R.string.cos_value), allValue));
// if (String.valueOf(mFavValue).length() >= 3) {
// mTvFavValue.setTextSize(12);
// } else {
// mTvFavValue.setTextSize(14);
// }
// SpannableStringBuilder sBuilderExp = new SpannableStringBuilder();
// sBuilderExp.append(String.format(getString(R.string.cos_for_you_all), allValue));
// CalligraphyTypefaceSpan typefaceBoldExp = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// sBuilderExp.setSpan(typefaceBoldExp, 26, 27 + allValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// mTvFavValueAll.setText(sBuilderExp, TextView.BufferType.SPANNABLE);
// mClExp.setVisibility(View.VISIBLE);
/** Sum Expandable Banner */
/** Deals Badge */
// if (WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() > 0) {
// String codes = "";
// if (WarplyManagerHelper.getActiveDFYCoupons().size() == 1) {
// codes = WarplyManagerHelper.getActiveDFYCoupons().get(0).getCode();
// mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals), String.valueOf(1)));
//
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
// String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate();
// String date2 = dateFormat.format(new Date());
//
// mTvActiveCode.setText(codes);
//
// try {
// Date toDate = dateFormat.parse(date2);
// Date fromDate = dateFormat.parse(date1);
// long diff = TimeUnit.MILLISECONDS.toDays(fromDate.getTime() - toDate.getTime()) + 1;
// mTvActiveDate.setText(String.format(getString(R.string.cos_active_coupon_date), String.valueOf(diff)));
// mTvActiveDate.setVisibility(View.VISIBLE);
// } catch (ParseException e) {
// e.printStackTrace();
// }
// } else {
//// for (ActiveDFYCouponModel coupon : WarplyManagerHelper.getActiveDFYCoupons()) {
//// codes = codes + coupon.getCode() + ",";
//// }
//// codes = codes.substring(0, codes.length() - 1);
//
// mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size())));
// mTvActiveCode.setVisibility(View.GONE);
//
//// Collections.reverse(WarplyManagerHelper.getActiveDFYCoupons());
// for (int i = 0; i < WarplyManagerHelper.getActiveDFYCoupons().size(); i++) {
// LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_selectable, null);
// TextView textView = (TextView) v.findViewById(R.id.tv_code_copy);
// TextView textViewComma = (TextView) v.findViewById(R.id.tv_code_comma);
// CalligraphyTypefaceSpan typefaceBoldSpanDFY = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
// SpannableStringBuilder sBuilderDFY = new SpannableStringBuilder(WarplyManagerHelper.getActiveDFYCoupons().get(i).getCode());
// SpannableStringBuilder sBuilderComma = new SpannableStringBuilder(getString(R.string.cos_comma));
// sBuilderDFY.setSpan(typefaceBoldSpanDFY, 0, sBuilderDFY.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// sBuilderComma.setSpan(typefaceBoldSpanDFY, 0, sBuilderComma.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// textView.setText(sBuilderDFY, TextView.BufferType.SPANNABLE);
// textView.setTextIsSelectable(true);
// textViewComma.setText(sBuilderComma, TextView.BufferType.SPANNABLE);
// mLlActiveCodesView.addView(v, 0, new ViewGroup.LayoutParams(
// ViewGroup.LayoutParams.WRAP_CONTENT,
// ViewGroup.LayoutParams.WRAP_CONTENT));
// }
//
// mScActiveCodes.setVisibility(View.VISIBLE);
// mLlActiveCodesView.setVisibility(View.VISIBLE);
// }
//// mTvActiveCode.setText(codes);
// mLlDeals.setVisibility(View.VISIBLE);
// } else {
// mLlDeals.setVisibility(View.GONE);
// }
/** Deals Badge */
if (WarplyManagerHelper.getActiveDFYCoupons() != null)
mTvDealsCountBadge.setText(String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size()));
else
mTvDealsCountBadge.setText("0");
if (WarplyManagerHelper.getConsumer() != null) {
mTvUsername.setText(String.format(getResources().getString(R.string.cos_profile_loyalty_name),
......@@ -814,17 +917,23 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
}
if (mLlMarketView.getVisibility() == View.GONE
&& WarplyManagerHelper.getDealsCouponsSum() == 0
&& (WarplyManagerHelper.getLoyaltyBadge() != null && WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)
&& countValue == 0) {
mIvExpArrow.setVisibility(View.GONE);
// mLlEmptyWallet.setVisibility(View.VISIBLE);
mIsStayCollapsed = true;
} else {
mIvExpArrow.setVisibility(View.VISIBLE);
mIsStayCollapsed = false;
}
/** Expandable Banner */
// if (mLlMarketView.getVisibility() == View.GONE
// && WarplyManagerHelper.getDealsCouponsSum() == 0
// && (WarplyManagerHelper.getLoyaltyBadge() != null && WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)
// && countValue == 0) {
// mIvExpArrow.setVisibility(View.GONE);
//// mLlEmptyWallet.setVisibility(View.VISIBLE);
// mIsStayCollapsed = true;
// } else {
// mIvExpArrow.setVisibility(View.VISIBLE);
// mIsStayCollapsed = false;
// }
/** Expandable Banner */
/** Empty View */
checkForEmpty();
/** Empty View */
mIvBack.setOnClickListener(this);
mLlQuestionnaire.setOnClickListener(this);
......@@ -836,6 +945,10 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mClExp.setOnClickListener(this);
mClMarket.setOnClickListener(this);
mLlHistory.setOnClickListener(this);
mRlDeals.setOnClickListener(this);
mRlUnified.setOnClickListener(this);
mRlGifts.setOnClickListener(this);
mCvVouchers.setOnClickListener(this);
}
private void nonTelcoDialog() {
......@@ -852,6 +965,26 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
}
private void checkForEmpty() {
if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
&& (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
&& (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)
&& (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()))) {
mLlEmptyWallet.setVisibility(View.VISIBLE);
//TODO: check for spinner and show it
} else {
mLlEmptyWallet.setVisibility(View.GONE);
if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() > 0)
|| (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0)
|| (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0)) {
mLlBannerInfo.setVisibility(View.VISIBLE);
}
if (WarplyManagerHelper.getShowVouchersBanner().equals("true")) {
mLlVouchers.setVisibility(View.VISIBLE);
}
}
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
......
......@@ -16,6 +16,7 @@ import ly.warp.sdk.io.models.LoyaltySDKSessionExpiredEventModel;
import ly.warp.sdk.io.models.QuestionnaireEventModel;
import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel;
import ly.warp.sdk.io.models.UnifiedCouponsEventModel;
import ly.warp.sdk.io.models.VouchersActivityEventModel;
import ly.warp.sdk.io.models.VouchersFetchedEventModel;
import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
......@@ -42,6 +43,7 @@ public class WarplyEventBusManager {
private WarplyCCMSEnabledModel ccmsActivated;
private LoyaltyGiftsForYouOfferClickEvent giftsYou;
private QuestionnaireEventModel questionnaire;
private VouchersActivityEventModel vouchersActivity;
private VouchersFetchedEventModel vouchersFetched;
private CouponEventModel coupon;
private ActiveDFYCouponEventModel activeCoupon;
......@@ -76,6 +78,10 @@ public class WarplyEventBusManager {
this.questionnaire = questionnaire;
}
public WarplyEventBusManager(VouchersActivityEventModel vouchersActivity) {
this.vouchersActivity = vouchersActivity;
}
public WarplyEventBusManager(VouchersFetchedEventModel vouchersFetched) {
this.vouchersFetched = vouchersFetched;
}
......@@ -226,6 +232,10 @@ public class WarplyEventBusManager {
return questionnaire;
}
public VouchersActivityEventModel getVouchersActivity() {
return vouchersActivity;
}
public VouchersFetchedEventModel getVouchersFetched() {
return vouchersFetched;
}
......
<?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="@color/cos_orange" />
</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="16dp"/>
<stroke android:width="1dp" android:color="@color/cos_grey2" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<vector android:height="21.333334dp" android:viewportHeight="12"
android:viewportWidth="18" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#212121" android:fillType="evenOdd" android:pathData="M15.426,0.719L17.4,2.728L9,11.279L0.6,2.728L2.574,0.719L9,7.246L15.426,0.719Z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="52dp"
android:height="30dp"
android:viewportWidth="52"
android:viewportHeight="30">
<path
android:pathData="M16.62,5.068C15.091,5.168 13.825,3.845 13.99,2.27C14.113,1.097 15.034,0.151 16.192,0.025C17.737,-0.142 19.036,1.148 18.937,2.706C18.855,3.97 17.853,4.992 16.62,5.068ZM16.595,1.164C15.74,1.081 15.017,1.809 15.108,2.68C15.173,3.325 15.683,3.853 16.316,3.912C17.17,3.995 17.894,3.267 17.803,2.396C17.746,1.759 17.228,1.231 16.595,1.164Z"
android:fillColor="#0EA600"/>
<path
android:pathData="M31.816,5.068C30.287,5.168 29.022,3.845 29.186,2.27C29.309,1.097 30.23,0.151 31.389,0.025C32.934,-0.142 34.232,1.148 34.134,2.706C34.052,3.97 33.049,4.992 31.816,5.068ZM31.791,1.164C30.937,1.081 30.213,1.809 30.304,2.68C30.37,3.325 30.879,3.853 31.512,3.912C32.367,3.995 33.09,3.267 33,2.396C32.942,1.759 32.424,1.231 31.791,1.164Z"
android:fillColor="#0EA600"/>
<path
android:pathData="M35.597,5.034V1.198H34.216V0.05H38.112V1.198H36.723V5.034H35.597Z"
android:fillColor="#0EA600"/>
<path
android:pathData="M27.871,5.034L27.427,2.203L26.31,4.515H25.858L24.756,2.228L24.312,5.034H23.187L23.967,0.05H25.028L26.088,2.379L27.123,0.05H28.216L28.997,5.034H27.871Z"
android:fillColor="#0EA600"/>
<path
android:pathData="M11.787,5.076C10.373,5.076 9.239,3.87 9.305,2.421C9.363,1.206 10.275,0.193 11.45,0.034C12.321,-0.084 13.168,0.268 13.719,0.955L13.801,1.056L12.995,1.876L12.897,1.742C12.543,1.24 11.894,1.022 11.286,1.257C10.858,1.424 10.538,1.818 10.456,2.27C10.275,3.233 11.08,4.063 12.017,3.903C12.379,3.845 12.699,3.619 12.913,3.317L12.995,3.208L13.801,4.029L13.719,4.13C13.242,4.733 12.543,5.076 11.787,5.076Z"
android:fillColor="#0EA600"/>
<path
android:pathData="M40.684,5.076C39.279,5.076 38.136,3.87 38.202,2.421C38.259,1.206 39.172,0.193 40.347,0.034C41.218,-0.084 42.065,0.268 42.615,0.955L42.698,1.056L41.892,1.876L41.794,1.742C41.539,1.382 41.128,1.164 40.684,1.164C40.142,1.164 39.648,1.499 39.435,2.002H41.07V3.066H39.418C39.64,3.644 40.232,4.012 40.865,3.92C41.243,3.87 41.58,3.644 41.802,3.326L41.876,3.217L42.681,4.037L42.599,4.138C42.139,4.733 41.44,5.076 40.684,5.076Z"
android:fillColor="#0EA600"/>
<path
android:pathData="M21.107,5.076C20.063,5.076 19.373,4.314 19.34,4.28L19.25,4.18L19.981,3.434L20.08,3.51C20.162,3.577 20.244,3.635 20.335,3.686C20.606,3.862 20.869,3.954 21.107,3.954C21.502,3.954 21.682,3.736 21.682,3.535C21.682,3.309 21.518,3.15 21.222,3.074L20.713,2.94C19.899,2.739 19.406,2.195 19.406,1.474C19.406,0.578 20.072,0 21.099,0C22.069,0 22.775,0.745 22.8,0.779L22.899,0.88L22.159,1.633L22.06,1.55C21.962,1.457 21.855,1.382 21.756,1.323C21.526,1.181 21.313,1.114 21.107,1.114C20.754,1.114 20.556,1.248 20.556,1.491C20.556,1.608 20.589,1.767 20.91,1.851L21.403,1.977C22.365,2.22 22.825,2.731 22.825,3.535C22.825,4.423 22.102,5.076 21.107,5.076Z"
android:fillColor="#0EA600"/>
<path
android:pathData="M6.578,8.234H10.09C11.009,8.234 11.827,8.433 12.542,8.832C13.265,9.231 13.827,9.787 14.227,10.498C14.636,11.21 14.84,12.017 14.84,12.919C14.84,13.821 14.636,14.628 14.227,15.34C13.827,16.051 13.265,16.607 12.542,17.006C11.827,17.405 11.009,17.604 10.09,17.604H6.578V8.234ZM9.962,15.86C10.533,15.86 11.035,15.739 11.469,15.496C11.912,15.244 12.252,14.897 12.491,14.455C12.738,14.012 12.861,13.5 12.861,12.919C12.861,12.338 12.738,11.826 12.491,11.383C12.252,10.941 11.912,10.598 11.469,10.355C11.035,10.104 10.533,9.978 9.962,9.978H8.57V15.86H9.962Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M17.427,17.683C16.891,17.683 16.491,17.574 16.227,17.357C15.972,17.132 15.844,16.776 15.844,16.29V9.548C15.844,8.62 16.333,8.156 17.313,8.156C19.211,8.156 20.939,8.182 22.497,8.234V9.913H17.81V12.177H21.756V13.921H17.81V15.925H22.625V17.604C22.182,17.622 21.42,17.639 20.339,17.656C19.266,17.674 18.296,17.683 17.427,17.683Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M26.308,8.234H28.683L32.105,17.604H30.049L29.232,15.262H25.759L24.941,17.604H22.885L26.308,8.234ZM28.67,13.622L27.496,10.225L26.333,13.622H28.67Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M34.11,17.683C33.685,17.683 33.331,17.578 33.05,17.37C32.778,17.162 32.642,16.802 32.642,16.29V8.234H34.634V15.913H38.491V17.604C38.159,17.622 37.571,17.639 36.728,17.656C35.885,17.674 35.013,17.683 34.11,17.683Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M42.37,17.683C41.621,17.683 40.969,17.544 40.416,17.266C39.863,16.988 39.433,16.598 39.126,16.095C38.828,15.583 38.679,14.993 38.679,14.325H40.633C40.633,14.828 40.799,15.227 41.131,15.522C41.463,15.817 41.919,15.965 42.498,15.965C42.915,15.965 43.242,15.878 43.481,15.704C43.719,15.531 43.838,15.296 43.838,15.001C43.838,14.706 43.698,14.468 43.417,14.286C43.136,14.095 42.655,13.925 41.974,13.778C41.233,13.613 40.646,13.418 40.212,13.192C39.778,12.958 39.463,12.672 39.267,12.333C39.071,11.986 38.973,11.561 38.973,11.058C38.973,10.476 39.105,9.969 39.369,9.535C39.641,9.093 40.024,8.754 40.518,8.52C41.012,8.277 41.587,8.156 42.242,8.156C42.915,8.156 43.506,8.286 44.017,8.546C44.536,8.806 44.937,9.171 45.217,9.639C45.507,10.099 45.652,10.633 45.652,11.24H43.711C43.711,10.841 43.57,10.516 43.289,10.264C43.017,10.004 42.659,9.874 42.217,9.874C41.817,9.874 41.489,9.973 41.233,10.173C40.978,10.364 40.85,10.615 40.85,10.928C40.85,11.205 40.986,11.435 41.259,11.618C41.54,11.791 42.025,11.952 42.715,12.099C43.481,12.264 44.085,12.464 44.528,12.698C44.971,12.923 45.29,13.205 45.486,13.544C45.681,13.873 45.779,14.29 45.779,14.793C45.779,15.366 45.639,15.873 45.358,16.316C45.077,16.75 44.677,17.088 44.158,17.331C43.647,17.565 43.051,17.683 42.37,17.683Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M0,21.866C0,20.937 0.49,20.473 1.469,20.473C3.273,20.473 4.955,20.499 6.513,20.551V22.23H1.992V24.495H5.67V26.239H1.992V29.922H0V21.866Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M11.451,30C10.54,30 9.719,29.796 8.987,29.388C8.263,28.972 7.693,28.403 7.275,27.683C6.867,26.955 6.663,26.139 6.663,25.236C6.663,24.334 6.867,23.523 7.275,22.803C7.693,22.074 8.263,21.506 8.987,21.098C9.719,20.681 10.54,20.473 11.451,20.473C12.362,20.473 13.179,20.681 13.903,21.098C14.635,21.506 15.206,22.074 15.614,22.803C16.031,23.523 16.24,24.334 16.24,25.236C16.24,26.139 16.031,26.955 15.614,27.683C15.206,28.403 14.635,28.972 13.903,29.388C13.179,29.796 12.362,30 11.451,30ZM8.642,25.236C8.642,25.818 8.761,26.334 8.999,26.785C9.238,27.236 9.57,27.592 9.995,27.853C10.421,28.104 10.906,28.23 11.451,28.23C11.996,28.23 12.481,28.104 12.907,27.853C13.333,27.592 13.665,27.236 13.903,26.785C14.141,26.334 14.261,25.818 14.261,25.236C14.261,24.655 14.141,24.139 13.903,23.688C13.665,23.237 13.333,22.885 12.907,22.633C12.481,22.373 11.996,22.243 11.451,22.243C10.906,22.243 10.421,22.373 9.995,22.633C9.57,22.885 9.238,23.237 8.999,23.688C8.761,24.139 8.642,24.655 8.642,25.236Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M17.247,20.551H20.759C21.78,20.551 22.589,20.82 23.185,21.358C23.789,21.887 24.091,22.616 24.091,23.545C24.091,24.048 23.998,24.49 23.811,24.872C23.623,25.254 23.338,25.545 22.955,25.744C23.406,25.987 23.717,26.308 23.887,26.707C24.058,27.098 24.143,27.584 24.143,28.165C24.143,28.764 24.083,29.349 23.964,29.922H22.15V26.72H19.213V29.922H17.247V20.551ZM20.708,25.002C21.176,25.002 21.533,24.885 21.78,24.651C22.036,24.417 22.163,24.078 22.163,23.636C22.163,23.193 22.036,22.855 21.78,22.621C21.533,22.386 21.176,22.269 20.708,22.269H19.213V25.002H20.708Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M29.623,26.226L26.545,20.551H28.665L30.606,24.286L32.585,20.551H34.693L31.615,26.226V29.922H29.623V26.226Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M38.862,30C37.951,30 37.129,29.796 36.397,29.388C35.673,28.972 35.103,28.403 34.686,27.683C34.277,26.955 34.073,26.139 34.073,25.236C34.073,24.334 34.277,23.523 34.686,22.803C35.103,22.074 35.673,21.506 36.397,21.098C37.129,20.681 37.951,20.473 38.862,20.473C39.773,20.473 40.59,20.681 41.313,21.098C42.046,21.506 42.616,22.074 43.025,22.803C43.442,23.523 43.65,24.334 43.65,25.236C43.65,26.139 43.442,26.955 43.025,27.683C42.616,28.403 42.046,28.972 41.313,29.388C40.59,29.796 39.773,30 38.862,30ZM36.052,25.236C36.052,25.818 36.172,26.334 36.41,26.785C36.648,27.236 36.98,27.592 37.406,27.853C37.832,28.104 38.317,28.23 38.862,28.23C39.407,28.23 39.892,28.104 40.317,27.853C40.743,27.592 41.075,27.236 41.313,26.785C41.552,26.334 41.671,25.818 41.671,25.236C41.671,24.655 41.552,24.139 41.313,23.688C41.075,23.237 40.743,22.885 40.317,22.633C39.892,22.373 39.407,22.243 38.862,22.243C38.317,22.243 37.832,22.373 37.406,22.633C36.98,22.885 36.648,23.237 36.41,23.688C36.172,24.139 36.052,24.655 36.052,25.236Z"
android:fillColor="#00A5E3"/>
<path
android:pathData="M48.271,30C47.096,30 46.181,29.675 45.526,29.024C44.879,28.373 44.555,27.449 44.555,26.252V20.551H46.547V26.069C46.547,27.51 47.122,28.23 48.271,28.23C48.842,28.23 49.271,28.052 49.561,27.696C49.859,27.332 50.008,26.79 50.008,26.069V20.551H52V26.252C52,27.449 51.672,28.373 51.017,29.024C50.361,29.675 49.446,30 48.271,30Z"
android:fillColor="#00A5E3"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:pathData="M23.437,30.397C23.483,30.397 23.52,30.36 23.52,30.314L23.518,20.797L22.092,20.814L15.673,29.083L14.246,29.083L7.827,20.814L6.4,20.797L6.4,30.314C6.4,30.36 6.437,30.396 6.483,30.396L23.437,30.397ZM7.827,28.754L7.827,20.814L14.246,29.083H8.183C7.987,29.083 7.827,28.936 7.827,28.754ZM21.736,29.083L15.673,29.083L22.092,20.814V28.753C22.092,28.936 21.932,29.083 21.736,29.083Z"
android:fillColor="#00A5E3"
android:fillType="evenOdd"/>
<path
android:pathData="M23.37,20.631L24.439,21.697C24.471,21.729 24.523,21.729 24.555,21.697L28.657,17.594C28.689,17.563 28.689,17.511 28.657,17.479L25.096,13.905C25.991,13.994 26.792,13.752 27.339,13.205C28.35,12.194 28.254,10.513 27.122,9.38C25.934,8.193 24.447,8.326 23.197,8.803C23.675,7.555 23.808,6.067 22.62,4.879C21.487,3.746 19.806,3.651 18.795,4.662C18.248,5.21 18.006,6.009 18.095,6.905L14.524,3.333C14.492,3.301 14.44,3.301 14.408,3.333L10.303,7.445C10.271,7.477 10.271,7.529 10.303,7.561L11.368,8.63L23.37,20.631ZM26.566,17.687L24.639,19.613C24.512,19.741 24.296,19.732 24.158,19.594L18.782,14.219L21.171,11.83L26.547,17.206C26.685,17.343 26.694,17.559 26.566,17.687ZM26.197,10.305C26.836,10.944 26.77,11.773 26.338,12.205C25.995,12.548 25.444,12.651 24.786,12.497C24.222,12.364 23.339,11.984 22.179,10.956C23.14,10.284 25.076,9.185 26.197,10.305ZM21.695,5.804C22.816,6.925 21.716,8.86 21.044,9.82C20.017,8.661 19.637,7.779 19.504,7.214C19.348,6.556 19.452,6.005 19.795,5.662C20.227,5.231 21.056,5.165 21.695,5.804ZM12.387,7.361L14.314,5.435C14.441,5.307 14.657,5.316 14.795,5.454L20.171,10.83L17.783,13.218L12.406,7.842C12.269,7.704 12.26,7.489 12.387,7.361Z"
android:fillColor="#00A5E3"
android:fillType="evenOdd"/>
<path
android:pathData="M14.96,25.602L14.345,25.049C12.162,23.095 10.72,21.806 10.72,20.224C10.72,18.935 11.746,17.922 13.052,17.922C13.79,17.922 14.498,18.261 14.96,18.797C15.422,18.261 16.131,17.922 16.868,17.922C18.174,17.922 19.2,18.935 19.2,20.224C19.2,21.806 17.759,23.095 15.575,25.054L14.96,25.602Z"
android:fillColor="#00A5E3"
android:fillType="evenOdd"/>
</vector>
<vector android:height="32dp" android:viewportHeight="16"
android:viewportWidth="16" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#0EA600" android:fillType="evenOdd" android:pathData="M0.227,6.932H1.81C2.307,3.381 5.277,0.641 8.864,0.641C12.799,0.641 16,3.934 16,7.98C16,12.027 12.799,15.32 8.864,15.32C6.652,15.32 4.602,14.29 3.238,12.495L4.041,11.85C5.21,13.389 6.968,14.271 8.864,14.271C12.237,14.271 14.981,11.449 14.981,7.98C14.981,4.511 12.237,1.689 8.864,1.689C5.84,1.689 3.328,3.961 2.84,6.932H4.25C4.309,6.932 4.366,6.955 4.408,6.996C4.498,7.083 4.5,7.227 4.412,7.317L2.238,9.553L0.064,7.317C0.023,7.274 0,7.218 0,7.159C0,7.033 0.102,6.932 0.227,6.932ZM7.831,8.336L7.832,5.336C7.833,5.223 7.924,5.132 8.036,5.132H8.545L8.545,5.132C8.657,5.132 8.748,5.223 8.748,5.336L8.747,8.147L10.761,10.16H10.761C10.841,10.24 10.841,10.369 10.761,10.448L10.402,10.808C10.322,10.887 10.193,10.887 10.113,10.808L7.965,8.66C7.879,8.574 7.831,8.458 7.831,8.336Z"/>
</vector>
<vector android:height="34.133335dp" android:viewportHeight="16"
android:viewportWidth="15" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#0EA600" android:fillType="evenOdd" android:pathData="M8.722,6.775V1.028C8.722,0.827 8.562,0.664 8.382,0.664H6.617C6.43,0.664 6.278,0.815 6.278,1.028V6.775H0.53C0.329,6.775 0.167,6.936 0.167,7.115V8.88C0.167,9.067 0.318,9.22 0.53,9.22H6.278V14.967C6.278,15.168 6.438,15.331 6.617,15.331H8.382C8.57,15.331 8.722,15.18 8.722,14.967V9.22H14.469C14.67,9.22 14.833,9.059 14.833,8.88V7.115C14.833,6.927 14.682,6.775 14.469,6.775H8.722Z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:pathData="M8.939,21.363H9.957L27.313,21.363C27.732,21.363 28.101,21.105 28.221,20.729L31.961,8.984C32.046,8.716 31.991,8.425 31.812,8.201C31.633,7.976 31.351,7.844 31.052,7.844L6.924,7.844L5.649,3.837C5.529,3.461 5.159,3.203 4.74,3.203L0.948,3.203C0.425,3.203 0,3.6 0,4.09C0,4.58 0.425,4.977 0.948,4.977H4.033L5.303,8.965C5.307,8.978 5.311,8.991 5.315,9.004L8.688,19.598C6.763,19.719 5.236,21.222 5.236,23.053C5.236,24.963 6.897,26.517 8.939,26.517H9.88C10.291,27.836 11.595,28.803 13.136,28.803C14.677,28.803 15.981,27.836 16.392,26.517H21.422C21.834,27.836 23.137,28.803 24.678,28.803C26.22,28.803 27.523,27.836 27.934,26.517H29.156C29.679,26.517 30.104,26.12 30.104,25.63C30.104,25.14 29.679,24.743 29.156,24.743H27.934C27.523,23.424 26.22,22.457 24.678,22.457C23.137,22.457 21.833,23.424 21.422,24.743H16.392C15.981,23.424 14.677,22.457 13.136,22.457C11.595,22.457 10.291,23.424 9.88,24.743H8.939C7.942,24.743 7.132,23.985 7.132,23.053C7.132,22.121 7.943,21.363 8.939,21.363ZM22.847,9.618H29.781L28.476,13.716H22.847V9.618ZM22.847,15.49H27.911L26.606,19.589H22.847L22.847,15.49ZM15.832,9.618L20.951,9.618V13.716H15.832L15.832,9.618ZM15.832,15.49H20.951L20.951,19.589H15.832V15.49ZM13.936,19.589H10.664L9.359,15.49H13.936V19.589ZM7.489,9.618L13.936,9.618L13.936,13.716H8.794L7.489,9.618ZM24.64,24.003C25.522,24.003 26.24,24.721 26.24,25.603C26.24,26.485 25.522,27.203 24.64,27.203C23.758,27.203 23.04,26.485 23.04,25.603C23.04,24.721 23.758,24.003 24.64,24.003ZM13.12,24.003C14.002,24.003 14.72,24.721 14.72,25.603C14.72,26.485 14.002,27.203 13.12,27.203C12.238,27.203 11.52,26.485 11.52,25.603C11.52,24.721 12.238,24.003 13.12,24.003Z"
android:fillColor="#00A5E3"
android:fillType="evenOdd"/>
</vector>
<vector android:height="28.8dp" android:viewportHeight="18"
android:viewportWidth="20" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/cos_skyblue6" android:fillType="evenOdd" android:pathData="M18.329,0C19.247,0.004 19.99,0.776 19.993,1.729C19.993,2.262 19.998,2.685 20,3.027L20,3.401C19.994,4.193 19.938,4.449 19.654,4.841C20.067,5.408 19.993,5.609 19.993,7.953C19.99,8.328 19.871,8.692 19.654,8.991C19.871,9.29 19.99,9.653 19.993,10.028C19.993,10.561 19.998,10.984 20,11.326L20,11.7C19.994,12.492 19.938,12.748 19.654,13.14C20.067,13.707 19.993,13.908 19.993,16.252C19.993,17.207 19.248,17.981 18.329,17.981C18.182,17.981 18.037,17.981 17.896,17.981L17.077,17.983C15.373,17.986 14.111,17.997 13.165,18L12.38,18C10.856,17.995 10.447,17.944 10.151,17.74L10.085,17.69C10.063,17.672 10.041,17.654 10.019,17.634L9.952,17.572L9.881,17.504C6.902,18.658 3.546,17.683 1.576,15.091C-0.395,12.498 -0.53,8.881 1.242,6.138C3.013,3.395 6.286,2.153 9.342,3.064V1.729C9.342,0.774 10.087,0 11.006,0H18.329ZM7.345,4.15C4.036,4.15 1.354,6.936 1.354,10.374C1.354,12.025 1.985,13.608 3.109,14.775C4.232,15.942 5.756,16.598 7.345,16.598C10.654,16.598 13.336,13.811 13.336,10.374C13.336,6.936 10.654,4.15 7.345,4.15ZM18.329,13.832H13.862C13.314,14.935 12.517,15.884 11.539,16.598H18.329C18.511,16.594 18.658,16.442 18.662,16.252V14.177C18.658,13.988 18.511,13.835 18.329,13.832ZM18.329,9.682H14.668C14.745,10.615 14.648,11.554 14.382,12.448H18.329C18.511,12.445 18.658,12.292 18.662,12.103V10.028C18.658,9.839 18.511,9.686 18.329,9.682ZM18.316,5.533H12.99C13.633,6.345 14.107,7.287 14.382,8.299H18.329C18.511,8.295 18.658,8.143 18.662,7.953V5.878C18.66,5.785 18.623,5.696 18.558,5.631C18.493,5.566 18.406,5.531 18.316,5.533ZM18.329,1.383H11.006C10.824,1.387 10.677,1.54 10.674,1.729V3.603C11.959,4.29 10.352,4.166 17.101,4.151L17.901,4.15L18.329,4.15C18.511,4.146 18.658,3.993 18.662,3.804C18.662,1.75 18.768,1.383 18.329,1.383Z"/>
<path android:fillColor="@color/cos_skyblue6" android:pathData="M7.934,14C6.983,14 6.172,13.767 5.501,13.3C4.829,12.834 4.358,12.219 4.086,11.454H3V10.361H3.849C3.841,10.281 3.837,10.16 3.837,10C3.837,9.847 3.841,9.734 3.849,9.661H3V8.568H4.075C4.347,7.796 4.818,7.177 5.489,6.71C6.161,6.237 6.972,6 7.922,6C8.601,6 9.201,6.109 9.721,6.328C10.242,6.539 10.664,6.842 10.989,7.235L9.891,8.372C9.65,8.058 9.348,7.825 8.986,7.672C8.631,7.519 8.254,7.443 7.854,7.443C7.417,7.443 7.025,7.545 6.678,7.749C6.338,7.945 6.07,8.219 5.874,8.568H8.612V9.661H5.535C5.527,9.734 5.523,9.847 5.523,10C5.523,10.08 5.531,10.2 5.546,10.361H8.612V11.454H5.885C6.089,11.803 6.361,12.076 6.7,12.273C7.04,12.463 7.428,12.557 7.866,12.557C8.265,12.557 8.643,12.481 8.997,12.328C9.359,12.175 9.661,11.942 9.902,11.628L11,12.765C10.676,13.158 10.253,13.465 9.733,13.683C9.212,13.894 8.612,14 7.934,14Z"/>
</vector>
......@@ -61,11 +61,14 @@
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:layout_marginTop="24dp"
android:layout_marginHorizontal="24dp"
android:gravity="center"
android:text="@string/cos_no_active_coupons"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
android:lineHeight="24dp"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
......
......@@ -61,9 +61,12 @@
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="@string/cos_no_active_coupons"
android:layout_centerHorizontal="true"
android:layout_marginTop="24dp"
android:layout_marginHorizontal="24dp"
android:gravity="center"
android:lineHeight="24dp"
android:text="@string/cos_no_active_unified_coupons"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
android:visibility="gone" />
......
......@@ -64,31 +64,31 @@
android:layout_height="74dp"
android:padding="1dp"
android:src="@drawable/ic_default_photo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/ShapeAppearanceProfileImage"
app:strokeColor="@color/cos_grey2"
app:strokeWidth="1dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
app:strokeWidth="1dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
app:layout_constraintTop_toTopOf="@+id/iv_profile_photo"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/iv_profile_photo"
app:layout_constraintStart_toEndOf="@+id/iv_profile_photo"
app:layout_constraintEnd_toEndOf="parent"
android:orientation="vertical">
app:layout_constraintStart_toEndOf="@+id/iv_profile_photo"
app:layout_constraintTop_toTopOf="@+id/iv_profile_photo">
<TextView
android:id="@+id/tv_profile_name"
fontPath="fonts/PeridotPE-Bold.ttf"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:includeFontPadding="false"
android:layout_marginBottom="4dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="22sp"
tools:text="Test Name" />
......@@ -128,6 +128,12 @@
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="4dp"
android:src="@drawable/sv_plus_sign_green" />
<TextView
android:id="@+id/tv_questionnaire"
fontPath="fonts/PeridotPE-Bold.ttf"
......@@ -143,11 +149,15 @@
android:id="@+id/ll_loyalty_history"
android:layout_width="52dp"
android:layout_height="42dp"
android:layout_marginStart="4dp"
android:background="@drawable/selector_button_green_border"
android:gravity="center"
android:layout_marginStart="4dp"
android:orientation="vertical">
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/sv_history" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
......@@ -164,6 +174,408 @@
android:gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_banner_info_new"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="14dp"
android:layout_marginTop="16dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/tv_coupons_header"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:maxLines="1"
android:text="@string/cos_coupons_loyalty_title"
android:textColor="@color/cos_light_black"
android:textSize="22sp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<RelativeLayout
android:id="@+id/rv_deals_count"
android:layout_width="0dp"
android:layout_height="104dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/rv_sm_count"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:id="@+id/cv_deals_count"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:layout_marginVertical="2dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_green_tr">
<ImageView
android:id="@+id/iv_deals_logo_count"
android:layout_width="52dp"
android:layout_height="32dp"
android:src="@drawable/sv_deals_logo_redesign"
app:layout_constraintBottom_toTopOf="@+id/v_separator_deals_count"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/v_separator_deals_count"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginHorizontal="8dp"
android:background="@color/cos_grey2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_deals_count_title"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_deals_title2"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v_separator_deals_count" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:background="@drawable/shape_cos_counter_orange"
android:gravity="center"
android:orientation="vertical"
android:translationZ="2dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_deals_count"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
tools:text="6" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rv_sm_count"
android:layout_width="0dp"
android:layout_height="104dp"
android:layout_marginHorizontal="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/rv_gifts_count"
app:layout_constraintStart_toEndOf="@+id/rv_deals_count"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:id="@+id/cv_sm_count"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:layout_marginVertical="2dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_creme">
<ImageView
android:id="@+id/iv_sm_logo_count"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/sv_unified_redesign"
app:layout_constraintBottom_toTopOf="@+id/v_separator_sm_count"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/v_separator_sm_count"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginHorizontal="8dp"
android:background="@color/cos_grey2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_sm_count_title"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_market_title"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v_separator_sm_count" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:background="@drawable/shape_cos_counter_orange"
android:gravity="center"
android:orientation="vertical"
android:translationZ="2dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_sm_count"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
tools:text="6" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rv_gifts_count"
android:layout_width="0dp"
android:layout_height="104dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/rv_sm_count"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:id="@+id/cv_gifts_count"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:layout_marginVertical="2dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_skyblue5">
<ImageView
android:id="@+id/iv_gifts_logo_count"
android:layout_width="34dp"
android:layout_height="34dp"
android:src="@drawable/sv_gifts_redesign"
app:layout_constraintBottom_toTopOf="@+id/v_separator_gifts_count"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/v_separator_gifts_count"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginHorizontal="8dp"
android:background="@color/cos_grey2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_gifts_count_title"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_gifts_title"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v_separator_gifts_count" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:background="@drawable/shape_cos_counter_orange"
android:gravity="center"
android:orientation="vertical"
android:translationZ="2dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_gifts_count"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
tools:text="6" />
</LinearLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/ll_vouchers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<View
android:id="@+id/v_separator_vouchers"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/cos_gray" />
<TextView
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:includeFontPadding="false"
android:maxLines="1"
android:text="@string/cos_vouchers_title"
android:textColor="@color/cos_light_black"
android:textSize="22sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_vouchers"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="4dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ImageView
android:id="@+id/iv_vouchers_logo"
android:layout_width="32dp"
android:layout_height="30dp"
android:layout_marginStart="16dp"
android:src="@drawable/sv_vouchers"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_vouchers_info_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:includeFontPadding="false"
android:lineHeight="24dp"
android:text="@string/cos_vouchers_info_title"
android:textColor="@color/cos_light_black"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@+id/iv_vouchers_logo"
app:layout_constraintEnd_toStartOf="@+id/iv_vouchers_arrow"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/iv_vouchers_logo"
app:layout_constraintTop_toTopOf="@+id/iv_vouchers_logo" />
<ImageView
android:id="@+id/iv_vouchers_arrow"
android:layout_width="16dp"
android:layout_height="10dp"
android:layout_marginEnd="16dp"
android:rotation="270"
android:src="@drawable/sv_arrow_down"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_empty_wallet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="32dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone">
<ImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:src="@drawable/ic_empty_wallet" />
<TextView
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/cos_empty_wallet"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<androidx.cardview.widget.CardView
android:id="@+id/cl_exp"
android:layout_width="match_parent"
......@@ -173,7 +585,7 @@
android:visibility="gone"
app:cardCornerRadius="16dp"
app:cardElevation="2dp"
tools:visibility="visible">
tools:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
......@@ -452,7 +864,7 @@
android:layout_marginTop="20dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
tools:visibility="gone">
<TextView
android:id="@+id/tv_market_header"
......@@ -482,7 +894,7 @@
android:layout_marginTop="24dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
tools:visibility="gone">
<ImageView
android:id="@+id/dfy_logo"
......@@ -589,7 +1001,7 @@
android:layout_marginTop="24dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
tools:visibility="gone">
<TextView
android:id="@+id/tv_active_coupons_header"
......@@ -611,32 +1023,6 @@
android:overScrollMode="never"
android:paddingBottom="40dp"
android:scrollbars="none" />
<LinearLayout
android:id="@+id/ll_empty_wallet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="24dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:src="@drawable/ic_empty_wallet" />
<TextView
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/cos_empty_wallet"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
......
......@@ -75,4 +75,9 @@
<color name="cos_blue6">#004B87</color>
<color name="cos_skyblue4">#B8E0EF</color>
<color name="cos_grey_line_tr">#40A9A9A9</color>
<color name="cos_green_tr">#0D76BF73</color>
<color name="cos_orange">#EABF68</color>
<color name="cos_creme">#FEFCF7</color>
<color name="cos_skyblue5">#F4F8FB</color>
<color name="cos_skyblue6">#0099CC</color>
</resources>
\ No newline at end of file
......
......@@ -15,6 +15,7 @@
<string name="cos_profile_reward">My Loyalty\nWallet</string>
<string name="cos_profile_title">My Rewards</string>
<string name="cos_deals_title">Deals for You</string>
<string name="cos_deals_title2">DEALS FOR YOU</string>
<string name="cos_profile_more">Δες περισσότερα</string>
<string name="cos_gifts_title">GIFTS FOR YOU</string>
<string name="cos_more_title">MORE FOR YOU</string>
......@@ -63,7 +64,8 @@
<string name="cos_profile_questionnaire">Ερωτηματολόγιο</string>
<string name="cos_active_all_coupons">Ενεργά κουπόνια</string>
<string name="cos_active_all_rewards">Όλα τα δώρα μου</string>
<string name="cos_no_active_coupons">Δεν υπάρχουν κουπόνια</string>
<string name="cos_no_active_coupons">Αυτήν τη στιγμή δεν έχεις κάποιο ενεργό κουπόνι. Στην ενότητα FOR YOU μπορείς να βρεις κουπόνια αποκλειστικά για σένα!</string>
<string name="cos_no_active_unified_coupons">Αυτήν τη στιγμή δεν έχεις κάποιο ενεργό κουπόνι. Στην ενότητα FOR YOU μπορείς να βρεις κουπόνια αποκλειστικά για σένα!</string>
<string name="cos_no_active_rewards">Δεν υπάρχουν δώρα</string>
<string name="cos_past_all_coupons">Παλαιότερα κουπόνια</string>
<string name="cos_coupon_expired_date">Εξαργυρώθηκε την %1$s</string>
......@@ -92,7 +94,7 @@
<string name="cos_dlg_reject_text">Το δώρο θα επιστραφεί και δεν θα μπορεί να ενεργοποιηθεί ξανά.</string>
<string name="cos_dlg_return_text">Έλαβες πίσω το δώρο σου, κουπόνι αξίας 100€ για τα Intersport</string>
<string name="cos_dlg_negative_button2">Άκυρο</string>
<string name="cos_profile_preferences">+Προτιμήσεις</string>
<string name="cos_profile_preferences">Προτιμήσεις</string>
<string name="cos_shops">Δες τα καταστήματα</string>
<string name="cos_website">Δες το eshop</string>
<string name="cos_coupon_shops_title">Καταστήματα</string>
......@@ -198,6 +200,8 @@
<string name="cos_dlg_cancel_unified_coupon_success_subtitle2">Είσαι σίγουρος ότι θέλεις να ακυρώσεις το κουπόνι σου;</string>
<string name="cos_dlg_negative_button4">Όχι</string>
<string name="cos_dlg_positive_button3">Ναι</string>
<string name="cos_vouchers_title">Υπόλοιπο επιδότησης</string>
<string name="cos_vouchers_info_title">Ενημερώσου για το υπόλοιπο επιδότησης</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
......