Panagiotis Triantafyllou

redesign my rewards fragment

......@@ -114,11 +114,11 @@
android:screenOrientation="portrait"
android:theme="@style/SDKAppTheme" />
<activity
android:name="ly.warp.sdk.activities.LoyaltyWallet"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/SDKAppTheme" />
<!-- <activity-->
<!-- android:name="ly.warp.sdk.activities.LoyaltyWallet"-->
<!-- android:exported="false"-->
<!-- android:screenOrientation="portrait"-->
<!-- android:theme="@style/SDKAppTheme" />-->
<activity
android:name="ly.warp.sdk.activities.ActiveGiftsActivity"
......
......@@ -199,25 +199,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
mFavValue += WarplyManagerHelper.getDealsCouponsSum();
/** First Banner */
/** Second Banner */
if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
String badgeValue = String.format(Locale.GERMAN,"%.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, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE);
mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue();
}
/** Second Banner */
/** Third Expandable Banner */
/** Second Expandable Banner */
if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) {
countValue = 0.0f;
......@@ -226,7 +208,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetUuid().equals(couset.getUuid())) {
countValue += Float.valueOf(cou.getDiscount());
countValue += Float.parseFloat(cou.getDiscount());
cou.setDescription(couset.getShortDescription());
cou.setImage(couset.getImgPreview());
cou.setName(couset.getName());
......@@ -263,7 +245,25 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
sBuilderThird.setSpan(typefaceBoldSpanThird, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
}
/** Third Expandable Banner */
/** Second Expandable Banner */
/** Third Banner */
if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
String badgeValue = String.format(Locale.GERMAN,"%.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, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE);
mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue();
}
/** Third Banner */
/** Sum Banner */
String allValue = String.format(Locale.GERMAN,"%.02f", mFavValue);
......
......@@ -18,7 +18,6 @@ import org.json.JSONObject;
import ly.warp.sdk.R;
import ly.warp.sdk.activities.GiftsForYouActivity;
import ly.warp.sdk.activities.LoyaltyWallet;
import ly.warp.sdk.activities.MoreForYouActivity;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.io.models.Campaign;
......@@ -172,8 +171,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
@Override
public void onClick(View view) {
if (view.getId() == R.id.cl_rewards_wallet) {
Intent intent = new Intent(getContext(), LoyaltyWallet.class);
startActivity(intent);
return;
}
if (view.getId() == R.id.iv_more2) {
......
......@@ -43,7 +43,6 @@ import android.net.http.SslError;
import android.os.Build;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.webkit.GeolocationPermissions.Callback;
import android.webkit.JavascriptInterface;
import android.webkit.SslErrorHandler;
......@@ -84,7 +83,6 @@ import java.util.Map;
import ly.warp.sdk.R;
import ly.warp.sdk.Warply;
import ly.warp.sdk.activities.LoyaltyWallet;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.io.models.CouponEventModel;
......@@ -494,8 +492,8 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
} else if (parts[1].equals("couponRetrieved")) {
EventBus.getDefault().post(new WarplyEventBusManager(new CouponEventModel()));
} else if (parts[1].equals("loyaltyWallet")) {
Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), LoyaltyWallet.class);
getContext().startActivity(intent);
// Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), LoyaltyWallet.class);
// getContext().startActivity(intent);
RefreshVouchersEventModel vouchersRefreshed = new RefreshVouchersEventModel();
vouchersRefreshed.setRefreshed(true);
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<stroke android:width="1dp" android:color="@color/cos_grey2" />
<corners android:radius="16dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<stroke android:width="1dp" android:color="@color/cos_grey2_tr" />
<corners android:radius="16dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/round_border_grey_tr" android:state_pressed="true" />
<item android:drawable="@drawable/round_border_grey" android:state_pressed="false" />
</selector>
\ No newline at end of file
......@@ -33,7 +33,7 @@
android:textColor="@color/cos_light_black"
android:textSize="19sp"
fontPath="fonts/BTCosmo-Bold.ttf"
android:text="@string/cos_gifts_title"
android:text="@string/cos_free_coupons"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -19,7 +19,7 @@
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:scaleType="centerInside"
android:src="@drawable/ic_back"
android:src="@drawable/ic_close"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......@@ -46,23 +46,11 @@
android:layout_marginTop="16dp"
android:orientation="vertical">
<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_redeemed_coupons_loyalty_title"
android:textColor="@color/cos_light_black"
android:textSize="22sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cl_exp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="4dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
......@@ -179,7 +167,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_green_tr"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
......@@ -260,7 +248,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_creme"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
......@@ -341,7 +329,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_skyblue5"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
......
......@@ -19,6 +19,7 @@
<string name="cos_profile_more">Δες περισσότερα</string>
<string name="cos_gifts_title">GIFTS FOR YOU</string>
<string name="cos_more_title">MORE FOR YOU</string>
<string name="cos_free_coupons">FREE COUPONS</string>
<string name="menu_home">Αρχική</string>
<string name="menu_explore">Ανακάλυψε</string>
<string name="menu_shop">Shop</string>
......@@ -75,7 +76,7 @@
<string name="cos_gift_it">Δώρισέ το</string>
<string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string>
<string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string>
<string name="cos_deals_win_title">Μέχρι τώρα έχεις όφελος %1$s€ από τα GIFTS FOR YOU</string>
<string name="cos_deals_win_title">Μέχρι τώρα έχεις όφελος %1$s€ από τα FREE COUPONS</string>
<string name="cos_deals_win_title_cos">Μέχρι τώρα έχεις όφελος %1$s€ από τα DEALS FOR YOU</string>
<string name="cos_mygifts">Τα δώρα μου</string>
<string name="cos_gifts_banner_title">Δώρα:</string>
......@@ -94,7 +95,8 @@
<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_profile_history">Δες το ιστορικό σου</string>
<string name="cos_shops">Δες τα καταστήματα</string>
<string name="cos_website">Δες το eshop</string>
<string name="cos_coupon_shops_title">Καταστήματα</string>
......@@ -122,7 +124,7 @@
<string name="cos_shared_coupon_receiver">Εκπτωτικό κουπόνι προς</string>
<string name="cos_shared_coupon_sender">Έκπτωτικό κουπόνι από</string>
<string name="cos_steps_for_good_notification_title">Steps For Good</string>
<string name="cos_empty_wallet">Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές!</string>
<string name="cos_empty_wallet">Δεν έχεις ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές</string>
<string name="cos_wallet_text1">Μέχρι τώρα έχεις κερδίσει&#160;</string>
<string name="cos_wallet_text2">&#160;με το DEALS for YOU!</string>
<string name="cos_wallet_text3">Μέχρι τώρα έχεις κερδίσει&#160;</string>
......@@ -212,6 +214,7 @@
<string name="cos_dlg_return">Επιστροφή</string>
<string name="cos_vouchers_info_title_disabled">Διαθέσιμο υπόλοιπο</string>
<string name="cos_vouchers_info_title_disabled_en">Available balance</string>
<string name="cos_coupons_header">Κουπόνια</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
......
......@@ -72,4 +72,8 @@
<item name="colorAccent">@color/cos_green12</item>
</style>
<style name="progressBarBlue" parent="@style/Theme.AppCompat">
<item name="colorAccent">@color/cos_light_blue</item>
</style>
</resources>
\ No newline at end of file
......