Panagiotis Triantafyllou

feedback fixes fixes

apply plugin: 'com.android.application'
//apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.huawei.agconnect'
apply plugin: 'com.huawei.agconnect'
android {
compileSdkVersion 34
......
......@@ -18,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONArray;
import org.json.JSONObject;
......@@ -139,11 +140,14 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
EventBus.getDefault().unregister(this);
}
@Subscribe()
@Subscribe(threadMode = ThreadMode.ASYNC)
public void onMessageEvent(WarplyEventBusManager event) {
if (event.getRefreshUnifiedCouponsAdded() != null || event.getRefreshVouchersEventModel() != null) {
mPbLoading.setVisibility(View.VISIBLE);
WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback);
Handler mUIHandler = new Handler(Looper.getMainLooper());
mUIHandler.post(() -> {
mPbLoading.setVisibility(View.VISIBLE);
WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback);
});
}
}
......
......@@ -2,7 +2,6 @@ package ly.warp.sdk.activities;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
......@@ -376,8 +375,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
ConstraintLayout buyButton = (ConstraintLayout) v.findViewById(R.id.cl_button_sm_buy_it);
buyButton.setOnClickListener(view -> {
bottomSheetDialog.dismiss();
if (!TextUtils.isEmpty(finalProductUrl))
startActivity(WarpViewActivity.createIntentFromURL(this, finalProductUrl));
if (!TextUtils.isEmpty(finalProductUrl)) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(finalProductUrl));
startActivity(browserIntent);
}
});
parent.addView(v, tempIndex, new ViewGroup.LayoutParams(
......@@ -418,7 +419,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
if (mIsUnified) {
mTvCouponSubtitle.setText(HtmlCompat.fromHtml(mCoupon.getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT));
} else {
mTvCouponSubtitle.setText(mCoupon.getCouponsetDetails().getShortDescription());
if (mIsActiveUnified)
mTvCouponSubtitle.setText(HtmlCompat.fromHtml(mCoupon.getCouponsetDetails().getDescription(), HtmlCompat.FROM_HTML_MODE_COMPACT));
else
mTvCouponSubtitle.setText(mCoupon.getCouponsetDetails().getShortDescription());
}
mTvTermsValue.setText(HtmlCompat.fromHtml(mCoupon.getCouponsetDetails().getTerms(), HtmlCompat.FROM_HTML_MODE_COMPACT));
mTvTermsValue.setMovementMethod(LinkMovementMethod.getInstance());
......
......@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
......@@ -43,7 +44,6 @@ import ly.warp.sdk.R;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Merchant;
import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.utils.WarpUtils;
......@@ -290,7 +290,8 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
ConstraintLayout buyButton = (ConstraintLayout) v.findViewById(R.id.cl_button_sm_buy_it);
buyButton.setOnClickListener(view -> {
bottomSheetDialog.dismiss();
startActivity(WarpViewActivity.createIntentFromURL(this, finalMerchantUrl));
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(finalMerchantUrl));
startActivity(browserIntent);
});
parent.addView(v, tempIndex, new ViewGroup.LayoutParams(
......
......@@ -122,7 +122,8 @@ public class WarpViewActivity extends WarpBaseActivity {
protected void onStart() {
super.onStart();
WarplySessionManager.onStartActivity(this);
EventBus.getDefault().register(this);
if (!EventBus.getDefault().isRegistered(this))
EventBus.getDefault().register(this);
if (mWarpView != null) {
if (getWebviewSupermarket()) {
......@@ -249,22 +250,22 @@ public class WarpViewActivity extends WarpBaseActivity {
// }
// }
// } else {
if (!isMyServiceRunning(WarplyHealthService.class)) {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("loyalty_steps_activation");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent stepsServiceIntent = new Intent(this, WarplyHealthService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(stepsServiceIntent);
} else {
startService(stepsServiceIntent);
}
WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel();
pacingVisible.setVisible(true);
EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible));
if (!isMyServiceRunning(WarplyHealthService.class)) {
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("loyalty_steps_activation");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent stepsServiceIntent = new Intent(this, WarplyHealthService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(stepsServiceIntent);
} else {
startService(stepsServiceIntent);
}
WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel();
pacingVisible.setVisible(true);
EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible));
}
// }
} else {
WarpUtils.setIsStepsManuallyStopped(this, true);
......
......@@ -227,6 +227,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
mEtGuid.setVisibility(View.GONE);
mLlAuthLogout.setVisibility(View.VISIBLE);
mTvUser.setVisibility(View.VISIBLE);
mTvUser.setText(mEtGuid.getText().toString());
// if (WarplyManagerHelper.getConsumerInternal() != null) {
// JSONObject profMetadata = WarpJSONParser.getJSONFromString(WarplyManagerHelper.getConsumerInternal().getProfileMetadata());
// if (profMetadata != null && profMetadata.has("guid")) {
......
......@@ -204,7 +204,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
// RequestOptions
// .placeholderOf(R.drawable.ic_default_contact_photo)
// .error(R.drawable.ic_default_contact_photo))
.load(merchant.getImgPreview())
.load(couponItem.getCouponsetDetails().getImgPreview())
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(holder.ivCouponLogo);
} else {
......
......@@ -228,7 +228,7 @@
<string name="lbl_telematics_generic_error">Άγνωστο σφάλμα</string>
<string name="cos_cancel_unified_coupon">Ακύρωση ενιαίου κουπονιού</string>
<string name="cos_dlg_cancel_unified_coupon_success_title">Ακύρωση Κουπονιού</string>
<string name="cos_dlg_cancel_unified_coupon_success_subtitle">Το ενιαίο κουπόνι σου ακυρώθηκε επιτυχώς. Βρες τα μεμονωμένα κουπόνια στο καλάθι SUPERMARKET DEALS.</string>
<string name="cos_dlg_cancel_unified_coupon_success_subtitle">Το ενιαίο κουπόνι σου ακυρώθηκε επιτυχώς. Βρες τα μεμονωμένα κουπόνια στο My Rewards.</string>
<string name="cos_dlg_cancel_unified_coupon_success_subtitle2">Είσαι σίγουρος ότι θέλεις να ακυρώσεις το κουπόνι σου;</string>
<string name="cos_dlg_negative_button4">Όχι</string>
<string name="cos_dlg_positive_button3">Ναι</string>
......