Showing
5 changed files
with
93 additions
and
38 deletions
| ... | @@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true | ... | @@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true |
| 5 | 5 | ||
| 6 | ext { | 6 | ext { |
| 7 | PUBLISH_GROUP_ID = 'ly.warp' | 7 | PUBLISH_GROUP_ID = 'ly.warp' |
| 8 | - PUBLISH_VERSION = '4.5.5.4p3' | 8 | + PUBLISH_VERSION = '4.5.5.4p4' |
| 9 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 9 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
| 10 | } | 10 | } |
| 11 | 11 | ... | ... |
| ... | @@ -55,8 +55,8 @@ public class MarketPassActivity extends Activity implements View.OnClickListener | ... | @@ -55,8 +55,8 @@ public class MarketPassActivity extends Activity implements View.OnClickListener |
| 55 | 55 | ||
| 56 | private ImageView mIvBack, mIvInfo, mIvBarcode; | 56 | private ImageView mIvBack, mIvInfo, mIvBarcode; |
| 57 | private TextView mFontHeader, mPassHeader, mPassSubtitle, mTvBarcode, mTvPassCount, mTvButtonMap; | 57 | private TextView mFontHeader, mPassHeader, mPassSubtitle, mTvBarcode, mTvPassCount, mTvButtonMap; |
| 58 | - private LinearLayout mLlMap, mLlParentLogosView; | 58 | + private LinearLayout mLlMap, mLlParentLogosView, mLlOpenSM; |
| 59 | - private boolean mMapPressed = false, mPassInfoPressed = false; | 59 | + private boolean mMapPressed = false, mPassInfoPressed = false, mOpenSMPressed = false; |
| 60 | private MarketPassDetailsModel mMarketPassDetails; | 60 | private MarketPassDetailsModel mMarketPassDetails; |
| 61 | private RelativeLayout mPbLoading; | 61 | private RelativeLayout mPbLoading; |
| 62 | private AlertDialog mAlertDialog; | 62 | private AlertDialog mAlertDialog; |
| ... | @@ -75,7 +75,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener | ... | @@ -75,7 +75,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener |
| 75 | mFontHeader = findViewById(R.id.textView3); | 75 | mFontHeader = findViewById(R.id.textView3); |
| 76 | mIvInfo = findViewById(R.id.iv_coupons_info); | 76 | mIvInfo = findViewById(R.id.iv_coupons_info); |
| 77 | mPassHeader = findViewById(R.id.tv_market_header); | 77 | mPassHeader = findViewById(R.id.tv_market_header); |
| 78 | - mPassSubtitle = findViewById(R.id.tv_market_subtitle); | 78 | +// mPassSubtitle = findViewById(R.id.tv_market_subtitle); |
| 79 | mTvBarcode = findViewById(R.id.tv_barcode_value); | 79 | mTvBarcode = findViewById(R.id.tv_barcode_value); |
| 80 | mIvBarcode = findViewById(R.id.iv_barcode); | 80 | mIvBarcode = findViewById(R.id.iv_barcode); |
| 81 | mTvPassCount = findViewById(R.id.tv_total_pass_title); | 81 | mTvPassCount = findViewById(R.id.tv_total_pass_title); |
| ... | @@ -85,10 +85,11 @@ public class MarketPassActivity extends Activity implements View.OnClickListener | ... | @@ -85,10 +85,11 @@ public class MarketPassActivity extends Activity implements View.OnClickListener |
| 85 | mPbLoading = findViewById(R.id.pb_loading); | 85 | mPbLoading = findViewById(R.id.pb_loading); |
| 86 | mPbLoading.setOnTouchListener((v, event) -> true); | 86 | mPbLoading.setOnTouchListener((v, event) -> true); |
| 87 | mCvMarketDetails = findViewById(R.id.cv_market_details); | 87 | mCvMarketDetails = findViewById(R.id.cv_market_details); |
| 88 | + mLlOpenSM = findViewById(R.id.ll_total_coupons_value); | ||
| 88 | 89 | ||
| 89 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mPassHeader); | 90 | WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mPassHeader); |
| 90 | - WarpUtils.renderCustomFont(this, R.font.peridot_regular, mPassSubtitle, mTvBarcode, mTvPassCount); | 91 | + WarpUtils.renderCustomFont(this, R.font.peridot_regular, /*mPassSubtitle,*/ mTvPassCount); |
| 91 | - WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, mTvButtonMap); | 92 | + WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, mTvBarcode, mTvButtonMap); |
| 92 | 93 | ||
| 93 | mPbLoading.setVisibility(View.VISIBLE); | 94 | mPbLoading.setVisibility(View.VISIBLE); |
| 94 | // WarplyManager.getMarketPassDetails(mMarketPassDetailsCallback); | 95 | // WarplyManager.getMarketPassDetails(mMarketPassDetailsCallback); |
| ... | @@ -101,6 +102,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener | ... | @@ -101,6 +102,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener |
| 101 | WarplyAnalyticsManager.logTrackersEvent(this, "screen", "MarketPassScreen"); | 102 | WarplyAnalyticsManager.logTrackersEvent(this, "screen", "MarketPassScreen"); |
| 102 | mMapPressed = false; | 103 | mMapPressed = false; |
| 103 | mPassInfoPressed = false; | 104 | mPassInfoPressed = false; |
| 105 | + mOpenSMPressed = false; | ||
| 104 | } | 106 | } |
| 105 | 107 | ||
| 106 | @Override | 108 | @Override |
| ... | @@ -117,8 +119,8 @@ public class MarketPassActivity extends Activity implements View.OnClickListener | ... | @@ -117,8 +119,8 @@ public class MarketPassActivity extends Activity implements View.OnClickListener |
| 117 | return; | 119 | return; |
| 118 | } | 120 | } |
| 119 | 121 | ||
| 120 | - WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassInfoScreen"); | 122 | + WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassMap"); |
| 121 | - startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.openSupermarketCampaign(MarketPassActivity.this))); | 123 | + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.openSupermarketMap(MarketPassActivity.this))); |
| 122 | } | 124 | } |
| 123 | } | 125 | } |
| 124 | if (view.getId() == R.id.iv_coupons_info) { | 126 | if (view.getId() == R.id.iv_coupons_info) { |
| ... | @@ -135,6 +137,20 @@ public class MarketPassActivity extends Activity implements View.OnClickListener | ... | @@ -135,6 +137,20 @@ public class MarketPassActivity extends Activity implements View.OnClickListener |
| 135 | 137 | ||
| 136 | Intent intent = new Intent(MarketPassActivity.this, MarketPassInfoActivity.class); | 138 | Intent intent = new Intent(MarketPassActivity.this, MarketPassInfoActivity.class); |
| 137 | startActivity(intent); | 139 | startActivity(intent); |
| 140 | + return; | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | + if (view.getId() == R.id.ll_total_coupons_value) { | ||
| 144 | + if (!mOpenSMPressed) { | ||
| 145 | + mOpenSMPressed = true; | ||
| 146 | + | ||
| 147 | + if (!WarplyManagerHelper.noInternetDialog(this, true)) { | ||
| 148 | + WarplyManagerHelper.noInternetDialog(this); | ||
| 149 | + return; | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassMapCampaign"); | ||
| 153 | + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.openSupermarketCampaign(MarketPassActivity.this))); | ||
| 138 | } | 154 | } |
| 139 | } | 155 | } |
| 140 | } | 156 | } |
| ... | @@ -147,21 +163,24 @@ public class MarketPassActivity extends Activity implements View.OnClickListener | ... | @@ -147,21 +163,24 @@ public class MarketPassActivity extends Activity implements View.OnClickListener |
| 147 | mIvBack.setOnClickListener(this); | 163 | mIvBack.setOnClickListener(this); |
| 148 | mIvInfo.setOnClickListener(this); | 164 | mIvInfo.setOnClickListener(this); |
| 149 | mLlMap.setOnClickListener(this); | 165 | mLlMap.setOnClickListener(this); |
| 166 | + mLlOpenSM.setOnClickListener(this); | ||
| 150 | 167 | ||
| 151 | - if(WarplyManagerHelper.getMarketPassDetails() != null) { | 168 | + if (WarplyManagerHelper.getMarketPassDetails() != null) { |
| 152 | // if (mMarketPassDetails != null) | 169 | // if (mMarketPassDetails != null) |
| 153 | createBarcodeBitmap(WarplyManagerHelper.getMarketPassDetails().getBarcode()); | 170 | createBarcodeBitmap(WarplyManagerHelper.getMarketPassDetails().getBarcode()); |
| 154 | 171 | ||
| 155 | // if (mMarketPassDetails != null) { | 172 | // if (mMarketPassDetails != null) { |
| 156 | - String passValue = String.format(Locale.US, "%.2f", WarplyManagerHelper.getMarketPassDetails().getTotalDiscount()); | 173 | +// String passValue = String.format(Locale.US, "%.2f", WarplyManagerHelper.getMarketPassDetails().getTotalDiscount()); |
| 157 | - String fullText = String.format(getString(R.string.cos_market_pass_coupons_title), passValue); | 174 | +// String fullText = String.format(getString(R.string.cos_market_pass_coupons_title), passValue); |
| 158 | - int startIndex = fullText.indexOf(passValue); | 175 | +// int startIndex = fullText.indexOf(passValue); |
| 159 | - int endIndex = startIndex + passValue.length(); | 176 | +// int endIndex = startIndex + passValue.length(); |
| 160 | - SpannableStringBuilder sBuilder = new SpannableStringBuilder(fullText); | 177 | +// SpannableStringBuilder sBuilder = new SpannableStringBuilder(fullText); |
| 161 | - Typeface typefaceBold = ResourcesCompat.getFont(this, R.font.peridot_bold); | 178 | +// Typeface typefaceBold = ResourcesCompat.getFont(this, R.font.peridot_bold); |
| 162 | - CustomTypefaceSpan typefaceBoldSpan = new CustomTypefaceSpan(typefaceBold); | 179 | +// CustomTypefaceSpan typefaceBoldSpan = new CustomTypefaceSpan(typefaceBold); |
| 163 | - sBuilder.setSpan(typefaceBoldSpan, startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 180 | +// sBuilder.setSpan(typefaceBoldSpan, startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
| 164 | - mTvPassCount.setText(sBuilder, TextView.BufferType.SPANNABLE); | 181 | +// mTvPassCount.setText(sBuilder, TextView.BufferType.SPANNABLE); |
| 182 | + | ||
| 183 | + mTvPassCount.setText(R.string.cos_market_pass_details); | ||
| 165 | // } | 184 | // } |
| 166 | 185 | ||
| 167 | // if (mMarketPassDetails != null) { | 186 | // if (mMarketPassDetails != null) { | ... | ... |
| ... | @@ -147,7 +147,7 @@ public class WarplyManagerHelper { | ... | @@ -147,7 +147,7 @@ public class WarplyManagerHelper { |
| 147 | mMarketPassDetails = marketPassDetails; | 147 | mMarketPassDetails = marketPassDetails; |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | - public static String openSupermarketCampaign(Context context) { | 150 | + public static String openSupermarketMap(Context context) { |
| 151 | // if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) { | 151 | // if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) { |
| 152 | // return "https://dev.supermarketdeals.eu/map"; | 152 | // return "https://dev.supermarketdeals.eu/map"; |
| 153 | // } | 153 | // } |
| ... | @@ -180,6 +180,39 @@ public class WarplyManagerHelper { | ... | @@ -180,6 +180,39 @@ public class WarplyManagerHelper { |
| 180 | return url; | 180 | return url; |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | + public static String openSupermarketCampaign(Context context) { | ||
| 184 | +// if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) { | ||
| 185 | +// return "https://dev.supermarketdeals.eu"; | ||
| 186 | +// } | ||
| 187 | +// | ||
| 188 | +// return "https://supermarketdeals.eu"; | ||
| 189 | + | ||
| 190 | + String url = ""; | ||
| 191 | + if (WarplyProperty.getAppUuid(context).equals("f83dfde1145e4c2da69793abb2f579af")) { | ||
| 192 | + url = "https://dev.supermarketdeals.eu"; | ||
| 193 | + } else { | ||
| 194 | + url = "https://supermarketdeals.eu"; | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + JSONObject params = new JSONObject(); | ||
| 198 | + try { | ||
| 199 | + params.putOpt("web_id", WarpUtils.getWebId(Warply.getWarplyContext())); | ||
| 200 | + params.putOpt("app_uuid", WarplyProperty.getAppUuid(Warply.getWarplyContext())); | ||
| 201 | + params.putOpt("api_key", WarpUtils.getApiKey(Warply.getWarplyContext())); | ||
| 202 | + params.putOpt("session_uuid", ""); | ||
| 203 | + params.putOpt("access_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")); | ||
| 204 | + params.putOpt("refresh_token", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")); | ||
| 205 | + params.putOpt("client_id", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")); | ||
| 206 | + params.putOpt("client_secret", WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret")); | ||
| 207 | + } catch (JSONException e) { | ||
| 208 | + e.printStackTrace(); | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + WarpUtils.setWebviewParams(Warply.getWarplyContext(), params); | ||
| 212 | + | ||
| 213 | + return url; | ||
| 214 | + } | ||
| 215 | + | ||
| 183 | /** | 216 | /** |
| 184 | * Open Warply campaign | 217 | * Open Warply campaign |
| 185 | */ | 218 | */ | ... | ... |
| ... | @@ -98,25 +98,26 @@ | ... | @@ -98,25 +98,26 @@ |
| 98 | android:textColor="@color/white" | 98 | android:textColor="@color/white" |
| 99 | android:textSize="20sp" /> | 99 | android:textSize="20sp" /> |
| 100 | 100 | ||
| 101 | - <TextView | 101 | +<!-- <TextView--> |
| 102 | - android:id="@+id/tv_market_subtitle" | 102 | +<!-- android:id="@+id/tv_market_subtitle"--> |
| 103 | - android:layout_width="wrap_content" | 103 | +<!-- android:layout_width="wrap_content"--> |
| 104 | - android:layout_height="wrap_content" | 104 | +<!-- android:layout_height="wrap_content"--> |
| 105 | - android:layout_below="@+id/tv_market_header" | 105 | +<!-- android:layout_below="@+id/tv_market_header"--> |
| 106 | - android:layout_marginTop="16dp" | 106 | +<!-- android:layout_marginTop="16dp"--> |
| 107 | - android:letterSpacing="0.04" | 107 | +<!-- android:letterSpacing="0.04"--> |
| 108 | - android:text="@string/cos_market_pass_subtitle" | 108 | +<!-- android:text="@string/cos_market_pass_subtitle"--> |
| 109 | - android:textColor="@color/white" | 109 | +<!-- android:textColor="@color/white"--> |
| 110 | - android:textSize="16sp" | 110 | +<!-- android:textSize="16sp"--> |
| 111 | - app:lineHeight="22dp" /> | 111 | +<!-- app:lineHeight="22dp" />--> |
| 112 | - | 112 | + |
| 113 | +<!-- android:layout_marginTop="42dp"--> | ||
| 113 | <LinearLayout | 114 | <LinearLayout |
| 114 | android:id="@+id/ll_barcode" | 115 | android:id="@+id/ll_barcode" |
| 115 | android:layout_width="match_parent" | 116 | android:layout_width="match_parent" |
| 116 | android:layout_height="wrap_content" | 117 | android:layout_height="wrap_content" |
| 117 | - android:layout_below="@+id/tv_market_subtitle" | 118 | + android:layout_below="@+id/tv_market_header" |
| 118 | - android:layout_marginTop="42dp" | 119 | + android:layout_marginBottom="18dp" |
| 119 | - android:layout_marginBottom="36dp" | 120 | + android:layout_marginTop="16dp" |
| 120 | android:background="@drawable/background_white_grey_border" | 121 | android:background="@drawable/background_white_grey_border" |
| 121 | android:gravity="center" | 122 | android:gravity="center" |
| 122 | android:orientation="vertical" | 123 | android:orientation="vertical" |
| ... | @@ -135,11 +136,12 @@ | ... | @@ -135,11 +136,12 @@ |
| 135 | android:id="@+id/tv_barcode_value" | 136 | android:id="@+id/tv_barcode_value" |
| 136 | android:layout_width="wrap_content" | 137 | android:layout_width="wrap_content" |
| 137 | android:layout_height="wrap_content" | 138 | android:layout_height="wrap_content" |
| 138 | - android:layout_marginTop="10dp" | 139 | + android:layout_marginTop="6dp" |
| 139 | android:layout_marginBottom="2dp" | 140 | android:layout_marginBottom="2dp" |
| 140 | android:letterSpacing="0.00074" | 141 | android:letterSpacing="0.00074" |
| 142 | + android:textIsSelectable="true" | ||
| 141 | android:textColor="@color/cos_light_black" | 143 | android:textColor="@color/cos_light_black" |
| 142 | - android:textSize="18sp" /> | 144 | + android:textSize="19sp" /> |
| 143 | </LinearLayout> | 145 | </LinearLayout> |
| 144 | </RelativeLayout> | 146 | </RelativeLayout> |
| 145 | 147 | ||
| ... | @@ -159,7 +161,7 @@ | ... | @@ -159,7 +161,7 @@ |
| 159 | android:includeFontPadding="false" | 161 | android:includeFontPadding="false" |
| 160 | android:letterSpacing="0.04" | 162 | android:letterSpacing="0.04" |
| 161 | android:textColor="@color/white" | 163 | android:textColor="@color/white" |
| 162 | - android:textSize="16sp" | 164 | + android:textSize="14sp" |
| 163 | android:paddingHorizontal="24dp" | 165 | android:paddingHorizontal="24dp" |
| 164 | app:lineHeight="22dp" /> | 166 | app:lineHeight="22dp" /> |
| 165 | </LinearLayout> | 167 | </LinearLayout> |
| ... | @@ -172,11 +174,11 @@ | ... | @@ -172,11 +174,11 @@ |
| 172 | android:orientation="horizontal" | 174 | android:orientation="horizontal" |
| 173 | android:paddingVertical="24dp"> | 175 | android:paddingVertical="24dp"> |
| 174 | 176 | ||
| 177 | +<!-- android:gravity="center"--> | ||
| 175 | <LinearLayout | 178 | <LinearLayout |
| 176 | android:id="@+id/ll_sm_logos" | 179 | android:id="@+id/ll_sm_logos" |
| 177 | android:layout_width="0dp" | 180 | android:layout_width="0dp" |
| 178 | android:layout_height="0dp" | 181 | android:layout_height="0dp" |
| 179 | - android:gravity="center" | ||
| 180 | android:orientation="horizontal" | 182 | android:orientation="horizontal" |
| 181 | app:layout_constraintBottom_toBottomOf="parent" | 183 | app:layout_constraintBottom_toBottomOf="parent" |
| 182 | app:layout_constraintEnd_toStartOf="@+id/ll_map" | 184 | app:layout_constraintEnd_toStartOf="@+id/ll_map" | ... | ... |
| ... | @@ -193,6 +193,7 @@ | ... | @@ -193,6 +193,7 @@ |
| 193 | <string name="cos_market_ab_subtitle">1. Ενεργοποίησε τον κωδικό στην ΑΒ PLUS στο kiosk του καταστήματος ή μέσω AB eshop/app στην ενότητα Συνεργασίες – SUPERMARKET DEALS.\n\n2. Κάνε χρήση της ΑΒ PLUS στις αγορές σου για να λάβεις τις διαθέσιμες εκπτώσεις.</string> | 193 | <string name="cos_market_ab_subtitle">1. Ενεργοποίησε τον κωδικό στην ΑΒ PLUS στο kiosk του καταστήματος ή μέσω AB eshop/app στην ενότητα Συνεργασίες – SUPERMARKET DEALS.\n\n2. Κάνε χρήση της ΑΒ PLUS στις αγορές σου για να λάβεις τις διαθέσιμες εκπτώσεις.</string> |
| 194 | <string name="cos_market_pass_title">SUPERMARKET DEALS CARD</string> | 194 | <string name="cos_market_pass_title">SUPERMARKET DEALS CARD</string> |
| 195 | <string name="cos_market_pass_subtitle">Χρησιμοποίησε το μοναδικό κωδικό σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα κουπόνια στο For You.</string> | 195 | <string name="cos_market_pass_subtitle">Χρησιμοποίησε το μοναδικό κωδικό σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα κουπόνια στο For You.</string> |
| 196 | + <string name="cos_market_pass_details">Χρησιμοποίησε τη SUPERMARKET DEALS CARD σου για να κερδίσεις έκπτωση σε επιλεγμένα προϊόντα. Ανακάλυψε τα διαθέσιμα εκπτωτικά κουπόνια στο For You.</string> | ||
| 196 | <string name="cos_market_pass_return">Επιστροφή</string> | 197 | <string name="cos_market_pass_return">Επιστροφή</string> |
| 197 | <string name="cos_market_pass_coupons_title">Με τα διαθέσιμα κουπόνια μπορείς να εξοικονομήσεις έως και %1$s€.</string> | 198 | <string name="cos_market_pass_coupons_title">Με τα διαθέσιμα κουπόνια μπορείς να εξοικονομήσεις έως και %1$s€.</string> |
| 198 | <string name="cos_market_subtitle">Δημιούργησε το δικό σου ενιαίο κουπόνι προσφορών, και εξαργύρωσέ το στα supermarket της επιλογής σου γρήγορα και εύκολα με ένα μόνο κωδικό κουπονιού!</string> | 199 | <string name="cos_market_subtitle">Δημιούργησε το δικό σου ενιαίο κουπόνι προσφορών, και εξαργύρωσέ το στα supermarket της επιλογής σου γρήγορα και εύκολα με ένα μόνο κωδικό κουπονιού!</string> | ... | ... |
-
Please register or login to post a comment