Showing
8 changed files
with
103 additions
and
3 deletions
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <project version="4"> | 2 | <project version="4"> |
| 3 | <component name="CompilerConfiguration"> | 3 | <component name="CompilerConfiguration"> |
| 4 | - <bytecodeTargetLevel target="21" /> | 4 | + <bytecodeTargetLevel target="17" /> |
| 5 | </component> | 5 | </component> |
| 6 | </project> | 6 | </project> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
.idea/migrations.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project version="4"> | ||
| 3 | + <component name="ProjectMigrations"> | ||
| 4 | + <option name="MigrateToGradleLocalJavaHome"> | ||
| 5 | + <set> | ||
| 6 | + <option value="$PROJECT_DIR$" /> | ||
| 7 | + </set> | ||
| 8 | + </option> | ||
| 9 | + </component> | ||
| 10 | +</project> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -184,7 +184,7 @@ | ... | @@ -184,7 +184,7 @@ |
| 184 | </map> | 184 | </map> |
| 185 | </option> | 185 | </option> |
| 186 | </component> | 186 | </component> |
| 187 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK"> | 187 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="zulu-17" project-jdk-type="JavaSDK"> |
| 188 | <output url="file://$PROJECT_DIR$/build/classes" /> | 188 | <output url="file://$PROJECT_DIR$/build/classes" /> |
| 189 | </component> | 189 | </component> |
| 190 | <component name="ProjectType"> | 190 | <component name="ProjectType"> | ... | ... |
| ... | @@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true | ... | @@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true |
| 5 | 5 | ||
| 6 | ext { | 6 | ext { |
| 7 | PUBLISH_GROUP_ID = 'ly.warp' | 7 | PUBLISH_GROUP_ID = 'ly.warp' |
| 8 | - PUBLISH_VERSION = '4.5.5.4r46' | 8 | + PUBLISH_VERSION = '4.5.5.4m1' |
| 9 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 9 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
| 10 | } | 10 | } |
| 11 | 11 | ... | ... |
| ... | @@ -23,6 +23,7 @@ import ly.warp.sdk.db.WarplyDBHelper; | ... | @@ -23,6 +23,7 @@ import ly.warp.sdk.db.WarplyDBHelper; |
| 23 | import ly.warp.sdk.fragments.HomeFragment; | 23 | import ly.warp.sdk.fragments.HomeFragment; |
| 24 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 24 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
| 25 | import ly.warp.sdk.io.models.Campaign; | 25 | import ly.warp.sdk.io.models.Campaign; |
| 26 | +import ly.warp.sdk.io.models.RedeemedSMHistoryModel; | ||
| 26 | import ly.warp.sdk.utils.managers.WarplyManager; | 27 | import ly.warp.sdk.utils.managers.WarplyManager; |
| 27 | 28 | ||
| 28 | public class BaseFragmentActivity extends FragmentActivity implements NavigationBarView.OnItemSelectedListener { | 29 | public class BaseFragmentActivity extends FragmentActivity implements NavigationBarView.OnItemSelectedListener { |
| ... | @@ -52,6 +53,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation | ... | @@ -52,6 +53,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation |
| 52 | 53 | ||
| 53 | if (WarplyDBHelper.getInstance(this).isTableNotEmpty("auth")) { | 54 | if (WarplyDBHelper.getInstance(this).isTableNotEmpty("auth")) { |
| 54 | WarplyManager.getSupermarketCampaign(mCampaignsCallback); | 55 | WarplyManager.getSupermarketCampaign(mCampaignsCallback); |
| 56 | + WarplyManager.getRedeemedSMHistory(mSMHistoryReceiver); | ||
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | 59 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { |
| ... | @@ -147,4 +149,16 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation | ... | @@ -147,4 +149,16 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation |
| 147 | Toast.makeText(BaseFragmentActivity.this, "Campaigns Error", Toast.LENGTH_SHORT).show(); | 149 | Toast.makeText(BaseFragmentActivity.this, "Campaigns Error", Toast.LENGTH_SHORT).show(); |
| 148 | } | 150 | } |
| 149 | }; | 151 | }; |
| 152 | + | ||
| 153 | + private final CallbackReceiver<RedeemedSMHistoryModel> mSMHistoryReceiver = new CallbackReceiver<RedeemedSMHistoryModel>() { | ||
| 154 | + @Override | ||
| 155 | + public void onSuccess(RedeemedSMHistoryModel result) { | ||
| 156 | + Toast.makeText(BaseFragmentActivity.this, "SM HISTORY SUCCESS", Toast.LENGTH_SHORT).show(); | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + @Override | ||
| 160 | + public void onFailure(int errorCode) { | ||
| 161 | + Toast.makeText(BaseFragmentActivity.this, "SM HISTORY ERROR", Toast.LENGTH_SHORT).show(); | ||
| 162 | + } | ||
| 163 | + }; | ||
| 150 | } | 164 | } | ... | ... |
| ... | @@ -23,6 +23,7 @@ import ly.warp.sdk.R; | ... | @@ -23,6 +23,7 @@ import ly.warp.sdk.R; |
| 23 | import ly.warp.sdk.db.WarplyDBHelper; | 23 | import ly.warp.sdk.db.WarplyDBHelper; |
| 24 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 24 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
| 25 | import ly.warp.sdk.io.models.Campaign; | 25 | import ly.warp.sdk.io.models.Campaign; |
| 26 | +import ly.warp.sdk.io.models.RedeemedSMHistoryModel; | ||
| 26 | import ly.warp.sdk.utils.WarplyManagerHelper; | 27 | import ly.warp.sdk.utils.WarplyManagerHelper; |
| 27 | import ly.warp.sdk.utils.managers.WarplyManager; | 28 | import ly.warp.sdk.utils.managers.WarplyManager; |
| 28 | 29 | ||
| ... | @@ -100,6 +101,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip | ... | @@ -100,6 +101,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip |
| 100 | public void onRefresh() { | 101 | public void onRefresh() { |
| 101 | if (WarplyDBHelper.getInstance(getActivity()).isTableNotEmpty("auth")) { | 102 | if (WarplyDBHelper.getInstance(getActivity()).isTableNotEmpty("auth")) { |
| 102 | WarplyManager.getSupermarketCampaign(mCampaignsCallback); | 103 | WarplyManager.getSupermarketCampaign(mCampaignsCallback); |
| 104 | + WarplyManager.getRedeemedSMHistory(mSMHistoryReceiver); | ||
| 103 | mSwipeRefresh.setRefreshing(false); | 105 | mSwipeRefresh.setRefreshing(false); |
| 104 | } else { | 106 | } else { |
| 105 | mSwipeRefresh.setRefreshing(false); | 107 | mSwipeRefresh.setRefreshing(false); |
| ... | @@ -182,6 +184,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip | ... | @@ -182,6 +184,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip |
| 182 | // } | 184 | // } |
| 183 | 185 | ||
| 184 | WarplyManager.getSupermarketCampaign(mCampaignsCallback); | 186 | WarplyManager.getSupermarketCampaign(mCampaignsCallback); |
| 187 | + WarplyManager.getRedeemedSMHistory(mSMHistoryReceiver); | ||
| 185 | } | 188 | } |
| 186 | 189 | ||
| 187 | @Override | 190 | @Override |
| ... | @@ -190,4 +193,16 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip | ... | @@ -190,4 +193,16 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip |
| 190 | Toast.makeText(getActivity(), "LOGIN ERROR", Toast.LENGTH_SHORT).show(); | 193 | Toast.makeText(getActivity(), "LOGIN ERROR", Toast.LENGTH_SHORT).show(); |
| 191 | } | 194 | } |
| 192 | }; | 195 | }; |
| 196 | + | ||
| 197 | + private final CallbackReceiver<RedeemedSMHistoryModel> mSMHistoryReceiver = new CallbackReceiver<RedeemedSMHistoryModel>() { | ||
| 198 | + @Override | ||
| 199 | + public void onSuccess(RedeemedSMHistoryModel result) { | ||
| 200 | + Toast.makeText(getActivity(), "SM HISTORY SUCCESS", Toast.LENGTH_SHORT).show(); | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + @Override | ||
| 204 | + public void onFailure(int errorCode) { | ||
| 205 | + Toast.makeText(getActivity(), "SM HISTORY ERROR", Toast.LENGTH_SHORT).show(); | ||
| 206 | + } | ||
| 207 | + }; | ||
| 193 | } | 208 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | +/* | ||
| 2 | + * Copyright 2010-2013 Warply Ltd. All rights reserved. | ||
| 3 | + * | ||
| 4 | + * Redistribution and use in source and binary forms, without modification, are | ||
| 5 | + * permitted provided that the following conditions are met: | ||
| 6 | + * | ||
| 7 | + * 1. Redistributions of source code must retain the above copyright notice, | ||
| 8 | + * this list of conditions and the following disclaimer. | ||
| 9 | + * | ||
| 10 | + * 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| 11 | + * this list of conditions and the following disclaimer in the documentation | ||
| 12 | + * and/or other materials provided with the distribution. | ||
| 13 | + * | ||
| 14 | + * THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR | ||
| 15 | + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
| 16 | + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
| 17 | + * EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
| 18 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 19 | + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | ||
| 20 | + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| 21 | + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
| 22 | + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | ||
| 23 | + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 24 | + */ | ||
| 25 | + | ||
| 26 | +package ly.warp.sdk.io.models; | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * Created by Panagiotis Triantafyllou on 05-Mar-25. | ||
| 30 | + */ | ||
| 31 | + | ||
| 32 | +public class RedeemedSMHistoryModel { | ||
| 33 | + private CouponList redeemedCouponList = new CouponList(); | ||
| 34 | + private float totalRedeemedValue = 0.0f; | ||
| 35 | + | ||
| 36 | + public RedeemedSMHistoryModel() { | ||
| 37 | + this.redeemedCouponList = new CouponList(); | ||
| 38 | + this.totalRedeemedValue = 0.0f; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + // ================================================================================ | ||
| 42 | + // Getters | ||
| 43 | + // ================================================================================ | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + public CouponList getRedeemedCouponList() { | ||
| 47 | + return redeemedCouponList; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public void setRedeemedCouponList(CouponList redeemedCouponList) { | ||
| 51 | + this.redeemedCouponList = redeemedCouponList; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + public float getTotalRedeemedValue() { | ||
| 55 | + return totalRedeemedValue; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public void setTotalRedeemedValue(float totalRedeemedValue) { | ||
| 59 | + this.totalRedeemedValue = totalRedeemedValue; | ||
| 60 | + } | ||
| 61 | +} |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment