thkouk00

Merge branch 'cosmote' of https://git.warp.ly/open-source/warply_android_sdk_mav…

…en_plugin into cosmote
......@@ -21,8 +21,6 @@ import ly.warp.sdk.R;
import ly.warp.sdk.activities.BillPaymentActivity;
import ly.warp.sdk.activities.CouponInfoActivity;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.views.adapters.HomeCampaignAdapter;
......@@ -74,19 +72,9 @@ public class HomeFragment extends BaseFragment implements View.OnClickListener {
mTvUsername.setText(String.format(getResources().getString(R.string.welcome_user),
BaseFragment.getConsumer().getFirstName() + " " + BaseFragment.getConsumer().getLastName()));
/********* TEST CAMPAIGNS DATA **********/
CampaignList clistCampaigns = new CampaignList();
try {
clistCampaigns.add(new Campaign("{\"session_uuid\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"title\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"subtitle\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"offer_message\": null, \"message\": null, \"index_url\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.html\", \"logo_url\": \"https://warply.s3.amazonaws.com/temp/96322898cc824981aece923d8b5afc88/drggtdr.jpg\", \"starts\": 1644494400, \"expires\": 1881522000, \"delivered\": 1644607293, \"action\": 0, \"opened\": 1, \"offer_category\": \"standard-offer\", \"sorting\": 0, \"is_new\": true, \"session_metadata\": \"\\\"\\\"\", \"display_type\": null, \"delivery_method\": 2, \"extra_fields\": \"{}\", \"campaign_type\": null, \"campaign_type_settings\": null, \"actions\": null, \"show\": true, \"expired\": false, \"audience\": \"all\"}"));
clistCampaigns.add(new Campaign("{\"session_uuid\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"title\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"subtitle\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"offer_message\": null, \"message\": null, \"index_url\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.html\", \"logo_url\": \"https://warply.s3.amazonaws.com/temp/96322898cc824981aece923d8b5afc88/drggtdr.jpg\", \"starts\": 1644494400, \"expires\": 1881522000, \"delivered\": 1644607293, \"action\": 0, \"opened\": 1, \"offer_category\": \"standard-offer\", \"sorting\": 0, \"is_new\": true, \"session_metadata\": \"\\\"\\\"\", \"display_type\": null, \"delivery_method\": 2, \"extra_fields\": \"{}\", \"campaign_type\": null, \"campaign_type_settings\": null, \"actions\": null, \"show\": true, \"expired\": false, \"audience\": \"all\"}"));
} catch (JSONException e) {
e.printStackTrace();
}
/********* TEST CAMPAIGNS DATA **********/
mRecyclerCampaigns = view.findViewById(R.id.rv_home_campaigns);
mRecyclerCampaigns.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mAdapterCampaigns = new HomeCampaignAdapter(getContext(), clistCampaigns);
mAdapterCampaigns = new HomeCampaignAdapter(getContext(), BaseFragment.getUniqueCampaignList().get("homescreen"));
mRecyclerCampaigns.setAdapter(mAdapterCampaigns);
mAdapterCampaigns.getPositionClicks()
.doOnNext(campaign -> {
......
......@@ -14,13 +14,9 @@ import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.json.JSONException;
import ly.warp.sdk.R;
import ly.warp.sdk.activities.LoyaltyActivity;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
import ly.warp.sdk.views.adapters.ProfileCampaignAdapter;
public class LoyaltyFragment extends BaseFragment implements View.OnClickListener {
......@@ -52,16 +48,6 @@ public class LoyaltyFragment extends BaseFragment implements View.OnClickListene
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
/********* TEST DATA **********/
CampaignList clist = new CampaignList();
try {
clist.add(new Campaign("{\"session_uuid\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"title\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"subtitle\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"offer_message\": null, \"message\": null, \"index_url\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.html\", \"logo_url\": \"https://warply.s3.amazonaws.com/temp/96322898cc824981aece923d8b5afc88/drggtdr.jpg\", \"starts\": 1644494400, \"expires\": 1881522000, \"delivered\": 1644607293, \"action\": 0, \"opened\": 1, \"offer_category\": \"standard-offer\", \"sorting\": 0, \"is_new\": true, \"session_metadata\": \"\\\"\\\"\", \"display_type\": null, \"delivery_method\": 2, \"extra_fields\": \"{}\", \"campaign_type\": null, \"campaign_type_settings\": null, \"actions\": null, \"show\": true, \"expired\": false, \"audience\": \"all\"}"));
clist.add(new Campaign("{\"session_uuid\": \"a724e911a71a42408b6ba50ae6c08dbb\", \"title\": \"\\u039a\\u03ac\\u03bd\\u03b5 strike\", \"subtitle\": \"\\u03ba\\u03b1\\u03b9 \\u03ba\\u03ad\\u03c1\\u03b4\\u03b9\\u03c3\\u03b5!\", \"offer_message\": null, \"message\": null, \"index_url\": \"https://warply.s3.amazonaws.com/artworks/034fba10ceac4e0f9338bd8e60086292/index.html\", \"logo_url\": \"https://warply.s3.amazonaws.com/temp/96322898cc824981aece923d8b5afc88/drggtdr.jpg\", \"starts\": 1644494400, \"expires\": 1881522000, \"delivered\": 1644607293, \"action\": 0, \"opened\": 1, \"offer_category\": \"standard-offer\", \"sorting\": 0, \"is_new\": true, \"session_metadata\": \"\\\"\\\"\", \"display_type\": null, \"delivery_method\": 2, \"extra_fields\": \"{}\", \"campaign_type\": null, \"campaign_type_settings\": null, \"actions\": null, \"show\": true, \"expired\": false, \"audience\": \"all\"}"));
} catch (JSONException e) {
e.printStackTrace();
}
/********* TEST DATA **********/
mClRewardsWallet = view.findViewById(R.id.cl_rewards_wallet);
mClRewardsWallet.setOnClickListener(this);
......@@ -79,7 +65,7 @@ public class LoyaltyFragment extends BaseFragment implements View.OnClickListene
mRecyclerDeals = view.findViewById(R.id.rv_deals);
mRecyclerDeals.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mAdapterDeals = new ProfileCampaignAdapter(getContext(), clist);
mAdapterDeals = new ProfileCampaignAdapter(getContext(), BaseFragment.getUniqueCampaignList().get("deals"));
mRecyclerDeals.setAdapter(mAdapterDeals);
mAdapterDeals.getPositionClicks()
.doOnNext(deal -> {
......@@ -93,7 +79,7 @@ public class LoyaltyFragment extends BaseFragment implements View.OnClickListene
mRecyclerGifts = view.findViewById(R.id.rv_gifts);
mRecyclerGifts.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mAdapterGifts = new ProfileCampaignAdapter(getContext(), clist);
mAdapterGifts = new ProfileCampaignAdapter(getContext(), BaseFragment.getUniqueCampaignList().get("gifts"));
mRecyclerGifts.setAdapter(mAdapterGifts);
mAdapterGifts.getPositionClicks()
.doOnNext(gift -> {
......@@ -107,7 +93,7 @@ public class LoyaltyFragment extends BaseFragment implements View.OnClickListene
mRecyclerMore = view.findViewById(R.id.rv_more);
mRecyclerMore.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mAdapterMore = new ProfileCampaignAdapter(getContext(), clist);
mAdapterMore = new ProfileCampaignAdapter(getContext(), BaseFragment.getUniqueCampaignList().get("more"));
mRecyclerMore.setAdapter(mAdapterMore);
mAdapterMore.getPositionClicks()
.doOnNext(more -> {
......