Panagiotis Triantafyllou

sm deals fixes

...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
2 2
3 ext { 3 ext {
4 PUBLISH_GROUP_ID = 'ly.warp' 4 PUBLISH_GROUP_ID = 'ly.warp'
5 - PUBLISH_VERSION = '4.5.4.6rc78' 5 + PUBLISH_VERSION = '4.5.4.6rc79'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -46,7 +46,6 @@ import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan; ...@@ -46,7 +46,6 @@ import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan;
46 import io.github.inflationx.calligraphy3.TypefaceUtils; 46 import io.github.inflationx.calligraphy3.TypefaceUtils;
47 import io.github.inflationx.viewpump.ViewPumpContextWrapper; 47 import io.github.inflationx.viewpump.ViewPumpContextWrapper;
48 import ly.warp.sdk.R; 48 import ly.warp.sdk.R;
49 -import ly.warp.sdk.io.callbacks.CallbackReceiver;
50 import ly.warp.sdk.io.models.ActiveDFYCouponEventModel; 49 import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
51 import ly.warp.sdk.io.models.ActiveDFYCouponModel; 50 import ly.warp.sdk.io.models.ActiveDFYCouponModel;
52 import ly.warp.sdk.io.models.Coupon; 51 import ly.warp.sdk.io.models.Coupon;
...@@ -59,7 +58,6 @@ import ly.warp.sdk.utils.WarpUtils; ...@@ -59,7 +58,6 @@ import ly.warp.sdk.utils.WarpUtils;
59 import ly.warp.sdk.utils.WarplyManagerHelper; 58 import ly.warp.sdk.utils.WarplyManagerHelper;
60 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; 59 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
61 import ly.warp.sdk.utils.managers.WarplyEventBusManager; 60 import ly.warp.sdk.utils.managers.WarplyEventBusManager;
62 -import ly.warp.sdk.utils.managers.WarplyManager;
63 import ly.warp.sdk.views.adapters.ActiveCouponAdapter; 61 import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
64 import ly.warp.sdk.views.adapters.MarketCouponAdapter; 62 import ly.warp.sdk.views.adapters.MarketCouponAdapter;
65 63
...@@ -170,25 +168,25 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -170,25 +168,25 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
170 mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); 168 mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
171 169
172 initViews(); 170 initViews();
173 -
174 -// WarplyManager.getUnifiedCoupons(mUnifiedCallback);
175 } 171 }
176 172
177 @Override 173 @Override
178 protected void onStart() { 174 protected void onStart() {
179 super.onStart(); 175 super.onStart();
180 - EventBus.getDefault().register(this); 176 + if (!EventBus.getDefault().isRegistered(this))
177 + EventBus.getDefault().register(this);
181 } 178 }
182 179
183 @Override 180 @Override
184 protected void onStop() { 181 protected void onStop() {
185 super.onStop(); 182 super.onStop();
186 - EventBus.getDefault().unregister(this); 183 +// EventBus.getDefault().unregister(this);
187 } 184 }
188 185
189 @Override 186 @Override
190 public void onDestroy() { 187 public void onDestroy() {
191 super.onDestroy(); 188 super.onDestroy();
189 + EventBus.getDefault().unregister(this);
192 } 190 }
193 191
194 @Override 192 @Override
...@@ -816,19 +814,6 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -816,19 +814,6 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
816 } 814 }
817 } 815 }
818 816
819 - private final CallbackReceiver<ArrayList<UnifiedCoupon>> mUnifiedCallback = new CallbackReceiver<ArrayList<UnifiedCoupon>>() {
820 - @Override
821 - public void onSuccess(ArrayList<UnifiedCoupon> result) {
822 - mUnifiedCoupons = result;
823 - initViews();
824 - }
825 -
826 - @Override
827 - public void onFailure(int errorCode) {
828 - initViews();
829 - }
830 - };
831 -
832 // =========================================================== 817 // ===========================================================
833 // Inner and Anonymous Classes 818 // Inner and Anonymous Classes
834 // =========================================================== 819 // ===========================================================
......
...@@ -341,9 +341,9 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL ...@@ -341,9 +341,9 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
341 .setTitle(R.string.cos_dlg_cancel_unified_coupon_success_title) 341 .setTitle(R.string.cos_dlg_cancel_unified_coupon_success_title)
342 .setMessage(R.string.cos_dlg_cancel_unified_coupon_success_subtitle) 342 .setMessage(R.string.cos_dlg_cancel_unified_coupon_success_subtitle)
343 .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 343 .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
344 - dialogPositive.dismiss();
345 RefreshUnifiedCouponsEventModel couponsRefreshed = new RefreshUnifiedCouponsEventModel(); 344 RefreshUnifiedCouponsEventModel couponsRefreshed = new RefreshUnifiedCouponsEventModel();
346 EventBus.getDefault().post(new WarplyEventBusManager(couponsRefreshed)); 345 EventBus.getDefault().post(new WarplyEventBusManager(couponsRefreshed));
346 + dialogPositive.dismiss();
347 onBackPressed(); 347 onBackPressed();
348 }) 348 })
349 .setCancelable(false) 349 .setCancelable(false)
......
...@@ -2148,10 +2148,9 @@ public class WarplyManager { ...@@ -2148,10 +2148,9 @@ public class WarplyManager {
2148 if (tempUni.getStatus().trim().equals("active")) 2148 if (tempUni.getStatus().trim().equals("active"))
2149 couponList.add(tempUni); 2149 couponList.add(tempUni);
2150 } 2150 }
2151 -
2152 - WarplyManagerHelper.setMarketCoupons(allCouponList);
2153 - WarplyManagerHelper.setMarketCouponsList(couponList);
2154 } 2151 }
2152 + WarplyManagerHelper.setMarketCoupons(allCouponList);
2153 + WarplyManagerHelper.setMarketCouponsList(couponList);
2155 } 2154 }
2156 } catch (Exception e) { 2155 } catch (Exception e) {
2157 e.printStackTrace(); 2156 e.printStackTrace();
......