Panagiotis Triantafyllou

redesign supermarket part2

......@@ -461,15 +461,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
String badgeValueFirst = String.format("%.02f", WarplyManagerHelper.getDealsCouponsSum());
mTvDealsValue.setText(String.format(getString(R.string.cos_value), badgeValueFirst));
SpannableStringBuilder sBuilder = new SpannableStringBuilder();
sBuilder
.append(getString(R.string.cos_wallet_text1))
.append(String.format(getString(R.string.cos_value), String.valueOf(WarplyManagerHelper.getDealsCouponsSum())))
.append(getString(R.string.cos_wallet_text2));
CalligraphyTypefaceSpan typefaceRegularSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Regular.ttf"));
CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilder.setSpan(typefaceRegularSpan, 0, getString(R.string.cos_wallet_text1).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sBuilder.setSpan(typefaceRegularSpan, getString(R.string.cos_wallet_text1).length() + String.valueOf(WarplyManagerHelper.getDealsCouponsSum()).length(), getString(R.string.cos_wallet_text1).length() + String.valueOf(WarplyManagerHelper.getDealsCouponsSum()).length() + getString(R.string.cos_wallet_text2).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sBuilder.setSpan(typefaceBoldSpan, getString(R.string.cos_wallet_text1).length(), getString(R.string.cos_wallet_text1).length() + String.valueOf(WarplyManagerHelper.getDealsCouponsSum()).length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
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();
......@@ -478,22 +472,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
String badgeValue = String.format("%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue));
SpannableStringBuilder sBuilderSecond = new SpannableStringBuilder();
sBuilderSecond
.append(getString(R.string.cos_wallet_text3))
.append(String.format(getString(R.string.cos_value), badgeValue))
.append(getString(R.string.cos_wallet_text4))
.append(String.format(getString(R.string.cos_value2), String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getCouponCount())))
.append(getString(R.string.cos_wallet_text5));
CalligraphyTypefaceSpan typefaceRegularSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Regular.ttf"));
CalligraphyTypefaceSpan typefaceRegularSpan2 = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Regular.ttf"));
CalligraphyTypefaceSpan typefaceRegularSpan3 = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Regular.ttf"));
sBuilderSecond.append(String.format(getString(R.string.cos_deals_win_title), badgeValue));
CalligraphyTypefaceSpan typefaceBoldSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
CalligraphyTypefaceSpan typefaceBoldSpan2 = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
sBuilderSecond.setSpan(typefaceRegularSpanSecond, 0, getString(R.string.cos_wallet_text3).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sBuilderSecond.setSpan(typefaceBoldSpanSecond, getString(R.string.cos_wallet_text3).length(), getString(R.string.cos_wallet_text3).length() + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sBuilderSecond.setSpan(typefaceRegularSpan2, getString(R.string.cos_wallet_text3).length() + badgeValue.length() + 1, getString(R.string.cos_wallet_text3).length() + badgeValue.length() + 1 + getString(R.string.cos_wallet_text4).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sBuilderSecond.setSpan(typefaceBoldSpan2, getString(R.string.cos_wallet_text3).length() + badgeValue.length() + 1 + getString(R.string.cos_wallet_text4).length(), getString(R.string.cos_wallet_text3).length() + badgeValue.length() + 1 + getString(R.string.cos_wallet_text4).length() + String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getCouponCount()).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sBuilderSecond.setSpan(typefaceRegularSpan3, getString(R.string.cos_wallet_text3).length() + 1 + badgeValue.length() + 1 + getString(R.string.cos_wallet_text4).length() + String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getCouponCount()).length(), getString(R.string.cos_wallet_text3).length() + badgeValue.length() + 1 + getString(R.string.cos_wallet_text4).length() + String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getCouponCount()).length() + getString(R.string.cos_wallet_text5).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sBuilderSecond.setSpan(typefaceBoldSpanSecond, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE);
mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue();
}
......@@ -511,13 +492,13 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
}
mFavValue += countValue;
if (countValue > 0) {
String badgeValue = String.format("%.02f", countValue);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
} 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 {
String badgeValue = String.format("%.02f", 0.0f);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
......@@ -526,6 +507,12 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
// Sum Expandable Banner
String allValue = String.format("%.02f", mFavValue);
mTvFavValue.setText(String.format(getString(R.string.cos_value), allValue));
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 = "";
......@@ -613,14 +600,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
if (mLlMarketView.getVisibility() == View.GONE
&& WarplyManagerHelper.getDealsCouponsSum() == 0
&& (WarplyManagerHelper.getLoyaltyBadge() != null && WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)
&& mLlDeals.getVisibility() == View.GONE) {
&& countValue == 0) {
mIvExpArrow.setVisibility(View.GONE);
// mLlEmptyWallet.setVisibility(View.VISIBLE);
mIsStayCollapsed = true;
} else {
mIvExpArrow.setVisibility(View.VISIBLE);
mIsStayCollapsed = false;
} //TODO: change the case
}
mIvBack.setOnClickListener(this);
mLlQuestionnaire.setOnClickListener(this);
......
......@@ -3,13 +3,13 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
android:background="@color/white">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="64dp"
android:background="@android:color/white">
android:background="@color/white">
<ImageView
android:id="@+id/iv_coupon_info_back"
......@@ -119,7 +119,7 @@
android:gravity="center"
android:textColor="@color/cos_light_black"
android:textIsSelectable="true"
android:textSize="25dp"
android:textSize="25sp"
tools:text="1A2C378" />
<LinearLayout
......@@ -208,6 +208,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="24dp"
android:textSize="16sp"
android:textColor="@color/cos_gray"
tools:text="@string/cos_coupon_date" />
......@@ -289,7 +290,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="32dp"
android:layout_marginTop="24dp"
android:gravity="center">
<LinearLayout
......@@ -326,11 +327,11 @@
android:layout_below="@+id/ll_terms_inner"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="16dp"
android:textSize="16sp"
android:textColor="@color/cos_gray"
android:textSize="16sp"
android:visibility="gone"
tools:text="@string/cos_coupon_date"
tools:visibility="visible"/>
tools:visibility="visible" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
......
......@@ -141,7 +141,9 @@
android:layout_marginTop="24dp"
android:background="@drawable/shape_cos_white_border"
android:paddingHorizontal="14dp"
android:paddingVertical="14dp">
android:paddingVertical="14dp"
android:visibility="gone"
tools:visibility="visible">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_horizontal_64_exp"
......
......@@ -3,13 +3,13 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
android:background="@color/white">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_loyalty_wallet_header"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@android:color/white">
android:layout_height="64dp"
android:background="@color/white">
<ImageView
android:id="@+id/iv_coupon_info_back"
......@@ -23,12 +23,12 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/BTCosmo-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_coupon_info_title"
android:textColor="@color/grey"
android:textSize="17sp"
android:textColor="@color/cos_light_black"
android:textSize="21sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -40,7 +40,7 @@
android:layout_height="match_parent"
android:layout_below="@+id/cl_loyalty_wallet_header">
<ScrollView
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never">
......@@ -53,61 +53,60 @@
android:orientation="vertical"
android:paddingBottom="48dp">
<!-- <ImageView-->
<!-- android:id="@+id/imageView6"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="253dp"-->
<!-- android:layout_marginTop="0.5dp"-->
<!-- android:scaleType="centerCrop"-->
<!-- android:src="@drawable/unified_coupon_banner" />-->
<ImageView
android:id="@+id/imageView6"
android:layout_width="match_parent"
android:layout_height="295dp"
android:scaleType="centerCrop"
android:src="@drawable/unified_coupon_banner" />
<TextView
android:id="@+id/textView13"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/BTCosmo-Bold.ttf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:gravity="center"
android:paddingHorizontal="32dp"
android:text="@string/cos_unified_title"
android:textColor="#415564"
android:textColor="@color/cos_light_black"
android:textSize="18sp" />
<TextView
android:id="@+id/textView14"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:paddingHorizontal="32dp"
android:text="@string/cos_unified_subtitle"
android:textColor="#415564"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<TextView
android:id="@+id/textView15"
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="36dp"
android:layout_marginTop="24dp"
android:text="Κωδικός Κουπονιού"
android:textColor="#415564"
android:textColor="@color/cos_light_black"
android:textSize="18sp" />
<TextView
android:id="@+id/textView16"
fontPath="fonts/pf_square_sans_pro_bold.ttf"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="12dp"
android:background="@drawable/banner_border_light_grey"
android:gravity="center"
android:textColor="@color/grey"
android:textColor="@color/cos_light_black"
android:textIsSelectable="true"
android:textSize="25dp"
android:textSize="25sp"
tools:text="1A2C378" />
<LinearLayout
......@@ -162,12 +161,13 @@
<TextView
android:id="@+id/textView17"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="16dp"
android:textColor="#415564"
android:textColor="@color/cos_light_black"
android:textSize="16sp"
tools:text="@string/cos_coupon_date" />
<LinearLayout
......@@ -181,11 +181,11 @@
<TextView
android:id="@+id/tv_market_expand"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_hide_market_coupons"
android:textColor="@color/grey"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<ImageView
......@@ -193,6 +193,7 @@
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginStart="6dp"
android:layout_marginTop="3dp"
android:src="@drawable/ic_up_dark_new" />
</LinearLayout>
......@@ -201,6 +202,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@color/cos_light_grey3"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
......@@ -211,11 +213,10 @@
android:overScrollMode="never" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_shops"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="24dp"
......@@ -225,13 +226,14 @@
android:paddingVertical="8dp">
<TextView
fontPath="fonts/pf_square_sans_pro_medium.ttf"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_markets"
android:textColor="@color/white"
android:textSize="17dp" />
android:textSize="16sp" />
</LinearLayout>
<RelativeLayout
......@@ -239,7 +241,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="32dp"
android:layout_marginTop="24dp"
android:gravity="center">
<LinearLayout
......@@ -252,11 +254,11 @@
<TextView
android:id="@+id/tv_terms"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cos_coupon_terms_title"
android:textColor="@color/grey"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
<ImageView
......@@ -264,29 +266,24 @@
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginStart="6dp"
android:layout_marginTop="3dp"
android:src="@drawable/ic_down_dark_new" />
</LinearLayout>
<TextView
android:id="@+id/tv_terms_value"
fontPath="fonts/pf_square_sans_pro_regular.ttf"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_terms_inner"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="16dp"
android:text="@string/cos_market_terms"
android:textColor="#415564"
android:visibility="gone" />
android:textColor="@color/cos_gray"
android:visibility="gone"
tools:visibility="visible"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_line">
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
</RelativeLayout>
......
......@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cl_custom_layout"
android:layout_width="match_parent"
android:layout_height="130dp"
android:layout_height="150dp"
android:layout_marginHorizontal="4dp"
android:layout_marginVertical="4dp"
android:background="@drawable/ic_coupon_background">
......
......@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="130dp"
android:layout_height="150dp"
android:layout_marginHorizontal="4dp"
android:layout_marginVertical="4dp"
android:background="@drawable/ic_coupon_background_new2">
......