Panagiotis Triantafyllou

latest changes and fixes

...@@ -52,7 +52,12 @@ ...@@ -52,7 +52,12 @@
52 android:screenOrientation="portrait" /> 52 android:screenOrientation="portrait" />
53 53
54 <activity 54 <activity
55 - android:name="ly.warp.sdk.activities.ListForYouActivity" 55 + android:name="ly.warp.sdk.activities.GiftsForYouActivity"
56 + android:exported="false"
57 + android:screenOrientation="portrait" />
58 +
59 + <activity
60 + android:name="ly.warp.sdk.activities.MoreForYouActivity"
56 android:exported="false" 61 android:exported="false"
57 android:screenOrientation="portrait" /> 62 android:screenOrientation="portrait" />
58 63
......
...@@ -21,7 +21,6 @@ import java.util.HashMap; ...@@ -21,7 +21,6 @@ import java.util.HashMap;
21 21
22 import ly.warp.sdk.R; 22 import ly.warp.sdk.R;
23 import ly.warp.sdk.Warply; 23 import ly.warp.sdk.Warply;
24 -import ly.warp.sdk.db.WarplyDBHelper;
25 import ly.warp.sdk.fragments.HomeFragment; 24 import ly.warp.sdk.fragments.HomeFragment;
26 import ly.warp.sdk.fragments.LoyaltyFragment; 25 import ly.warp.sdk.fragments.LoyaltyFragment;
27 import ly.warp.sdk.io.callbacks.CallbackReceiver; 26 import ly.warp.sdk.io.callbacks.CallbackReceiver;
...@@ -36,7 +35,6 @@ import ly.warp.sdk.io.request.WarplyConsumerRequest; ...@@ -36,7 +35,6 @@ import ly.warp.sdk.io.request.WarplyConsumerRequest;
36 import ly.warp.sdk.io.request.WarplyGetCouponsetsRequest; 35 import ly.warp.sdk.io.request.WarplyGetCouponsetsRequest;
37 import ly.warp.sdk.io.request.WarplyInboxRequest; 36 import ly.warp.sdk.io.request.WarplyInboxRequest;
38 import ly.warp.sdk.io.request.WarplyUserCouponsRequest; 37 import ly.warp.sdk.io.request.WarplyUserCouponsRequest;
39 -import ly.warp.sdk.utils.WarpUtils;
40 import ly.warp.sdk.utils.WarplyManagerHelper; 38 import ly.warp.sdk.utils.WarplyManagerHelper;
41 import ly.warp.sdk.utils.WarplyProperty; 39 import ly.warp.sdk.utils.WarplyProperty;
42 import ly.warp.sdk.utils.managers.WarplyManager; 40 import ly.warp.sdk.utils.managers.WarplyManager;
...@@ -147,14 +145,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation ...@@ -147,14 +145,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
147 mLlRedeem.setOnClickListener(view -> { 145 mLlRedeem.setOnClickListener(view -> {
148 if (mUniqueCampaignList != null && !mUniqueCampaignList.isEmpty()) { 146 if (mUniqueCampaignList != null && !mUniqueCampaignList.isEmpty()) {
149 if (mUniqueCampaignList.containsKey("lucky_draw") && mUniqueCampaignList.get("lucky_draw").size() > 0) { 147 if (mUniqueCampaignList.containsKey("lucky_draw") && mUniqueCampaignList.get("lucky_draw").size() > 0) {
150 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(mUniqueCampaignList.get("lucky_draw").get(0)); 148 + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(mUniqueCampaignList.get("lucky_draw").get(0))));
151 -
152 - if (mConsumer != null)
153 - tempUrl = tempUrl + "&auth_token=" + (mConsumer.getUuid());
154 - else
155 - tempUrl = tempUrl + "&auth_token=";
156 -
157 - startActivity(WarpViewActivity.createIntentFromURL(this, tempUrl));
158 dialog.dismiss(); 149 dialog.dismiss();
159 } 150 }
160 } 151 }
......
...@@ -67,14 +67,7 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene ...@@ -67,14 +67,7 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
67 protected void onNewIntent(Intent intent) { 67 protected void onNewIntent(Intent intent) {
68 super.onNewIntent(intent); 68 super.onNewIntent(intent);
69 if (intent.hasExtra("channel")) { 69 if (intent.hasExtra("channel")) {
70 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(WarplyManagerHelper.getUniqueCampaignList().get("lucky_draw").get(0)); 70 + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(WarplyManagerHelper.getUniqueCampaignList().get("lucky_draw").get(0))));
71 -
72 - if (WarplyManagerHelper.getConsumer() != null)
73 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
74 - else
75 - tempUrl = tempUrl + "&auth_token=";
76 -
77 - startActivity(WarpViewActivity.createIntentFromURL(this, tempUrl));
78 } 71 }
79 } 72 }
80 73
...@@ -168,14 +161,7 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene ...@@ -168,14 +161,7 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
168 mClLuckyDraw.setOnClickListener(view -> { 161 mClLuckyDraw.setOnClickListener(view -> {
169 if (WarplyManagerHelper.getUniqueCampaignList() != null && !WarplyManagerHelper.getUniqueCampaignList().isEmpty()) { 162 if (WarplyManagerHelper.getUniqueCampaignList() != null && !WarplyManagerHelper.getUniqueCampaignList().isEmpty()) {
170 if (WarplyManagerHelper.getUniqueCampaignList().containsKey("lucky_draw") && WarplyManagerHelper.getUniqueCampaignList().get("lucky_draw").size() > 0) { 163 if (WarplyManagerHelper.getUniqueCampaignList().containsKey("lucky_draw") && WarplyManagerHelper.getUniqueCampaignList().get("lucky_draw").size() > 0) {
171 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(WarplyManagerHelper.getUniqueCampaignList().get("lucky_draw").get(0)); 164 + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(WarplyManagerHelper.getUniqueCampaignList().get("lucky_draw").get(0))));
172 -
173 - if (WarplyManagerHelper.getConsumer() != null)
174 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
175 - else
176 - tempUrl = tempUrl + "&auth_token=";
177 -
178 - startActivity(WarpViewActivity.createIntentFromURL(this, tempUrl));
179 dialog.dismiss(); 165 dialog.dismiss();
180 } 166 }
181 } 167 }
......
...@@ -19,6 +19,7 @@ import org.json.JSONObject; ...@@ -19,6 +19,7 @@ import org.json.JSONObject;
19 19
20 import ly.warp.sdk.R; 20 import ly.warp.sdk.R;
21 import ly.warp.sdk.io.callbacks.CallbackReceiver; 21 import ly.warp.sdk.io.callbacks.CallbackReceiver;
22 +import ly.warp.sdk.io.models.Coupon;
22 import ly.warp.sdk.io.models.Couponset; 23 import ly.warp.sdk.io.models.Couponset;
23 import ly.warp.sdk.io.request.WarplyRedeemCouponRequest; 24 import ly.warp.sdk.io.request.WarplyRedeemCouponRequest;
24 import ly.warp.sdk.utils.managers.WarplyManager; 25 import ly.warp.sdk.utils.managers.WarplyManager;
...@@ -39,6 +40,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -39,6 +40,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
39 private Couponset mCouponset; 40 private Couponset mCouponset;
40 private LinearLayout mLlRedeem; 41 private LinearLayout mLlRedeem;
41 private ProgressBar mPbLoading; 42 private ProgressBar mPbLoading;
43 + private Coupon mCoupon;
42 44
43 // =========================================================== 45 // ===========================================================
44 // Methods for/from SuperClass/Interfaces 46 // Methods for/from SuperClass/Interfaces
...@@ -111,7 +113,16 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -111,7 +113,16 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
111 @Override 113 @Override
112 public void onSuccess(JSONObject result) { 114 public void onSuccess(JSONObject result) {
113 mPbLoading.setVisibility(View.GONE); 115 mPbLoading.setVisibility(View.GONE);
116 + int status = result.optInt("status");
117 + if (status == 1) {
118 + mCoupon = new Coupon(result.optJSONObject("result"));
119 + mCoupon.setDescription(mCouponset.getShortDescription());
120 + mCoupon.setImage(mCouponset.getImgPreview());
121 + mCoupon.setName(mCouponset.getName());
114 showDialog(true, 1); 122 showDialog(true, 1);
123 + } else {
124 + showDialog(false, status);
125 + }
115 } 126 }
116 127
117 @Override 128 @Override
...@@ -150,7 +161,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -150,7 +161,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
150 mLlButton.setOnClickListener(view -> { 161 mLlButton.setOnClickListener(view -> {
151 dialog.dismiss(); 162 dialog.dismiss();
152 if (success) { 163 if (success) {
153 - //TODO: go to coupon 164 + onBackPressed();
154 } 165 }
155 }); 166 });
156 } 167 }
......
...@@ -25,7 +25,7 @@ import ly.warp.sdk.views.adapters.CouponsetsAdapter; ...@@ -25,7 +25,7 @@ import ly.warp.sdk.views.adapters.CouponsetsAdapter;
25 import ly.warp.sdk.views.adapters.ProfileCampaignAdapter; 25 import ly.warp.sdk.views.adapters.ProfileCampaignAdapter;
26 26
27 27
28 -public class ListForYouActivity extends Activity implements View.OnClickListener { 28 +public class GiftsForYouActivity extends Activity implements View.OnClickListener {
29 29
30 // =========================================================== 30 // ===========================================================
31 // Constants 31 // Constants
...@@ -50,7 +50,7 @@ public class ListForYouActivity extends Activity implements View.OnClickListener ...@@ -50,7 +50,7 @@ public class ListForYouActivity extends Activity implements View.OnClickListener
50 @Override 50 @Override
51 public void onCreate(Bundle savedInstanceState) { 51 public void onCreate(Bundle savedInstanceState) {
52 super.onCreate(savedInstanceState); 52 super.onCreate(savedInstanceState);
53 - setContentView(R.layout.activity_list_for_you); 53 + setContentView(R.layout.activity_gifts_for_you);
54 54
55 getCampaignsBySubcategory(); 55 getCampaignsBySubcategory();
56 56
...@@ -95,14 +95,7 @@ public class ListForYouActivity extends Activity implements View.OnClickListener ...@@ -95,14 +95,7 @@ public class ListForYouActivity extends Activity implements View.OnClickListener
95 mRecyclerGifts.setAdapter(mAdapterGifts); 95 mRecyclerGifts.setAdapter(mAdapterGifts);
96 mAdapterGifts.getPositionClicks() 96 mAdapterGifts.getPositionClicks()
97 .doOnNext(gift -> { 97 .doOnNext(gift -> {
98 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(gift); 98 + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(gift)));
99 -
100 - if (WarplyManagerHelper.getConsumer() != null)
101 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
102 - else
103 - tempUrl = tempUrl + "&auth_token=";
104 -
105 - startActivity(WarpViewActivity.createIntentFromURL(this, tempUrl));
106 }) 99 })
107 .doOnError(error -> { 100 .doOnError(error -> {
108 }) 101 })
...@@ -117,14 +110,7 @@ public class ListForYouActivity extends Activity implements View.OnClickListener ...@@ -117,14 +110,7 @@ public class ListForYouActivity extends Activity implements View.OnClickListener
117 mRecyclerRewards.setAdapter(mAdapterRewards); 110 mRecyclerRewards.setAdapter(mAdapterRewards);
118 mAdapterRewards.getPositionClicks() 111 mAdapterRewards.getPositionClicks()
119 .doOnNext(reward -> { 112 .doOnNext(reward -> {
120 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(reward); 113 + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(reward)));
121 -
122 - if (WarplyManagerHelper.getConsumer() != null)
123 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
124 - else
125 - tempUrl = tempUrl + "&auth_token=";
126 -
127 - startActivity(WarpViewActivity.createIntentFromURL(this, tempUrl));
128 }) 114 })
129 .doOnError(error -> { 115 .doOnError(error -> {
130 }) 116 })
...@@ -139,11 +125,7 @@ public class ListForYouActivity extends Activity implements View.OnClickListener ...@@ -139,11 +125,7 @@ public class ListForYouActivity extends Activity implements View.OnClickListener
139 mRecyclerCoupons.setAdapter(mAdapterCoupons); 125 mRecyclerCoupons.setAdapter(mAdapterCoupons);
140 mAdapterCoupons.getPositionClicks() 126 mAdapterCoupons.getPositionClicks()
141 .doOnNext(couponset -> { 127 .doOnNext(couponset -> {
142 -// Intent intent = new Intent(ListForYouActivity.this, CouponInfoActivity.class); 128 + Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class);
143 -// intent.putExtra("coupon", (Serializable) coupon);
144 -// startActivity(intent);
145 -
146 - Intent intent = new Intent(ListForYouActivity.this, CouponsetInfoActivity.class);
147 intent.putExtra("couponset", (Serializable) couponset); 129 intent.putExtra("couponset", (Serializable) couponset);
148 startActivity(intent); 130 startActivity(intent);
149 }) 131 })
......
...@@ -92,14 +92,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, ...@@ -92,14 +92,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener,
92 if (camp == null) 92 if (camp == null)
93 return; 93 return;
94 94
95 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(camp); 95 + startActivity(WarpViewActivity.createIntentFromURL(LoyaltyActivity.this, WarplyManagerHelper.constructCampaignUrl(camp)));
96 -
97 - if (WarplyManagerHelper.getConsumer() != null)
98 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
99 - else
100 - tempUrl = tempUrl + "&auth_token=";
101 -
102 - startActivity(WarpViewActivity.createIntentFromURL(LoyaltyActivity.this, tempUrl));
103 } 96 }
104 } 97 }
105 98
......
1 +package ly.warp.sdk.activities;
2 +
3 +import android.app.Activity;
4 +import android.os.Bundle;
5 +import android.view.View;
6 +import android.widget.ImageView;
7 +import android.widget.TextView;
8 +
9 +import androidx.recyclerview.widget.LinearLayoutManager;
10 +import androidx.recyclerview.widget.RecyclerView;
11 +
12 +import ly.warp.sdk.R;
13 +import ly.warp.sdk.utils.WarplyManagerHelper;
14 +import ly.warp.sdk.views.adapters.ProfileCampaignAdapter;
15 +
16 +
17 +public class MoreForYouActivity extends Activity implements View.OnClickListener {
18 +
19 + // ===========================================================
20 + // Constants
21 + // ===========================================================
22 +
23 + // ===========================================================
24 + // Fields
25 + // ===========================================================
26 +
27 + private ImageView mIvBack;
28 + private RecyclerView mRecyclerMore;
29 + private TextView mTvTitle;
30 + private ProfileCampaignAdapter mAdapterMore;
31 +
32 + // ===========================================================
33 + // Methods for/from SuperClass/Interfaces
34 + // ===========================================================
35 +
36 + @Override
37 + public void onCreate(Bundle savedInstanceState) {
38 + super.onCreate(savedInstanceState);
39 + setContentView(R.layout.activity_more_for_you);
40 +
41 + mIvBack = findViewById(R.id.iv_list_close);
42 + mTvTitle = findViewById(R.id.textView3);
43 +
44 + mRecyclerMore = findViewById(R.id.rv_more);
45 +
46 + initViews();
47 + }
48 +
49 + @Override
50 + public void onResume() {
51 + super.onResume();
52 + }
53 +
54 + @Override
55 + public void onClick(View view) {
56 + if (view.getId() == R.id.iv_list_close) {
57 + onBackPressed();
58 + }
59 + }
60 +
61 + // ===========================================================
62 + // Methods
63 + // ===========================================================
64 +
65 + private void initViews() {
66 + mIvBack.setOnClickListener(this);
67 + mTvTitle.setText(getIntent().getStringExtra("title"));
68 +
69 + if (WarplyManagerHelper.getUniqueCampaignList().get("more_for_you") != null && WarplyManagerHelper.getUniqueCampaignList().get("more_for_you").size() > 0) {
70 + mRecyclerMore.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
71 + mAdapterMore = new ProfileCampaignAdapter(this, WarplyManagerHelper.getUniqueCampaignList().get("more_for_you"));
72 + mRecyclerMore.setAdapter(mAdapterMore);
73 + mAdapterMore.getPositionClicks()
74 + .doOnNext(gift -> {
75 + startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(gift)));
76 + })
77 + .doOnError(error -> {
78 + })
79 + .subscribe();
80 + } else {
81 + mRecyclerMore.setVisibility(View.GONE);
82 + }
83 + }
84 +
85 + // ===========================================================
86 + // Inner and Anonymous Classes
87 + // ===========================================================
88 +
89 +}
...@@ -77,14 +77,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener { ...@@ -77,14 +77,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
77 mRecyclerCampaigns.setAdapter(mAdapterCampaigns); 77 mRecyclerCampaigns.setAdapter(mAdapterCampaigns);
78 mAdapterCampaigns.getPositionClicks() 78 mAdapterCampaigns.getPositionClicks()
79 .doOnNext(campaign -> { 79 .doOnNext(campaign -> {
80 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(campaign); 80 + startActivity(WarpViewActivity.createIntentFromURL(getContext(), WarplyManagerHelper.constructCampaignUrl(campaign)));
81 -
82 - if (WarplyManagerHelper.getConsumer() != null)
83 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
84 - else
85 - tempUrl = tempUrl + "&auth_token=";
86 -
87 - startActivity(WarpViewActivity.createIntentFromURL(getContext(), tempUrl));
88 }) 81 })
89 .doOnError(error -> { 82 .doOnError(error -> {
90 }) 83 })
......
...@@ -15,8 +15,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; ...@@ -15,8 +15,9 @@ import androidx.recyclerview.widget.LinearLayoutManager;
15 import androidx.recyclerview.widget.RecyclerView; 15 import androidx.recyclerview.widget.RecyclerView;
16 16
17 import ly.warp.sdk.R; 17 import ly.warp.sdk.R;
18 -import ly.warp.sdk.activities.ListForYouActivity; 18 +import ly.warp.sdk.activities.GiftsForYouActivity;
19 import ly.warp.sdk.activities.LoyaltyActivity; 19 import ly.warp.sdk.activities.LoyaltyActivity;
20 +import ly.warp.sdk.activities.MoreForYouActivity;
20 import ly.warp.sdk.activities.WarpViewActivity; 21 import ly.warp.sdk.activities.WarpViewActivity;
21 import ly.warp.sdk.utils.WarplyManagerHelper; 22 import ly.warp.sdk.utils.WarplyManagerHelper;
22 import ly.warp.sdk.views.adapters.ProfileCampaignAdapter; 23 import ly.warp.sdk.views.adapters.ProfileCampaignAdapter;
...@@ -73,14 +74,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener { ...@@ -73,14 +74,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
73 mRecyclerDeals.setAdapter(mAdapterDeals); 74 mRecyclerDeals.setAdapter(mAdapterDeals);
74 mAdapterDeals.getPositionClicks() 75 mAdapterDeals.getPositionClicks()
75 .doOnNext(deal -> { 76 .doOnNext(deal -> {
76 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(deal); 77 + startActivity(WarpViewActivity.createIntentFromURL(getContext(), WarplyManagerHelper.constructCampaignUrl(deal)));
77 -
78 - if (WarplyManagerHelper.getConsumer() != null)
79 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
80 - else
81 - tempUrl = tempUrl + "&auth_token=";
82 -
83 - startActivity(WarpViewActivity.createIntentFromURL(getContext(), tempUrl));
84 }) 78 })
85 .doOnError(error -> { 79 .doOnError(error -> {
86 }) 80 })
...@@ -97,14 +91,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener { ...@@ -97,14 +91,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
97 mRecyclerGifts.setAdapter(mAdapterGifts); 91 mRecyclerGifts.setAdapter(mAdapterGifts);
98 mAdapterGifts.getPositionClicks() 92 mAdapterGifts.getPositionClicks()
99 .doOnNext(gift -> { 93 .doOnNext(gift -> {
100 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(gift); 94 + startActivity(WarpViewActivity.createIntentFromURL(getContext(), WarplyManagerHelper.constructCampaignUrl(gift)));
101 -
102 - if (WarplyManagerHelper.getConsumer() != null)
103 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
104 - else
105 - tempUrl = tempUrl + "&auth_token=";
106 -
107 - startActivity(WarpViewActivity.createIntentFromURL(getContext(), tempUrl));
108 }) 95 })
109 .doOnError(error -> { 96 .doOnError(error -> {
110 }) 97 })
...@@ -121,14 +108,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener { ...@@ -121,14 +108,7 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
121 mRecyclerMore.setAdapter(mAdapterMore); 108 mRecyclerMore.setAdapter(mAdapterMore);
122 mAdapterMore.getPositionClicks() 109 mAdapterMore.getPositionClicks()
123 .doOnNext(more -> { 110 .doOnNext(more -> {
124 - String tempUrl = WarplyManagerHelper.constructCampaignUrl(more); 111 + startActivity(WarpViewActivity.createIntentFromURL(getContext(), WarplyManagerHelper.constructCampaignUrl(more)));
125 -
126 - if (WarplyManagerHelper.getConsumer() != null)
127 - tempUrl = tempUrl + "&auth_token=" + (WarplyManagerHelper.getConsumer().getUuid());
128 - else
129 - tempUrl = tempUrl + "&auth_token=";
130 -
131 - startActivity(WarpViewActivity.createIntentFromURL(getContext(), tempUrl));
132 }) 112 })
133 .doOnError(error -> { 113 .doOnError(error -> {
134 }) 114 })
...@@ -146,9 +126,16 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener { ...@@ -146,9 +126,16 @@ public class LoyaltyFragment extends Fragment implements View.OnClickListener {
146 return; 126 return;
147 } 127 }
148 if (view.getId() == R.id.iv_more2) { 128 if (view.getId() == R.id.iv_more2) {
149 - Intent intent = new Intent(getContext(), ListForYouActivity.class); 129 + Intent intent = new Intent(getContext(), GiftsForYouActivity.class);
150 intent.putExtra("title", getString(R.string.cos_gifts_title)); 130 intent.putExtra("title", getString(R.string.cos_gifts_title));
151 startActivity(intent); 131 startActivity(intent);
132 + return;
133 + }
134 + if (view.getId() == R.id.iv_more3) {
135 + Intent intent = new Intent(getContext(), MoreForYouActivity.class);
136 + intent.putExtra("title", getString(R.string.cos_more_title));
137 + startActivity(intent);
138 + return;
152 } 139 }
153 } 140 }
154 141
......
...@@ -68,6 +68,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -68,6 +68,7 @@ public class Campaign implements Parcelable, Serializable {
68 private static final String DELIVERY_METHOD = "delivery_method"; 68 private static final String DELIVERY_METHOD = "delivery_method";
69 private static final String DISPLAY_TYPE = "display_type"; 69 private static final String DISPLAY_TYPE = "display_type";
70 private static final String ACTIONS = "actions"; 70 private static final String ACTIONS = "actions";
71 + private static final String BUS_ID = "busId";
71 72
72 /* Member variables of the Campaign object */ 73 /* Member variables of the Campaign object */
73 74
...@@ -83,7 +84,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -83,7 +84,7 @@ public class Campaign implements Parcelable, Serializable {
83 private final String title; 84 private final String title;
84 private final int sorting; 85 private final int sorting;
85 private final int opened; 86 private final int opened;
86 - private final boolean isNew; 87 + private boolean isNew;
87 private final String logoUrl; 88 private final String logoUrl;
88 private final String extraFields; 89 private final String extraFields;
89 private final String type; 90 private final String type;
...@@ -92,6 +93,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -92,6 +93,7 @@ public class Campaign implements Parcelable, Serializable {
92 private String deliveryMethod; 93 private String deliveryMethod;
93 private String displayType; 94 private String displayType;
94 private String indexUrl; 95 private String indexUrl;
96 + private String busId;
95 private ArrayList<CampaignAction> actions = new ArrayList<>(); 97 private ArrayList<CampaignAction> actions = new ArrayList<>();
96 98
97 /** 99 /**
...@@ -138,6 +140,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -138,6 +140,7 @@ public class Campaign implements Parcelable, Serializable {
138 this.show = json.optBoolean(SHOW); 140 this.show = json.optBoolean(SHOW);
139 this.deliveryMethod = json.optString(DELIVERY_METHOD); 141 this.deliveryMethod = json.optString(DELIVERY_METHOD);
140 this.displayType = json.optString(DISPLAY_TYPE); 142 this.displayType = json.optString(DISPLAY_TYPE);
143 + this.busId = json.optString(BUS_ID);
141 144
142 JSONArray actions = json.optJSONArray(ACTIONS); 145 JSONArray actions = json.optJSONArray(ACTIONS);
143 if (actions != null) { 146 if (actions != null) {
...@@ -172,6 +175,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -172,6 +175,7 @@ public class Campaign implements Parcelable, Serializable {
172 this.deliveryMethod = source.readString(); 175 this.deliveryMethod = source.readString();
173 this.displayType = source.readString(); 176 this.displayType = source.readString();
174 this.actions = source.readArrayList(CampaignAction.class.getClassLoader()); 177 this.actions = source.readArrayList(CampaignAction.class.getClassLoader());
178 + this.busId = source.readString();
175 } 179 }
176 180
177 @Override 181 @Override
...@@ -198,6 +202,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -198,6 +202,7 @@ public class Campaign implements Parcelable, Serializable {
198 dest.writeString(deliveryMethod); 202 dest.writeString(deliveryMethod);
199 dest.writeString(displayType); 203 dest.writeString(displayType);
200 dest.writeList(actions); 204 dest.writeList(actions);
205 + dest.writeString(busId);
201 } 206 }
202 207
203 /** 208 /**
...@@ -230,6 +235,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -230,6 +235,7 @@ public class Campaign implements Parcelable, Serializable {
230 jObj.putOpt(SHOW, this.show); 235 jObj.putOpt(SHOW, this.show);
231 jObj.putOpt(DELIVERY_METHOD, this.deliveryMethod); 236 jObj.putOpt(DELIVERY_METHOD, this.deliveryMethod);
232 jObj.putOpt(DISPLAY_TYPE, this.displayType); 237 jObj.putOpt(DISPLAY_TYPE, this.displayType);
238 + jObj.put(BUS_ID, this.busId);
233 } catch (JSONException e) { 239 } catch (JSONException e) {
234 if (WarpConstants.DEBUG) { 240 if (WarpConstants.DEBUG) {
235 e.printStackTrace(); 241 e.printStackTrace();
...@@ -447,6 +453,18 @@ public class Campaign implements Parcelable, Serializable { ...@@ -447,6 +453,18 @@ public class Campaign implements Parcelable, Serializable {
447 return actions; 453 return actions;
448 } 454 }
449 455
456 + public String getBusId() {
457 + return busId;
458 + }
459 +
460 + public void setBusId(String busId) {
461 + this.busId = busId;
462 + }
463 +
464 + public void setNew(boolean aNew) {
465 + isNew = aNew;
466 + }
467 +
450 @Override 468 @Override
451 public int describeContents() { 469 public int describeContents() {
452 return 0; 470 return 0;
......
...@@ -46,6 +46,7 @@ public class WarplyManagerHelper { ...@@ -46,6 +46,7 @@ public class WarplyManagerHelper {
46 private static CouponsetsList mCouponsetsList = new CouponsetsList(); 46 private static CouponsetsList mCouponsetsList = new CouponsetsList();
47 47
48 public static String constructCampaignUrl(Campaign item) { 48 public static String constructCampaignUrl(Campaign item) {
49 + item.setNew(false);
49 String url = item.getIndexUrl() 50 String url = item.getIndexUrl()
50 + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext()) 51 + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext())
51 + "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext()) 52 + "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext())
...@@ -55,6 +56,12 @@ public class WarplyManagerHelper { ...@@ -55,6 +56,12 @@ public class WarplyManagerHelper {
55 + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token") 56 + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")
56 + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id") 57 + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")
57 + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret"); 58 + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret");
59 +
60 + if (mConsumer != null)
61 + url = url + "&auth_token=" + (mConsumer.getUuid());
62 + else
63 + url = url + "&auth_token=";
64 +
58 return url; 65 return url;
59 } 66 }
60 67
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
23 <TextView 23 <TextView
24 android:layout_width="wrap_content" 24 android:layout_width="wrap_content"
25 android:layout_height="wrap_content" 25 android:layout_height="wrap_content"
26 - android:text="@string/cos_profile_reward" 26 + android:text="@string/cos_profile_title"
27 android:textColor="@color/grey" 27 android:textColor="@color/grey"
28 android:textSize="17sp" 28 android:textSize="17sp"
29 android:textStyle="bold" 29 android:textStyle="bold"
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 + xmlns:app="http://schemas.android.com/apk/res-auto"
4 + android:layout_width="match_parent"
5 + android:layout_height="match_parent"
6 + android:background="@android:color/white"
7 + android:fillViewport="true">
8 +
9 + <!-- <LinearLayout-->
10 + <!-- android:id="@+id/cl_bill_payment"-->
11 + <!-- android:layout_width="match_parent"-->
12 + <!-- android:layout_height="match_parent"-->
13 + <!-- android:orientation="vertical">-->
14 +
15 + <androidx.constraintlayout.widget.ConstraintLayout
16 + android:id="@+id/cl_more_header"
17 + android:layout_width="match_parent"
18 + android:layout_height="80dp"
19 + app:layout_constraintTop_toTopOf="parent">
20 +
21 + <ImageView
22 + android:id="@+id/iv_list_close"
23 + android:layout_width="21dp"
24 + android:layout_height="20dp"
25 + android:layout_marginStart="24dp"
26 + android:layout_marginTop="4dp"
27 + android:src="@drawable/ic_back"
28 + app:layout_constraintStart_toStartOf="parent"
29 + app:layout_constraintTop_toTopOf="@+id/textView3" />
30 +
31 + <TextView
32 + android:id="@+id/textView3"
33 + android:layout_width="206dp"
34 + android:layout_height="32dp"
35 + android:gravity="center"
36 + android:textColor="@color/grey"
37 + android:textSize="17sp"
38 + android:textStyle="bold"
39 + app:layout_constraintBottom_toBottomOf="parent"
40 + app:layout_constraintEnd_toEndOf="parent"
41 + app:layout_constraintHorizontal_bias="0.356"
42 + app:layout_constraintStart_toEndOf="@+id/iv_list_close"
43 + app:layout_constraintTop_toTopOf="parent" />
44 + </androidx.constraintlayout.widget.ConstraintLayout>
45 +
46 + <RelativeLayout
47 + android:layout_width="match_parent"
48 + android:layout_height="match_parent"
49 + android:layout_below="@+id/cl_more_header"
50 + android:background="@drawable/shape_cos_profile_gradient"
51 + android:orientation="vertical"
52 + android:paddingBottom="24dp">
53 +
54 + <androidx.recyclerview.widget.RecyclerView
55 + android:id="@+id/rv_more"
56 + android:layout_width="match_parent"
57 + android:layout_height="match_parent"
58 + android:layout_marginTop="24dp"
59 + android:clipToPadding="false"
60 + android:orientation="vertical"
61 + android:paddingEnd="24dp" />
62 +
63 + <!-- <androidx.constraintlayout.widget.ConstraintLayout-->
64 + <!-- android:id="@+id/cl_recycler_inner3"-->
65 + <!-- android:layout_width="match_parent"-->
66 + <!-- android:layout_height="wrap_content"-->
67 + <!-- android:layout_below="@+id/cl_recycler_inner2"-->
68 + <!-- android:layout_marginTop="36dp"-->
69 + <!-- android:paddingBottom="4dp"-->
70 + <!-- app:layout_constraintLeft_toLeftOf="parent"-->
71 + <!-- app:layout_constraintRight_toRightOf="parent"-->
72 + <!-- app:layout_constraintTop_toTopOf="parent">-->
73 +
74 + <!-- <TextView-->
75 + <!-- android:id="@+id/tv_coupons_title"-->
76 + <!-- android:layout_width="wrap_content"-->
77 + <!-- android:layout_height="wrap_content"-->
78 + <!-- android:layout_marginStart="10dp"-->
79 + <!-- android:text="@string/cos_coupons_title"-->
80 + <!-- android:textColor="@android:color/white"-->
81 + <!-- android:textSize="18sp"-->
82 + <!-- android:textStyle="bold"-->
83 + <!-- app:layout_constraintStart_toStartOf="parent"-->
84 + <!-- app:layout_constraintTop_toTopOf="parent" />-->
85 +
86 +
87 + <!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
88 + </RelativeLayout>
89 + <!-- </LinearLayout>-->
90 +</RelativeLayout>
...\ No newline at end of file ...\ No newline at end of file
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
11 <string name="cos_profile_type">Traveller</string> 11 <string name="cos_profile_type">Traveller</string>
12 <string name="header_add">Προσθήκη</string> 12 <string name="header_add">Προσθήκη</string>
13 <string name="cos_profile_reward">My Loyalty\nWallet</string> 13 <string name="cos_profile_reward">My Loyalty\nWallet</string>
14 + <string name="cos_profile_title">My Loyalty Wallet</string>
14 <string name="cos_deals_title">Deals for You</string> 15 <string name="cos_deals_title">Deals for You</string>
15 <string name="cos_profile_more">Δες περισσότερα</string> 16 <string name="cos_profile_more">Δες περισσότερα</string>
16 <string name="cos_gifts_title">Gifts for You</string> 17 <string name="cos_gifts_title">Gifts for You</string>
......