Panagiotis Triantafyllou

redesign my rewards fragment

...@@ -114,11 +114,11 @@ ...@@ -114,11 +114,11 @@
114 android:screenOrientation="portrait" 114 android:screenOrientation="portrait"
115 android:theme="@style/SDKAppTheme" /> 115 android:theme="@style/SDKAppTheme" />
116 116
117 - <activity 117 +<!-- <activity-->
118 - android:name="ly.warp.sdk.activities.LoyaltyWallet" 118 +<!-- android:name="ly.warp.sdk.activities.LoyaltyWallet"-->
119 - android:exported="false" 119 +<!-- android:exported="false"-->
120 - android:screenOrientation="portrait" 120 +<!-- android:screenOrientation="portrait"-->
121 - android:theme="@style/SDKAppTheme" /> 121 +<!-- android:theme="@style/SDKAppTheme" />-->
122 122
123 <activity 123 <activity
124 android:name="ly.warp.sdk.activities.ActiveGiftsActivity" 124 android:name="ly.warp.sdk.activities.ActiveGiftsActivity"
......
...@@ -199,25 +199,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList ...@@ -199,25 +199,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
199 mFavValue += WarplyManagerHelper.getDealsCouponsSum(); 199 mFavValue += WarplyManagerHelper.getDealsCouponsSum();
200 /** First Banner */ 200 /** First Banner */
201 201
202 - /** Second Banner */ 202 + /** Second Expandable Banner */
203 - if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
204 - String badgeValue = String.format(Locale.GERMAN,"%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
205 - mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue));
206 - if (String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()).length() >= 3) {
207 - mTvGiftsValue.setTextSize(12);
208 - } else {
209 - mTvGiftsValue.setTextSize(14);
210 - }
211 - SpannableStringBuilder sBuilderSecond = new SpannableStringBuilder();
212 - sBuilderSecond.append(String.format(getString(R.string.cos_deals_win_title), badgeValue));
213 - CalligraphyTypefaceSpan typefaceBoldSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
214 - sBuilderSecond.setSpan(typefaceBoldSpanSecond, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
215 - mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE);
216 - mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue();
217 - }
218 - /** Second Banner */
219 -
220 - /** Third Expandable Banner */
221 if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) { 203 if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) {
222 countValue = 0.0f; 204 countValue = 0.0f;
223 205
...@@ -226,7 +208,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList ...@@ -226,7 +208,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
226 for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) { 208 for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
227 for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) { 209 for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
228 if (cou.getCouponsetUuid().equals(couset.getUuid())) { 210 if (cou.getCouponsetUuid().equals(couset.getUuid())) {
229 - countValue += Float.valueOf(cou.getDiscount()); 211 + countValue += Float.parseFloat(cou.getDiscount());
230 cou.setDescription(couset.getShortDescription()); 212 cou.setDescription(couset.getShortDescription());
231 cou.setImage(couset.getImgPreview()); 213 cou.setImage(couset.getImgPreview());
232 cou.setName(couset.getName()); 214 cou.setName(couset.getName());
...@@ -263,7 +245,25 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList ...@@ -263,7 +245,25 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
263 sBuilderThird.setSpan(typefaceBoldSpanThird, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); 245 sBuilderThird.setSpan(typefaceBoldSpanThird, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
264 mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE); 246 mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
265 } 247 }
266 - /** Third Expandable Banner */ 248 + /** Second Expandable Banner */
249 +
250 + /** Third Banner */
251 + if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
252 + String badgeValue = String.format(Locale.GERMAN,"%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
253 + mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue));
254 + if (String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()).length() >= 3) {
255 + mTvGiftsValue.setTextSize(12);
256 + } else {
257 + mTvGiftsValue.setTextSize(14);
258 + }
259 + SpannableStringBuilder sBuilderSecond = new SpannableStringBuilder();
260 + sBuilderSecond.append(String.format(getString(R.string.cos_deals_win_title), badgeValue));
261 + CalligraphyTypefaceSpan typefaceBoldSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
262 + sBuilderSecond.setSpan(typefaceBoldSpanSecond, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
263 + mTvGiftsValueAll.setText(sBuilderSecond, TextView.BufferType.SPANNABLE);
264 + mFavValue += WarplyManagerHelper.getLoyaltyBadge().getValue();
265 + }
266 + /** Third Banner */
267 267
268 /** Sum Banner */ 268 /** Sum Banner */
269 String allValue = String.format(Locale.GERMAN,"%.02f", mFavValue); 269 String allValue = String.format(Locale.GERMAN,"%.02f", mFavValue);
......
...@@ -18,7 +18,6 @@ import org.json.JSONObject; ...@@ -18,7 +18,6 @@ import org.json.JSONObject;
18 18
19 import ly.warp.sdk.R; 19 import ly.warp.sdk.R;
20 import ly.warp.sdk.activities.GiftsForYouActivity; 20 import ly.warp.sdk.activities.GiftsForYouActivity;
21 -import ly.warp.sdk.activities.LoyaltyWallet;
22 import ly.warp.sdk.activities.MoreForYouActivity; 21 import ly.warp.sdk.activities.MoreForYouActivity;
23 import ly.warp.sdk.activities.WarpViewActivity; 22 import ly.warp.sdk.activities.WarpViewActivity;
24 import ly.warp.sdk.io.models.Campaign; 23 import ly.warp.sdk.io.models.Campaign;
...@@ -172,8 +171,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener { ...@@ -172,8 +171,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
172 @Override 171 @Override
173 public void onClick(View view) { 172 public void onClick(View view) {
174 if (view.getId() == R.id.cl_rewards_wallet) { 173 if (view.getId() == R.id.cl_rewards_wallet) {
175 - Intent intent = new Intent(getContext(), LoyaltyWallet.class); 174 +
176 - startActivity(intent);
177 return; 175 return;
178 } 176 }
179 if (view.getId() == R.id.iv_more2) { 177 if (view.getId() == R.id.iv_more2) {
......
...@@ -43,7 +43,6 @@ import android.net.http.SslError; ...@@ -43,7 +43,6 @@ import android.net.http.SslError;
43 import android.os.Build; 43 import android.os.Build;
44 import android.text.TextUtils; 44 import android.text.TextUtils;
45 import android.util.AttributeSet; 45 import android.util.AttributeSet;
46 -import android.util.Log;
47 import android.webkit.GeolocationPermissions.Callback; 46 import android.webkit.GeolocationPermissions.Callback;
48 import android.webkit.JavascriptInterface; 47 import android.webkit.JavascriptInterface;
49 import android.webkit.SslErrorHandler; 48 import android.webkit.SslErrorHandler;
...@@ -84,7 +83,6 @@ import java.util.Map; ...@@ -84,7 +83,6 @@ import java.util.Map;
84 83
85 import ly.warp.sdk.R; 84 import ly.warp.sdk.R;
86 import ly.warp.sdk.Warply; 85 import ly.warp.sdk.Warply;
87 -import ly.warp.sdk.activities.LoyaltyWallet;
88 import ly.warp.sdk.activities.WarpViewActivity; 86 import ly.warp.sdk.activities.WarpViewActivity;
89 import ly.warp.sdk.db.WarplyDBHelper; 87 import ly.warp.sdk.db.WarplyDBHelper;
90 import ly.warp.sdk.io.models.CouponEventModel; 88 import ly.warp.sdk.io.models.CouponEventModel;
...@@ -494,8 +492,8 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { ...@@ -494,8 +492,8 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
494 } else if (parts[1].equals("couponRetrieved")) { 492 } else if (parts[1].equals("couponRetrieved")) {
495 EventBus.getDefault().post(new WarplyEventBusManager(new CouponEventModel())); 493 EventBus.getDefault().post(new WarplyEventBusManager(new CouponEventModel()));
496 } else if (parts[1].equals("loyaltyWallet")) { 494 } else if (parts[1].equals("loyaltyWallet")) {
497 - Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), LoyaltyWallet.class); 495 +// Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), LoyaltyWallet.class);
498 - getContext().startActivity(intent); 496 +// getContext().startActivity(intent);
499 497
500 RefreshVouchersEventModel vouchersRefreshed = new RefreshVouchersEventModel(); 498 RefreshVouchersEventModel vouchersRefreshed = new RefreshVouchersEventModel();
501 vouchersRefreshed.setRefreshed(true); 499 vouchersRefreshed.setRefreshed(true);
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
3 + <solid android:color="@color/white"/>
4 + <stroke android:width="1dp" android:color="@color/cos_grey2" />
5 + <corners android:radius="16dp" />
6 +</shape>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
3 + <solid android:color="@color/white"/>
4 + <stroke android:width="1dp" android:color="@color/cos_grey2_tr" />
5 + <corners android:radius="16dp" />
6 +</shape>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
3 + <item android:drawable="@drawable/round_border_grey_tr" android:state_pressed="true" />
4 + <item android:drawable="@drawable/round_border_grey" android:state_pressed="false" />
5 +</selector>
...\ No newline at end of file ...\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
33 android:textColor="@color/cos_light_black" 33 android:textColor="@color/cos_light_black"
34 android:textSize="19sp" 34 android:textSize="19sp"
35 fontPath="fonts/BTCosmo-Bold.ttf" 35 fontPath="fonts/BTCosmo-Bold.ttf"
36 - android:text="@string/cos_gifts_title" 36 + android:text="@string/cos_free_coupons"
37 app:layout_constraintBottom_toBottomOf="parent" 37 app:layout_constraintBottom_toBottomOf="parent"
38 app:layout_constraintEnd_toEndOf="parent" 38 app:layout_constraintEnd_toEndOf="parent"
39 app:layout_constraintStart_toStartOf="parent" 39 app:layout_constraintStart_toStartOf="parent"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
19 android:layout_height="48dp" 19 android:layout_height="48dp"
20 android:layout_marginStart="16dp" 20 android:layout_marginStart="16dp"
21 android:scaleType="centerInside" 21 android:scaleType="centerInside"
22 - android:src="@drawable/ic_back" 22 + android:src="@drawable/ic_close"
23 app:layout_constraintBottom_toBottomOf="parent" 23 app:layout_constraintBottom_toBottomOf="parent"
24 app:layout_constraintStart_toStartOf="parent" 24 app:layout_constraintStart_toStartOf="parent"
25 app:layout_constraintTop_toTopOf="parent" /> 25 app:layout_constraintTop_toTopOf="parent" />
...@@ -46,23 +46,11 @@ ...@@ -46,23 +46,11 @@
46 android:layout_marginTop="16dp" 46 android:layout_marginTop="16dp"
47 android:orientation="vertical"> 47 android:orientation="vertical">
48 48
49 - <TextView
50 - android:id="@+id/tv_coupons_header"
51 - fontPath="fonts/PeridotPE-SemiBold.ttf"
52 - android:layout_width="wrap_content"
53 - android:layout_height="wrap_content"
54 - android:includeFontPadding="false"
55 - android:maxLines="1"
56 - android:text="@string/cos_redeemed_coupons_loyalty_title"
57 - android:textColor="@color/cos_light_black"
58 - android:textSize="22sp" />
59 -
60 <androidx.cardview.widget.CardView 49 <androidx.cardview.widget.CardView
61 android:id="@+id/cl_exp" 50 android:id="@+id/cl_exp"
62 android:layout_width="match_parent" 51 android:layout_width="match_parent"
63 android:layout_height="wrap_content" 52 android:layout_height="wrap_content"
64 android:layout_marginHorizontal="2dp" 53 android:layout_marginHorizontal="2dp"
65 - android:layout_marginTop="20dp"
66 android:layout_marginBottom="4dp" 54 android:layout_marginBottom="4dp"
67 app:cardCornerRadius="16dp" 55 app:cardCornerRadius="16dp"
68 app:cardElevation="2dp"> 56 app:cardElevation="2dp">
...@@ -179,7 +167,7 @@ ...@@ -179,7 +167,7 @@
179 <LinearLayout 167 <LinearLayout
180 android:layout_width="match_parent" 168 android:layout_width="match_parent"
181 android:layout_height="match_parent" 169 android:layout_height="match_parent"
182 - android:background="@color/cos_green_tr" 170 + android:background="@color/white"
183 android:gravity="center" 171 android:gravity="center"
184 android:orientation="vertical"> 172 android:orientation="vertical">
185 173
...@@ -260,7 +248,7 @@ ...@@ -260,7 +248,7 @@
260 <LinearLayout 248 <LinearLayout
261 android:layout_width="match_parent" 249 android:layout_width="match_parent"
262 android:layout_height="match_parent" 250 android:layout_height="match_parent"
263 - android:background="@color/cos_creme" 251 + android:background="@color/white"
264 android:gravity="center" 252 android:gravity="center"
265 android:orientation="vertical"> 253 android:orientation="vertical">
266 254
...@@ -341,7 +329,7 @@ ...@@ -341,7 +329,7 @@
341 <LinearLayout 329 <LinearLayout
342 android:layout_width="match_parent" 330 android:layout_width="match_parent"
343 android:layout_height="match_parent" 331 android:layout_height="match_parent"
344 - android:background="@color/cos_skyblue5" 332 + android:background="@color/white"
345 android:gravity="center" 333 android:gravity="center"
346 android:orientation="vertical"> 334 android:orientation="vertical">
347 335
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
19 <string name="cos_profile_more">Δες περισσότερα</string> 19 <string name="cos_profile_more">Δες περισσότερα</string>
20 <string name="cos_gifts_title">GIFTS FOR YOU</string> 20 <string name="cos_gifts_title">GIFTS FOR YOU</string>
21 <string name="cos_more_title">MORE FOR YOU</string> 21 <string name="cos_more_title">MORE FOR YOU</string>
22 + <string name="cos_free_coupons">FREE COUPONS</string>
22 <string name="menu_home">Αρχική</string> 23 <string name="menu_home">Αρχική</string>
23 <string name="menu_explore">Ανακάλυψε</string> 24 <string name="menu_explore">Ανακάλυψε</string>
24 <string name="menu_shop">Shop</string> 25 <string name="menu_shop">Shop</string>
...@@ -75,7 +76,7 @@ ...@@ -75,7 +76,7 @@
75 <string name="cos_gift_it">Δώρισέ το</string> 76 <string name="cos_gift_it">Δώρισέ το</string>
76 <string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string> 77 <string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string>
77 <string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string> 78 <string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string>
78 - <string name="cos_deals_win_title">Μέχρι τώρα έχεις όφελος %1$s€ από τα GIFTS FOR YOU</string> 79 + <string name="cos_deals_win_title">Μέχρι τώρα έχεις όφελος %1$s€ από τα FREE COUPONS</string>
79 <string name="cos_deals_win_title_cos">Μέχρι τώρα έχεις όφελος %1$s€ από τα DEALS FOR YOU</string> 80 <string name="cos_deals_win_title_cos">Μέχρι τώρα έχεις όφελος %1$s€ από τα DEALS FOR YOU</string>
80 <string name="cos_mygifts">Τα δώρα μου</string> 81 <string name="cos_mygifts">Τα δώρα μου</string>
81 <string name="cos_gifts_banner_title">Δώρα:</string> 82 <string name="cos_gifts_banner_title">Δώρα:</string>
...@@ -94,7 +95,8 @@ ...@@ -94,7 +95,8 @@
94 <string name="cos_dlg_reject_text">Το δώρο θα επιστραφεί και δεν θα μπορεί να ενεργοποιηθεί ξανά.</string> 95 <string name="cos_dlg_reject_text">Το δώρο θα επιστραφεί και δεν θα μπορεί να ενεργοποιηθεί ξανά.</string>
95 <string name="cos_dlg_return_text">Έλαβες πίσω το δώρο σου, κουπόνι αξίας 100€ για τα Intersport</string> 96 <string name="cos_dlg_return_text">Έλαβες πίσω το δώρο σου, κουπόνι αξίας 100€ για τα Intersport</string>
96 <string name="cos_dlg_negative_button2">Άκυρο</string> 97 <string name="cos_dlg_negative_button2">Άκυρο</string>
97 - <string name="cos_profile_preferences">Προτιμήσεις</string> 98 + <string name="cos_profile_preferences">Πρόσθεσε τις προτιμήσεις σου</string>
99 + <string name="cos_profile_history">Δες το ιστορικό σου</string>
98 <string name="cos_shops">Δες τα καταστήματα</string> 100 <string name="cos_shops">Δες τα καταστήματα</string>
99 <string name="cos_website">Δες το eshop</string> 101 <string name="cos_website">Δες το eshop</string>
100 <string name="cos_coupon_shops_title">Καταστήματα</string> 102 <string name="cos_coupon_shops_title">Καταστήματα</string>
...@@ -122,7 +124,7 @@ ...@@ -122,7 +124,7 @@
122 <string name="cos_shared_coupon_receiver">Εκπτωτικό κουπόνι προς</string> 124 <string name="cos_shared_coupon_receiver">Εκπτωτικό κουπόνι προς</string>
123 <string name="cos_shared_coupon_sender">Έκπτωτικό κουπόνι από</string> 125 <string name="cos_shared_coupon_sender">Έκπτωτικό κουπόνι από</string>
124 <string name="cos_steps_for_good_notification_title">Steps For Good</string> 126 <string name="cos_steps_for_good_notification_title">Steps For Good</string>
125 - <string name="cos_empty_wallet">Δεν έχεις κάποιον ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές!</string> 127 + <string name="cos_empty_wallet">Δεν έχεις ενεργό κωδικό ή κουπόνι! Μπες τώρα στην ενότητα COSMOTE For You και βρες αποκλειστικές προσφορές</string>
126 <string name="cos_wallet_text1">Μέχρι τώρα έχεις κερδίσει&#160;</string> 128 <string name="cos_wallet_text1">Μέχρι τώρα έχεις κερδίσει&#160;</string>
127 <string name="cos_wallet_text2">&#160;με το DEALS for YOU!</string> 129 <string name="cos_wallet_text2">&#160;με το DEALS for YOU!</string>
128 <string name="cos_wallet_text3">Μέχρι τώρα έχεις κερδίσει&#160;</string> 130 <string name="cos_wallet_text3">Μέχρι τώρα έχεις κερδίσει&#160;</string>
...@@ -212,6 +214,7 @@ ...@@ -212,6 +214,7 @@
212 <string name="cos_dlg_return">Επιστροφή</string> 214 <string name="cos_dlg_return">Επιστροφή</string>
213 <string name="cos_vouchers_info_title_disabled">Διαθέσιμο υπόλοιπο</string> 215 <string name="cos_vouchers_info_title_disabled">Διαθέσιμο υπόλοιπο</string>
214 <string name="cos_vouchers_info_title_disabled_en">Available balance</string> 216 <string name="cos_vouchers_info_title_disabled_en">Available balance</string>
217 + <string name="cos_coupons_header">Κουπόνια</string>
215 218
216 <string-array name="coupons_array"> 219 <string-array name="coupons_array">
217 <item>Κουπόνια</item> 220 <item>Κουπόνια</item>
......
...@@ -72,4 +72,8 @@ ...@@ -72,4 +72,8 @@
72 <item name="colorAccent">@color/cos_green12</item> 72 <item name="colorAccent">@color/cos_green12</item>
73 </style> 73 </style>
74 74
75 + <style name="progressBarBlue" parent="@style/Theme.AppCompat">
76 + <item name="colorAccent">@color/cos_light_blue</item>
77 + </style>
78 +
75 </resources> 79 </resources>
...\ No newline at end of file ...\ No newline at end of file
......