Panagiotis Triantafyllou

minor fixes

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4r17'
PUBLISH_VERSION = '4.5.5.4r18'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -4,6 +4,8 @@ import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
......@@ -11,6 +13,9 @@ import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -23,6 +28,7 @@ import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
......@@ -60,6 +66,27 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
}
@Override
public void onStart() {
super.onStart();
if (!EventBus.getDefault().isRegistered(this))
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe()
public void onMessageEvent(WarplyEventBusManager event) {
if (event.getCouponsChanged() != null) {
Handler mUIHandler = new Handler(Looper.getMainLooper());
mUIHandler.post(this::filterItems);
}
}
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent(this, "screen", "ActiveCouponsScreen");
......
......@@ -27,6 +27,8 @@ import com.google.zxing.BarcodeFormat;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.oned.EAN13Writer;
import org.greenrobot.eventbus.EventBus;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -36,9 +38,11 @@ import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
import ly.warp.sdk.services.EventCouponsService;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
public class CouponInfoActivity extends Activity implements View.OnClickListener {
......@@ -131,6 +135,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
if (resultCode == RESULT_OK) {
OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCouponsService.class).build();
WorkManager.getInstance(this).enqueue(mywork);
// WarplyCouponsChangedEventModel couponsChanged = new WarplyCouponsChangedEventModel();
// couponsChanged.setChanged(true);
// EventBus.getDefault().post(new WarplyEventBusManager(couponsChanged));
onBackPressed();
}
}
......