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-09-15 18:31:52 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
048a430704dd16e57d44b73f8b8d49766875fba6
048a4307
1 parent
92aa222d
new keys
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
22 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.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/activity_loyalty_wallet.xml
warply_android_sdk/src/main/res/values/strings.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
View file @
048a430
...
...
@@ -518,6 +518,10 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
mValuesList
.
addAll
(
gfyList
);
// HashSet hs = new HashSet();
// hs.addAll(mValuesList);
// mValuesList.clear();
// mValuesList.addAll(hs);
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
048a430
...
...
@@ -12,6 +12,7 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.ScrollView
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AlertDialog
;
...
...
@@ -21,8 +22,8 @@ import androidx.recyclerview.widget.RecyclerView;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.google.android.flexbox.FlexboxLayout
;
import
org.apmem.tools.layouts.FlowLayout
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
...
...
@@ -67,11 +68,12 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
private
ConstraintLayout
mClDealsBanner
,
mClDealsView
,
mClGiftsBanner
;
private
LinearLayout
mLlQuestionnaire
,
mLlUserBadge
,
mLlEmptyWallet
;
Fl
exbox
Layout
mLlActiveCodesView
;
Fl
ow
Layout
mLlActiveCodesView
;
private
float
couponDfyValue
=
0.0f
;
private
RecyclerView
mRecyclerCoupons
;
private
ActiveCouponAdapter
mAdapterCoupons
;
private
AlertDialog
mAlertDialogNonTelco
;
private
ScrollView
mScActiveCodes
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -102,6 +104,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
mTvActiveCouponsHeader
=
findViewById
(
R
.
id
.
tv_active_coupons_header
);
mLlEmptyWallet
=
findViewById
(
R
.
id
.
ll_empty_wallet
);
mLlActiveCodesView
=
findViewById
(
R
.
id
.
ll_active_deals_codes_view
);
mScActiveCodes
=
findViewById
(
R
.
id
.
sv_active_deals_codes_view
);
// ArrayList<ActiveDFYCouponModel> dlist = new ArrayList<>();
// ActiveDFYCouponModel model = new ActiveDFYCouponModel();
...
...
@@ -402,13 +405,13 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
mTvActiveTitle
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_active_deals_plural
),
String
.
valueOf
(
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
())));
mTvActiveCode
.
setVisibility
(
View
.
GONE
);
//TODO fix logic
for
(
ActiveDFYCouponModel
dealsItem
:
WarplyManagerHelper
.
getActiveDFYCoupons
().
subList
(
0
,
4
)
)
{
// Collections.reverse(WarplyManagerHelper.getActiveDFYCoupons());
for
(
int
i
=
0
;
i
<
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
();
i
++
)
{
LayoutInflater
vi
=
(
LayoutInflater
)
getApplicationContext
().
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
LinearLayout
v
=
(
LinearLayout
)
vi
.
inflate
(
R
.
layout
.
item_selectable
,
null
);
TextView
textView
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
tv_code_copy
);
TextView
textViewComma
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
tv_code_comma
);
textView
.
setText
(
dealsItem
.
getCode
());
textView
.
setText
(
WarplyManagerHelper
.
getActiveDFYCoupons
().
get
(
i
)
.
getCode
());
textView
.
setTextIsSelectable
(
true
);
textViewComma
.
setText
(
getString
(
R
.
string
.
cos_comma
));
mLlActiveCodesView
.
addView
(
v
,
0
,
new
ViewGroup
.
LayoutParams
(
...
...
@@ -416,6 +419,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
));
}
mScActiveCodes
.
setVisibility
(
View
.
VISIBLE
);
mLlActiveCodesView
.
setVisibility
(
View
.
VISIBLE
);
}
// mTvActiveCode.setText(codes);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
048a430
...
...
@@ -42,6 +42,7 @@ import org.json.JSONObject;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.Warply
;
...
...
@@ -214,6 +215,9 @@ public class WarplyManagerHelper {
}
else
if
(
status
==
5
)
{
String
modalText5
=
result
.
optString
(
"msg"
,
""
);
errorUsedDialog
(
context
,
modalText5
);
}
else
if
(
status
==
7
)
{
String
modalText7
=
result
.
optString
(
"msg"
,
""
);
returnDialog
(
context
,
modalText7
,
sharingId
);
}
else
errorSharingDialog
(
context
);
}
...
...
@@ -357,6 +361,52 @@ public class WarplyManagerHelper {
}
/**
* Return dialog
*/
private
static
void
returnDialog
(
Context
context
,
String
message
,
String
sharingId
)
{
mAlertDialogErrorSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_return_title
)
.
setMessage
(
message
)
.
setNegativeButton
(
R
.
string
.
cos_dlg_negative_button
,
(
dialogPositive
,
whichPositive
)
->
{
rejectSharingDialog
(
context
,
sharingId
);
})
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button
,
(
dialogNegative
,
whichNegative
)
->
{
WarplyManager
.
cosmoteRetrieveSharing
(
new
CosmoteRetrieveSharingRequest
()
.
setSharingId
(
sharingId
)
.
setAccept
(
true
),
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
int
status
=
result
.
optInt
(
"status"
,
2
);
if
(
status
==
1
)
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
WarplyUserCouponsRequest
(),
new
CallbackReceiver
<
CouponList
>()
{
@Override
public
void
onSuccess
(
CouponList
result
)
{
WarplyCouponsChangedEventModel
couponsChanged
=
new
WarplyCouponsChangedEventModel
();
couponsChanged
.
setChanged
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
couponsChanged
));
}
@Override
public
void
onFailure
(
int
errorCode
)
{
}
});
acceptSharingDialog
(
context
);
}
else
errorSharingDialog
(
context
);
}
@Override
public
void
onFailure
(
int
errorCode
)
{
errorSharingDialog
(
context
);
}
});
})
.
show
();
}
/**
* Expired dialog
*/
private
static
void
errorExpiredDialog
(
Context
context
,
String
message
)
{
...
...
@@ -1005,6 +1055,10 @@ public class WarplyManagerHelper {
public
static
void
setCarouselList
(
CampaignList
carouselList
)
{
mCarouselList
.
clear
();
mCarouselList
=
carouselList
;
HashSet
hs
=
new
HashSet
();
hs
.
addAll
(
mCarouselList
);
mCarouselList
.
clear
();
mCarouselList
.
addAll
(
hs
);
}
public
static
CampaignList
getCarouselList
()
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
048a430
...
...
@@ -1369,7 +1369,7 @@ public class WarplyManager {
public
void
onSuccess
(
CampaignList
result
)
{
// receiver.onSuccess(result);
mNewCampaignList
.
clear
();
mNewCampaignList
=
result
;
mNewCampaignList
.
addAll
(
result
)
;
getCampaignsPersonalized
(
request
,
new
CallbackReceiver
<
CampaignList
>()
{
@Override
public
void
onSuccess
(
CampaignList
resultPersonalized
)
{
...
...
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
View file @
048a430
...
...
@@ -335,23 +335,21 @@
tools:text=
"961544809"
tools:visibility=
"gone"
/>
<
com.google.android.flexbox.FlexboxLayout
android:id=
"@+id/
ll
_active_deals_codes_view"
<
ScrollView
android:id=
"@+id/
sv
_active_deals_codes_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
app:flexDirection=
"row"
app:flexWrap=
"wrap"
app:justifyContent=
"flex_start"
>
</com.google.android.flexbox.FlexboxLayout>
<!-- <org.apmem.tools.layouts.FlowLayout-->
<!-- android:id="@+id/ll_active_deals_codes_view"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content">-->
<!-- </org.apmem.tools.layouts.FlowLayout>-->
android:layout_height=
"48dp"
android:nestedScrollingEnabled=
"true"
android:visibility=
"gone"
>
<org.apmem.tools.layouts.FlowLayout
android:id=
"@+id/ll_active_deals_codes_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
>
</org.apmem.tools.layouts.FlowLayout>
</ScrollView>
<TextView
android:id=
"@+id/tv_active_deals_date_text"
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
048a430
...
...
@@ -39,6 +39,7 @@
<string
name=
"cos_redeem_coupon"
>
Απόκτησέ το
</string>
<string
name=
"cos_dlg_success_subtitle"
>
Το κουπόνι εξαργυρώθηκε με επιτυχία
</string>
<string
name=
"cos_dlg_error_title"
>
Αποτυχία
</string>
<string
name=
"cos_dlg_return_title"
>
Επιστροφή δώρου
</string>
<string
name=
"cos_dlg_error_subtitle"
>
Κάτι πήγε στραβά
</string>
<string
name=
"cos_dlg_error_subtitle_non_buyable"
>
Το κουπόνι δεν είναι διαθέσιμο για αγορά
</string>
<string
name=
"cos_dlg_error_subtitle_no_points"
>
Δεν έχεις αρκετούς πόντους
</string>
...
...
Please
register
or
login
to post a comment