Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2022-11-25 11:35:42 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
52823187e9cf406074d3b1853bb69703eaf03fa0
52823187
1 parent
19c70aba
retrofit fixes
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
61 additions
and
16 deletions
.idea/misc.xml
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponShareActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
warply_android_sdk/src/main/java/ly/warp/sdk/services/EventCampaignCouponService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
warply_android_sdk/src/main/res/layout/fragment_home.xml
.idea/misc.xml
View file @
5282318
...
...
@@ -100,7 +100,7 @@
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_active_coupons.xml"
value=
"0.358695652173913"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_active_gifts.xml"
value=
"0.36666666666666664"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_active_rewards.xml"
value=
"0.358695652173913"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_base_fragment.xml"
value=
"0.
358695652173913
"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_base_fragment.xml"
value=
"0.
25
"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_bill_payment.xml"
value=
"0.358695652173913"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_contextual.xml"
value=
"0.36666666666666664"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/activity_coupon_gift.xml"
value=
"0.36666666666666664"
/>
...
...
@@ -133,7 +133,7 @@
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/dl_share.xml"
value=
"0.36666666666666664"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/dlg_success.xml"
value=
"0.358695652173913"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/expired_coupon_layout.xml"
value=
"0.36666666666666664"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/fragment_home.xml"
value=
"0.
358695652173913
"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/fragment_home.xml"
value=
"0.
22
"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/fragment_loyalty.xml"
value=
"0.358695652173913"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/fragment_profile.xml"
value=
"0.358695652173913"
/>
<entry
key=
"..\:/Users/Warply/Documents/Warply/Android/warply_android_sdk_maven_plugin/warply_android_sdk/src/main/res/layout/gift_layout.xml"
value=
"0.358695652173913"
/>
...
...
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
5282318
...
...
@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public
void
onWarplyReady
()
{
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"60
10139202"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990
, live 3000184910
.
setGuid
(
"60
05892749"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749
, live 3000184910
mLoginReceiver
);
}
else
{
startNextActivity
();
...
...
warply_android_sdk/build.gradle
View file @
5282318
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4.6rc2
0
'
PUBLISH_VERSION
=
'4.5.4.6rc2
1
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
@@ -42,6 +42,7 @@ android {
dependencies
{
//------------------------------ Support -----------------------------//
implementation
'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation
'androidx.appcompat:appcompat:1.4.1'
implementation
'androidx.recyclerview:recyclerview:1.2.1'
implementation
'androidx.cardview:cardview:1.0.0'
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
5282318
...
...
@@ -7,6 +7,7 @@ import android.os.Looper;
import
android.view.MenuItem
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.fragment.app.Fragment
;
...
...
@@ -136,28 +137,27 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
// Inner and Anonymous Classes
// ===========================================================
private
CallbackReceiver
<
ArrayList
<
Campaign
>>
mCampaignsCallback
=
new
CallbackReceiver
<
ArrayList
<
Campaign
>>()
{
private
final
CallbackReceiver
<
ArrayList
<
Campaign
>>
mCampaignsCallback
=
new
CallbackReceiver
<
ArrayList
<
Campaign
>>()
{
@Override
public
void
onSuccess
(
ArrayList
<
Campaign
>
result
)
{
Toast
.
makeText
(
BaseFragmentActivity
.
this
,
"Campaigns Success"
,
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Toast
.
makeText
(
BaseFragmentActivity
.
this
,
"Campaigns Error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
};
private
final
CallbackReceiver
<
CouponList
>
mUserCouponsReceiver
=
new
CallbackReceiver
<
CouponList
>()
{
@Override
public
void
onSuccess
(
CouponList
result
)
{
Toast
.
makeText
(
BaseFragmentActivity
.
this
,
"Coupons Success "
+
String
.
valueOf
(
result
.
size
()),
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Toast
.
makeText
(
BaseFragmentActivity
.
this
,
"Coupons Error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
};
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponShareActivity.java
View file @
5282318
...
...
@@ -325,7 +325,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
public
void
onSuccess
(
JSONObject
result
)
{
int
status
=
result
.
optInt
(
"status"
,
2
);
String
message
=
result
.
optString
(
"msg"
,
""
);
WarplyManager
.
getUserCouponsWithCouponsets
(
new
WarplyUserCouponsRequest
(),
mUserCouponsReceiver
);
WarplyManager
.
getUserCouponsWithCouponsets
(
mUserCouponsReceiver
);
runOnUiThread
(()
->
{
if
(
status
==
1
)
acceptSharingDialog
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
View file @
5282318
...
...
@@ -212,7 +212,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
showDialog
(
true
,
1
);
new
Thread
(()
->
{
if
(!
Thread
.
currentThread
().
isInterrupted
())
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
WarplyUserCouponsRequest
(),
mUserCouponsReceiver
);
WarplyManager
.
getUserCouponsWithCouponsets
(
mUserCouponsReceiver
);
WarplyManager
.
getCampaigns
(
new
WarplyGetCampaignsRequest
().
setLanguage
(
"en"
),
mCampaignsCallback
);
}
}).
start
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
View file @
5282318
...
...
@@ -9,20 +9,29 @@ import android.widget.ImageView;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.fragment.app.Fragment
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
;
import
java.util.ArrayList
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.activities.ActiveCouponsActivity
;
import
ly.warp.sdk.activities.WarpViewActivity
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.io.request.WarplyGetCampaignsRequest
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.managers.WarplyManager
;
import
ly.warp.sdk.views.adapters.HomeCampaignAdapter
;
public
class
HomeFragment
extends
Fragment
implements
View
.
OnClickListener
{
public
class
HomeFragment
extends
Fragment
implements
View
.
OnClickListener
,
SwipeRefreshLayout
.
OnRefreshListener
{
private
RelativeLayout
mOptionOne
,
mOptionTwo
,
mOptionThree
;
private
RecyclerView
mRecyclerCampaigns
;
...
...
@@ -31,6 +40,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
private
TextView
mTvUsername
,
mTvActiveCoupons
;
private
ConstraintLayout
mClActiveCoupons
;
private
ImageView
mIvStepsActivity
;
private
SwipeRefreshLayout
mSwipeRefresh
;
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
...
...
@@ -40,6 +50,8 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
public
void
onViewCreated
(
@NonNull
View
view
,
Bundle
savedInstanceState
)
{
super
.
onViewCreated
(
view
,
savedInstanceState
);
mSwipeRefresh
=
view
.
findViewById
(
R
.
id
.
sw_refresh
);
mSwipeRefresh
.
setOnRefreshListener
(
this
);
mOptionOne
=
view
.
findViewById
(
R
.
id
.
info_button
);
TextView
mOptionOneText
=
mOptionOne
.
findViewById
(
R
.
id
.
option_text
);
ImageView
mOptionOneImage
=
mOptionOne
.
findViewById
(
R
.
id
.
option_icon
);
...
...
@@ -93,6 +105,13 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
}
@Override
public
void
onRefresh
()
{
WarplyManager
.
getUserCouponsWithCouponsets
(
mUserCouponsReceiver
);
WarplyManager
.
getCampaigns
(
new
WarplyGetCampaignsRequest
().
setLanguage
(
"en"
),
mCampaignsCallback
);
mSwipeRefresh
.
setRefreshing
(
false
);
}
@Override
public
void
onClick
(
View
view
)
{
if
(
view
.
getId
()
==
R
.
id
.
cl_coupon
)
{
Intent
intent
=
new
Intent
(
getContext
(),
ActiveCouponsActivity
.
class
);
...
...
@@ -105,4 +124,29 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
HomeFragment
homeFragment
=
new
HomeFragment
();
return
homeFragment
;
}
private
final
CallbackReceiver
<
ArrayList
<
Campaign
>>
mCampaignsCallback
=
new
CallbackReceiver
<
ArrayList
<
Campaign
>>()
{
@Override
public
void
onSuccess
(
ArrayList
<
Campaign
>
result
)
{
Toast
.
makeText
(
getActivity
(),
"Campaigns Success"
,
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Toast
.
makeText
(
getActivity
(),
"Campaigns Error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
};
private
final
CallbackReceiver
<
CouponList
>
mUserCouponsReceiver
=
new
CallbackReceiver
<
CouponList
>()
{
@Override
public
void
onSuccess
(
CouponList
result
)
{
Toast
.
makeText
(
getActivity
(),
"Coupons Success "
+
String
.
valueOf
(
result
.
size
()),
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Toast
.
makeText
(
getActivity
(),
"Coupons Error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
};
}
\ No newline at end of file
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/services/EventCampaignCouponService.java
View file @
5282318
...
...
@@ -38,7 +38,7 @@ public class EventCampaignCouponService extends Worker {
@NonNull
@Override
public
Result
doWork
()
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
WarplyUserCouponsRequest
(),
mUserCouponsReceiver
);
WarplyManager
.
getUserCouponsWithCouponsets
(
mUserCouponsReceiver
);
WarplyManager
.
getCampaigns
(
new
WarplyGetCampaignsRequest
().
setLanguage
(
"en"
),
mCampaignsCallback
);
return
Result
.
success
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
5282318
...
...
@@ -261,7 +261,7 @@ public class WarplyManagerHelper {
public
void
onSuccess
(
JSONObject
result
)
{
int
status
=
result
.
optInt
(
"status"
,
2
);
if
(
status
==
1
)
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
WarplyUserCouponsRequest
(),
new
CallbackReceiver
<
CouponList
>()
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
CallbackReceiver
<
CouponList
>()
{
@Override
public
void
onSuccess
(
CouponList
result
)
{
WarplyCouponsChangedEventModel
couponsChanged
=
new
WarplyCouponsChangedEventModel
();
...
...
@@ -393,7 +393,7 @@ public class WarplyManagerHelper {
public
void
onSuccess
(
JSONObject
result
)
{
int
status
=
result
.
optInt
(
"status"
,
2
);
if
(
status
==
1
)
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
WarplyUserCouponsRequest
(),
new
CallbackReceiver
<
CouponList
>()
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
CallbackReceiver
<
CouponList
>()
{
@Override
public
void
onSuccess
(
CouponList
result
)
{
WarplyCouponsChangedEventModel
couponsChanged
=
new
WarplyCouponsChangedEventModel
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
5282318
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/res/layout/fragment_home.xml
View file @
5282318
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment