Panagiotis Triantafyllou

merge changes

...@@ -60,8 +60,8 @@ public class MarketPassActivity extends Activity implements View.OnClickListener ...@@ -60,8 +60,8 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
60 60
61 private ImageView mIvBack, mIvInfo, mIvBarcode; 61 private ImageView mIvBack, mIvInfo, mIvBarcode;
62 private TextView mFontHeader, mPassHeader, mPassSubtitle, mTvBarcode, mTvPassCount, mTvButtonMap; 62 private TextView mFontHeader, mPassHeader, mPassSubtitle, mTvBarcode, mTvPassCount, mTvButtonMap;
63 - private LinearLayout mLlMap, mLlParentLogosView; 63 + private LinearLayout mLlMap, mLlParentLogosView, mLlOpenSM;
64 - private boolean mMapPressed = false, mPassInfoPressed = false; 64 + private boolean mMapPressed = false, mPassInfoPressed = false, mOpenSMPressed = false;
65 private MarketPassDetailsModel mMarketPassDetails; 65 private MarketPassDetailsModel mMarketPassDetails;
66 private RelativeLayout mPbLoading; 66 private RelativeLayout mPbLoading;
67 private AlertDialog mAlertDialog; 67 private AlertDialog mAlertDialog;
...@@ -80,7 +80,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener ...@@ -80,7 +80,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
80 mFontHeader = findViewById(R.id.textView3); 80 mFontHeader = findViewById(R.id.textView3);
81 mIvInfo = findViewById(R.id.iv_coupons_info); 81 mIvInfo = findViewById(R.id.iv_coupons_info);
82 mPassHeader = findViewById(R.id.tv_market_header); 82 mPassHeader = findViewById(R.id.tv_market_header);
83 - mPassSubtitle = findViewById(R.id.tv_market_subtitle); 83 +// mPassSubtitle = findViewById(R.id.tv_market_subtitle);
84 mTvBarcode = findViewById(R.id.tv_barcode_value); 84 mTvBarcode = findViewById(R.id.tv_barcode_value);
85 mIvBarcode = findViewById(R.id.iv_barcode); 85 mIvBarcode = findViewById(R.id.iv_barcode);
86 mTvPassCount = findViewById(R.id.tv_total_pass_title); 86 mTvPassCount = findViewById(R.id.tv_total_pass_title);
...@@ -90,10 +90,11 @@ public class MarketPassActivity extends Activity implements View.OnClickListener ...@@ -90,10 +90,11 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
90 mPbLoading = findViewById(R.id.pb_loading); 90 mPbLoading = findViewById(R.id.pb_loading);
91 mPbLoading.setOnTouchListener((v, event) -> true); 91 mPbLoading.setOnTouchListener((v, event) -> true);
92 mCvMarketDetails = findViewById(R.id.cv_market_details); 92 mCvMarketDetails = findViewById(R.id.cv_market_details);
93 + mLlOpenSM = findViewById(R.id.ll_total_coupons_value);
93 94
94 WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mPassHeader); 95 WarpUtils.renderCustomFont(this, R.font.bt_cosmo_bold, mFontHeader, mPassHeader);
95 - WarpUtils.renderCustomFont(this, R.font.peridot_regular, mPassSubtitle, mTvBarcode, mTvPassCount); 96 + WarpUtils.renderCustomFont(this, R.font.peridot_regular, /*mPassSubtitle,*/ mTvPassCount);
96 - WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, mTvButtonMap); 97 + WarpUtils.renderCustomFont(this, R.font.peridot_semi_bold, mTvBarcode, mTvButtonMap);
97 98
98 mPbLoading.setVisibility(View.VISIBLE); 99 mPbLoading.setVisibility(View.VISIBLE);
99 // WarplyManager.getMarketPassDetails(mMarketPassDetailsCallback); 100 // WarplyManager.getMarketPassDetails(mMarketPassDetailsCallback);
...@@ -159,6 +160,15 @@ public class MarketPassActivity extends Activity implements View.OnClickListener ...@@ -159,6 +160,15 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
159 } 160 }
160 }); 161 });
161 162
163 + ViewCompat.setAccessibilityDelegate(mLlOpenSM, new AccessibilityDelegateCompat() {
164 + @Override
165 + public void onInitializeAccessibilityNodeInfo(View host, @NonNull AccessibilityNodeInfoCompat info) {
166 + super.onInitializeAccessibilityNodeInfo(host, info);
167 + info.setClassName("android.widget.Button");
168 + info.setContentDescription(getString(R.string.cos_market_pass_details));
169 + }
170 + });
171 +
162 initViews(); 172 initViews();
163 } 173 }
164 174
...@@ -168,6 +178,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener ...@@ -168,6 +178,7 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
168 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "MarketPassScreen"); 178 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "MarketPassScreen");
169 mMapPressed = false; 179 mMapPressed = false;
170 mPassInfoPressed = false; 180 mPassInfoPressed = false;
181 + mOpenSMPressed = false;
171 } 182 }
172 183
173 @Override 184 @Override
...@@ -184,8 +195,8 @@ public class MarketPassActivity extends Activity implements View.OnClickListener ...@@ -184,8 +195,8 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
184 return; 195 return;
185 } 196 }
186 197
187 - WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassInfoScreen"); 198 + WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassMap");
188 - startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.openSupermarketCampaign(MarketPassActivity.this))); 199 + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.openSupermarketMap(MarketPassActivity.this)));
189 } 200 }
190 } 201 }
191 if (view.getId() == R.id.iv_coupons_info) { 202 if (view.getId() == R.id.iv_coupons_info) {
...@@ -202,6 +213,20 @@ public class MarketPassActivity extends Activity implements View.OnClickListener ...@@ -202,6 +213,20 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
202 213
203 Intent intent = new Intent(MarketPassActivity.this, MarketPassInfoActivity.class); 214 Intent intent = new Intent(MarketPassActivity.this, MarketPassInfoActivity.class);
204 startActivity(intent); 215 startActivity(intent);
216 + return;
217 + }
218 + }
219 + if (view.getId() == R.id.ll_total_coupons_value) {
220 + if (!mOpenSMPressed) {
221 + mOpenSMPressed = true;
222 +
223 + if (!WarplyManagerHelper.noInternetDialog(this, true)) {
224 + WarplyManagerHelper.noInternetDialog(this);
225 + return;
226 + }
227 +
228 + WarplyAnalyticsManager.logTrackersEvent(this, "click", "MarketPassMapCampaign");
229 + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.openSupermarketPass(MarketPassActivity.this)));
205 } 230 }
206 } 231 }
207 } 232 }
...@@ -214,21 +239,24 @@ public class MarketPassActivity extends Activity implements View.OnClickListener ...@@ -214,21 +239,24 @@ public class MarketPassActivity extends Activity implements View.OnClickListener
214 mIvBack.setOnClickListener(this); 239 mIvBack.setOnClickListener(this);
215 mIvInfo.setOnClickListener(this); 240 mIvInfo.setOnClickListener(this);
216 mLlMap.setOnClickListener(this); 241 mLlMap.setOnClickListener(this);
242 + mLlOpenSM.setOnClickListener(this);
217 243
218 if (WarplyManagerHelper.getMarketPassDetails() != null) { 244 if (WarplyManagerHelper.getMarketPassDetails() != null) {
219 // if (mMarketPassDetails != null) 245 // if (mMarketPassDetails != null)
220 createBarcodeBitmap(WarplyManagerHelper.getMarketPassDetails().getBarcode()); 246 createBarcodeBitmap(WarplyManagerHelper.getMarketPassDetails().getBarcode());
221 247
222 // if (mMarketPassDetails != null) { 248 // if (mMarketPassDetails != null) {
223 - String passValue = String.format(Locale.US, "%.2f", WarplyManagerHelper.getMarketPassDetails().getTotalDiscount()); 249 +// String passValue = String.format(Locale.US, "%.2f", WarplyManagerHelper.getMarketPassDetails().getTotalDiscount());
224 - String fullText = String.format(getString(R.string.cos_market_pass_coupons_title), passValue); 250 +// String fullText = String.format(getString(R.string.cos_market_pass_coupons_title), passValue);
225 - int startIndex = fullText.indexOf(passValue); 251 +// int startIndex = fullText.indexOf(passValue);
226 - int endIndex = startIndex + passValue.length(); 252 +// int endIndex = startIndex + passValue.length();
227 - SpannableStringBuilder sBuilder = new SpannableStringBuilder(fullText); 253 +// SpannableStringBuilder sBuilder = new SpannableStringBuilder(fullText);
228 - Typeface typefaceBold = ResourcesCompat.getFont(this, R.font.peridot_bold); 254 +// Typeface typefaceBold = ResourcesCompat.getFont(this, R.font.peridot_bold);
229 - CustomTypefaceSpan typefaceBoldSpan = new CustomTypefaceSpan(typefaceBold); 255 +// CustomTypefaceSpan typefaceBoldSpan = new CustomTypefaceSpan(typefaceBold);
230 - sBuilder.setSpan(typefaceBoldSpan, startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); 256 +// sBuilder.setSpan(typefaceBoldSpan, startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
231 - mTvPassCount.setText(sBuilder, TextView.BufferType.SPANNABLE); 257 +// mTvPassCount.setText(sBuilder, TextView.BufferType.SPANNABLE);
258 +
259 + mTvPassCount.setText(R.string.cos_market_pass_details);
232 // } 260 // }
233 261
234 // if (mMarketPassDetails != null) { 262 // 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 openSupermarketPass(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 */
......
...@@ -100,25 +100,26 @@ ...@@ -100,25 +100,26 @@
100 android:textColor="@color/white" 100 android:textColor="@color/white"
101 android:textSize="20sp" /> 101 android:textSize="20sp" />
102 102
103 - <TextView 103 +<!-- <TextView-->
104 - android:id="@+id/tv_market_subtitle" 104 +<!-- android:id="@+id/tv_market_subtitle"-->
105 - android:layout_width="wrap_content" 105 +<!-- android:layout_width="wrap_content"-->
106 - android:layout_height="wrap_content" 106 +<!-- android:layout_height="wrap_content"-->
107 - android:layout_below="@+id/tv_market_header" 107 +<!-- android:layout_below="@+id/tv_market_header"-->
108 - android:layout_marginTop="16dp" 108 +<!-- android:layout_marginTop="16dp"-->
109 - android:letterSpacing="0.04" 109 +<!-- android:letterSpacing="0.04"-->
110 - android:text="@string/cos_market_pass_subtitle" 110 +<!-- android:text="@string/cos_market_pass_subtitle"-->
111 - android:textColor="@color/white" 111 +<!-- android:textColor="@color/white"-->
112 - android:textSize="16sp" 112 +<!-- android:textSize="16sp"-->
113 - app:lineHeight="22dp" /> 113 +<!-- app:lineHeight="22dp" />-->
114 - 114 +
115 + <!-- android:layout_marginTop="42dp"-->
115 <LinearLayout 116 <LinearLayout
116 android:id="@+id/ll_barcode" 117 android:id="@+id/ll_barcode"
117 android:layout_width="match_parent" 118 android:layout_width="match_parent"
118 android:layout_height="wrap_content" 119 android:layout_height="wrap_content"
119 - android:layout_below="@+id/tv_market_subtitle" 120 + android:layout_below="@+id/tv_market_header"
120 - android:layout_marginTop="42dp" 121 + android:layout_marginBottom="18dp"
121 - android:layout_marginBottom="36dp" 122 + android:layout_marginTop="16dp"
122 android:background="@drawable/background_white_grey_border" 123 android:background="@drawable/background_white_grey_border"
123 android:gravity="center" 124 android:gravity="center"
124 android:orientation="vertical" 125 android:orientation="vertical"
...@@ -137,11 +138,12 @@ ...@@ -137,11 +138,12 @@
137 android:id="@+id/tv_barcode_value" 138 android:id="@+id/tv_barcode_value"
138 android:layout_width="wrap_content" 139 android:layout_width="wrap_content"
139 android:layout_height="wrap_content" 140 android:layout_height="wrap_content"
140 - android:layout_marginTop="10dp" 141 + android:layout_marginTop="6dp"
141 android:layout_marginBottom="2dp" 142 android:layout_marginBottom="2dp"
142 android:letterSpacing="0.00074" 143 android:letterSpacing="0.00074"
144 + android:textIsSelectable="true"
143 android:textColor="@color/cos_light_black" 145 android:textColor="@color/cos_light_black"
144 - android:textSize="18sp" /> 146 + android:textSize="19sp" />
145 </LinearLayout> 147 </LinearLayout>
146 </RelativeLayout> 148 </RelativeLayout>
147 149
...@@ -161,7 +163,7 @@ ...@@ -161,7 +163,7 @@
161 android:includeFontPadding="false" 163 android:includeFontPadding="false"
162 android:letterSpacing="0.04" 164 android:letterSpacing="0.04"
163 android:textColor="@color/white" 165 android:textColor="@color/white"
164 - android:textSize="16sp" 166 + android:textSize="14sp"
165 android:paddingHorizontal="24dp" 167 android:paddingHorizontal="24dp"
166 app:lineHeight="22dp" /> 168 app:lineHeight="22dp" />
167 </LinearLayout> 169 </LinearLayout>
...@@ -174,11 +176,11 @@ ...@@ -174,11 +176,11 @@
174 android:orientation="horizontal" 176 android:orientation="horizontal"
175 android:paddingVertical="24dp"> 177 android:paddingVertical="24dp">
176 178
179 + <!-- android:gravity="center"-->
177 <LinearLayout 180 <LinearLayout
178 android:id="@+id/ll_sm_logos" 181 android:id="@+id/ll_sm_logos"
179 android:layout_width="0dp" 182 android:layout_width="0dp"
180 android:layout_height="0dp" 183 android:layout_height="0dp"
181 - android:gravity="center"
182 android:orientation="horizontal" 184 android:orientation="horizontal"
183 app:layout_constraintBottom_toBottomOf="parent" 185 app:layout_constraintBottom_toBottomOf="parent"
184 app:layout_constraintEnd_toStartOf="@+id/ll_map" 186 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>
......