Showing
8 changed files
with
39 additions
and
28 deletions
| 1 | apply plugin: 'com.android.application' | 1 | apply plugin: 'com.android.application' |
| 2 | //apply plugin: 'com.google.gms.google-services' | 2 | //apply plugin: 'com.google.gms.google-services' |
| 3 | -//apply plugin: 'com.huawei.agconnect' | 3 | +apply plugin: 'com.huawei.agconnect' |
| 4 | 4 | ||
| 5 | android { | 5 | android { |
| 6 | compileSdkVersion 34 | 6 | compileSdkVersion 34 | ... | ... |
| ... | @@ -18,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView; | ... | @@ -18,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView; |
| 18 | 18 | ||
| 19 | import org.greenrobot.eventbus.EventBus; | 19 | import org.greenrobot.eventbus.EventBus; |
| 20 | import org.greenrobot.eventbus.Subscribe; | 20 | import org.greenrobot.eventbus.Subscribe; |
| 21 | +import org.greenrobot.eventbus.ThreadMode; | ||
| 21 | import org.json.JSONArray; | 22 | import org.json.JSONArray; |
| 22 | import org.json.JSONObject; | 23 | import org.json.JSONObject; |
| 23 | 24 | ||
| ... | @@ -139,11 +140,14 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli | ... | @@ -139,11 +140,14 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli |
| 139 | EventBus.getDefault().unregister(this); | 140 | EventBus.getDefault().unregister(this); |
| 140 | } | 141 | } |
| 141 | 142 | ||
| 142 | - @Subscribe() | 143 | + @Subscribe(threadMode = ThreadMode.ASYNC) |
| 143 | public void onMessageEvent(WarplyEventBusManager event) { | 144 | public void onMessageEvent(WarplyEventBusManager event) { |
| 144 | if (event.getRefreshUnifiedCouponsAdded() != null || event.getRefreshVouchersEventModel() != null) { | 145 | if (event.getRefreshUnifiedCouponsAdded() != null || event.getRefreshVouchersEventModel() != null) { |
| 145 | - mPbLoading.setVisibility(View.VISIBLE); | 146 | + Handler mUIHandler = new Handler(Looper.getMainLooper()); |
| 146 | - WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback); | 147 | + mUIHandler.post(() -> { |
| 148 | + mPbLoading.setVisibility(View.VISIBLE); | ||
| 149 | + WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback); | ||
| 150 | + }); | ||
| 147 | } | 151 | } |
| 148 | } | 152 | } |
| 149 | 153 | ... | ... |
| ... | @@ -2,7 +2,6 @@ package ly.warp.sdk.activities; | ... | @@ -2,7 +2,6 @@ package ly.warp.sdk.activities; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.content.Context; | 4 | import android.content.Context; |
| 5 | -import android.content.DialogInterface; | ||
| 6 | import android.content.Intent; | 5 | import android.content.Intent; |
| 7 | import android.graphics.Bitmap; | 6 | import android.graphics.Bitmap; |
| 8 | import android.graphics.Color; | 7 | import android.graphics.Color; |
| ... | @@ -376,8 +375,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -376,8 +375,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
| 376 | ConstraintLayout buyButton = (ConstraintLayout) v.findViewById(R.id.cl_button_sm_buy_it); | 375 | ConstraintLayout buyButton = (ConstraintLayout) v.findViewById(R.id.cl_button_sm_buy_it); |
| 377 | buyButton.setOnClickListener(view -> { | 376 | buyButton.setOnClickListener(view -> { |
| 378 | bottomSheetDialog.dismiss(); | 377 | bottomSheetDialog.dismiss(); |
| 379 | - if (!TextUtils.isEmpty(finalProductUrl)) | 378 | + if (!TextUtils.isEmpty(finalProductUrl)) { |
| 380 | - startActivity(WarpViewActivity.createIntentFromURL(this, finalProductUrl)); | 379 | + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(finalProductUrl)); |
| 380 | + startActivity(browserIntent); | ||
| 381 | + } | ||
| 381 | }); | 382 | }); |
| 382 | 383 | ||
| 383 | parent.addView(v, tempIndex, new ViewGroup.LayoutParams( | 384 | parent.addView(v, tempIndex, new ViewGroup.LayoutParams( |
| ... | @@ -418,7 +419,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -418,7 +419,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
| 418 | if (mIsUnified) { | 419 | if (mIsUnified) { |
| 419 | mTvCouponSubtitle.setText(HtmlCompat.fromHtml(mCoupon.getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT)); | 420 | mTvCouponSubtitle.setText(HtmlCompat.fromHtml(mCoupon.getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT)); |
| 420 | } else { | 421 | } else { |
| 421 | - mTvCouponSubtitle.setText(mCoupon.getCouponsetDetails().getShortDescription()); | 422 | + if (mIsActiveUnified) |
| 423 | + mTvCouponSubtitle.setText(HtmlCompat.fromHtml(mCoupon.getCouponsetDetails().getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT)); | ||
| 424 | + else | ||
| 425 | + mTvCouponSubtitle.setText(mCoupon.getCouponsetDetails().getShortDescription()); | ||
| 422 | } | 426 | } |
| 423 | mTvTermsValue.setText(HtmlCompat.fromHtml(mCoupon.getCouponsetDetails().getTerms(), HtmlCompat.FROM_HTML_MODE_COMPACT)); | 427 | mTvTermsValue.setText(HtmlCompat.fromHtml(mCoupon.getCouponsetDetails().getTerms(), HtmlCompat.FROM_HTML_MODE_COMPACT)); |
| 424 | mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance()); | 428 | mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance()); | ... | ... |
| ... | @@ -5,6 +5,7 @@ import android.content.Context; | ... | @@ -5,6 +5,7 @@ import android.content.Context; |
| 5 | import android.content.Intent; | 5 | import android.content.Intent; |
| 6 | import android.graphics.Bitmap; | 6 | import android.graphics.Bitmap; |
| 7 | import android.graphics.Color; | 7 | import android.graphics.Color; |
| 8 | +import android.net.Uri; | ||
| 8 | import android.os.Bundle; | 9 | import android.os.Bundle; |
| 9 | import android.text.TextUtils; | 10 | import android.text.TextUtils; |
| 10 | import android.view.LayoutInflater; | 11 | import android.view.LayoutInflater; |
| ... | @@ -43,7 +44,6 @@ import ly.warp.sdk.R; | ... | @@ -43,7 +44,6 @@ import ly.warp.sdk.R; |
| 43 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 44 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
| 44 | import ly.warp.sdk.io.models.Coupon; | 45 | import ly.warp.sdk.io.models.Coupon; |
| 45 | import ly.warp.sdk.io.models.CouponList; | 46 | import ly.warp.sdk.io.models.CouponList; |
| 46 | -import ly.warp.sdk.io.models.Merchant; | ||
| 47 | import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel; | 47 | import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel; |
| 48 | import ly.warp.sdk.io.models.UnifiedCoupon; | 48 | import ly.warp.sdk.io.models.UnifiedCoupon; |
| 49 | import ly.warp.sdk.utils.WarpUtils; | 49 | import ly.warp.sdk.utils.WarpUtils; |
| ... | @@ -290,7 +290,8 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -290,7 +290,8 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL |
| 290 | ConstraintLayout buyButton = (ConstraintLayout) v.findViewById(R.id.cl_button_sm_buy_it); | 290 | ConstraintLayout buyButton = (ConstraintLayout) v.findViewById(R.id.cl_button_sm_buy_it); |
| 291 | buyButton.setOnClickListener(view -> { | 291 | buyButton.setOnClickListener(view -> { |
| 292 | bottomSheetDialog.dismiss(); | 292 | bottomSheetDialog.dismiss(); |
| 293 | - startActivity(WarpViewActivity.createIntentFromURL(this, finalMerchantUrl)); | 293 | + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(finalMerchantUrl)); |
| 294 | + startActivity(browserIntent); | ||
| 294 | }); | 295 | }); |
| 295 | 296 | ||
| 296 | parent.addView(v, tempIndex, new ViewGroup.LayoutParams( | 297 | parent.addView(v, tempIndex, new ViewGroup.LayoutParams( | ... | ... |
| ... | @@ -122,7 +122,8 @@ public class WarpViewActivity extends WarpBaseActivity { | ... | @@ -122,7 +122,8 @@ public class WarpViewActivity extends WarpBaseActivity { |
| 122 | protected void onStart() { | 122 | protected void onStart() { |
| 123 | super.onStart(); | 123 | super.onStart(); |
| 124 | WarplySessionManager.onStartActivity(this); | 124 | WarplySessionManager.onStartActivity(this); |
| 125 | - EventBus.getDefault().register(this); | 125 | + if (!EventBus.getDefault().isRegistered(this)) |
| 126 | + EventBus.getDefault().register(this); | ||
| 126 | 127 | ||
| 127 | if (mWarpView != null) { | 128 | if (mWarpView != null) { |
| 128 | if (getWebviewSupermarket()) { | 129 | if (getWebviewSupermarket()) { |
| ... | @@ -249,22 +250,22 @@ public class WarpViewActivity extends WarpBaseActivity { | ... | @@ -249,22 +250,22 @@ public class WarpViewActivity extends WarpBaseActivity { |
| 249 | // } | 250 | // } |
| 250 | // } | 251 | // } |
| 251 | // } else { | 252 | // } else { |
| 252 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | 253 | + if (!isMyServiceRunning(WarplyHealthService.class)) { |
| 253 | - LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); | 254 | + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); |
| 254 | - analyticsEvent.setEventName("loyalty_steps_activation"); | 255 | + analyticsEvent.setEventName("loyalty_steps_activation"); |
| 255 | - EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | 256 | + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); |
| 256 | - | 257 | + |
| 257 | - Intent stepsServiceIntent = new Intent(this, WarplyHealthService.class); | 258 | + Intent stepsServiceIntent = new Intent(this, WarplyHealthService.class); |
| 258 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 259 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| 259 | - startForegroundService(stepsServiceIntent); | 260 | + startForegroundService(stepsServiceIntent); |
| 260 | - } else { | 261 | + } else { |
| 261 | - startService(stepsServiceIntent); | 262 | + startService(stepsServiceIntent); |
| 262 | - } | ||
| 263 | - | ||
| 264 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | ||
| 265 | - pacingVisible.setVisible(true); | ||
| 266 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | ||
| 267 | } | 263 | } |
| 264 | + | ||
| 265 | + WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | ||
| 266 | + pacingVisible.setVisible(true); | ||
| 267 | + EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | ||
| 268 | + } | ||
| 268 | // } | 269 | // } |
| 269 | } else { | 270 | } else { |
| 270 | WarpUtils.setIsStepsManuallyStopped(this, true); | 271 | WarpUtils.setIsStepsManuallyStopped(this, true); | ... | ... |
| ... | @@ -227,6 +227,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip | ... | @@ -227,6 +227,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip |
| 227 | mEtGuid.setVisibility(View.GONE); | 227 | mEtGuid.setVisibility(View.GONE); |
| 228 | mLlAuthLogout.setVisibility(View.VISIBLE); | 228 | mLlAuthLogout.setVisibility(View.VISIBLE); |
| 229 | mTvUser.setVisibility(View.VISIBLE); | 229 | mTvUser.setVisibility(View.VISIBLE); |
| 230 | + mTvUser.setText(mEtGuid.getText().toString()); | ||
| 230 | // if (WarplyManagerHelper.getConsumerInternal() != null) { | 231 | // if (WarplyManagerHelper.getConsumerInternal() != null) { |
| 231 | // JSONObject profMetadata = WarpJSONParser.getJSONFromString(WarplyManagerHelper.getConsumerInternal().getProfileMetadata()); | 232 | // JSONObject profMetadata = WarpJSONParser.getJSONFromString(WarplyManagerHelper.getConsumerInternal().getProfileMetadata()); |
| 232 | // if (profMetadata != null && profMetadata.has("guid")) { | 233 | // if (profMetadata != null && profMetadata.has("guid")) { | ... | ... |
| ... | @@ -204,7 +204,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -204,7 +204,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
| 204 | // RequestOptions | 204 | // RequestOptions |
| 205 | // .placeholderOf(R.drawable.ic_default_contact_photo) | 205 | // .placeholderOf(R.drawable.ic_default_contact_photo) |
| 206 | // .error(R.drawable.ic_default_contact_photo)) | 206 | // .error(R.drawable.ic_default_contact_photo)) |
| 207 | - .load(merchant.getImgPreview()) | 207 | + .load(couponItem.getCouponsetDetails().getImgPreview()) |
| 208 | .diskCacheStrategy(DiskCacheStrategy.DATA) | 208 | .diskCacheStrategy(DiskCacheStrategy.DATA) |
| 209 | .into(holder.ivCouponLogo); | 209 | .into(holder.ivCouponLogo); |
| 210 | } else { | 210 | } else { | ... | ... |
| ... | @@ -228,7 +228,7 @@ | ... | @@ -228,7 +228,7 @@ |
| 228 | <string name="lbl_telematics_generic_error">Άγνωστο σφάλμα</string> | 228 | <string name="lbl_telematics_generic_error">Άγνωστο σφάλμα</string> |
| 229 | <string name="cos_cancel_unified_coupon">Ακύρωση ενιαίου κουπονιού</string> | 229 | <string name="cos_cancel_unified_coupon">Ακύρωση ενιαίου κουπονιού</string> |
| 230 | <string name="cos_dlg_cancel_unified_coupon_success_title">Ακύρωση Κουπονιού</string> | 230 | <string name="cos_dlg_cancel_unified_coupon_success_title">Ακύρωση Κουπονιού</string> |
| 231 | - <string name="cos_dlg_cancel_unified_coupon_success_subtitle">Το ενιαίο κουπόνι σου ακυρώθηκε επιτυχώς. Βρες τα μεμονωμένα κουπόνια στο καλάθι SUPERMARKET DEALS.</string> | 231 | + <string name="cos_dlg_cancel_unified_coupon_success_subtitle">Το ενιαίο κουπόνι σου ακυρώθηκε επιτυχώς. Βρες τα μεμονωμένα κουπόνια στο My Rewards.</string> |
| 232 | <string name="cos_dlg_cancel_unified_coupon_success_subtitle2">Είσαι σίγουρος ότι θέλεις να ακυρώσεις το κουπόνι σου;</string> | 232 | <string name="cos_dlg_cancel_unified_coupon_success_subtitle2">Είσαι σίγουρος ότι θέλεις να ακυρώσεις το κουπόνι σου;</string> |
| 233 | <string name="cos_dlg_negative_button4">Όχι</string> | 233 | <string name="cos_dlg_negative_button4">Όχι</string> |
| 234 | <string name="cos_dlg_positive_button3">Ναι</string> | 234 | <string name="cos_dlg_positive_button3">Ναι</string> | ... | ... |
-
Please register or login to post a comment