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-10-13 13:43:02 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
da4a1e83ae7b89734f3ab263e705f1cae4d9a252
da4a1e83
1 parent
4be1fb72
new keys
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
4 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MergedGiftsAdapter.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MoreCampaignAdapter.java
warply_android_sdk/build.gradle
View file @
da4a1e8
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta9
0
'
PUBLISH_VERSION
=
'4.5.4-cosbeta9
1
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
da4a1e8
...
...
@@ -380,8 +380,9 @@ public class WarplyManagerHelper {
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
);
.
setNegativeButton
(
R
.
string
.
cos_dlg_negative_button2
,
(
dialogPositive
,
whichPositive
)
->
{
// rejectSharingDialog(context, sharingId);
dialogPositive
.
dismiss
();
})
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button
,
(
dialogNegative
,
whichNegative
)
->
{
WarplyManager
.
cosmoteRetrieveSharing
(
new
CosmoteRetrieveSharingRequest
()
...
...
@@ -405,7 +406,7 @@ public class WarplyManagerHelper {
}
});
acceptSharingDialog
(
context
);
//
acceptSharingDialog(context);
}
else
errorSharingDialog
(
context
);
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MergedGiftsAdapter.java
View file @
da4a1e8
...
...
@@ -28,10 +28,12 @@ import io.reactivex.subjects.PublishSubject;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.activities.GiftsForYouActivity
;
import
ly.warp.sdk.activities.TelcoActivity
;
import
ly.warp.sdk.activities.WarpViewActivity
;
import
ly.warp.sdk.io.models.LoyaltyContextualOfferModel
;
import
ly.warp.sdk.io.models.MergedGifts
;
import
ly.warp.sdk.utils.WarpJSONParser
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.managers.WarplyAnalyticsManager
;
public
class
MergedGiftsAdapter
extends
RecyclerView
.
Adapter
<
MergedGiftsAdapter
.
MergedGiftsViewHolder
>
{
...
...
@@ -110,6 +112,37 @@ public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.
}
holder
.
tvMergedGiftsTitle
.
setText
(
ccms
.
getTitle
());
if
(
mergedgiftsItem
.
getCampaign
().
getIsNew
())
holder
.
ivIsNew
.
setVisibility
(
View
.
VISIBLE
);
else
holder
.
ivIsNew
.
setVisibility
(
View
.
GONE
);
holder
.
itemView
.
setOnClickListener
(
v
->
onClickSubject
.
onNext
(
mergedgiftsItem
));
return
;
}
}
return
;
}
if
(
extraFields
.
has
(
"ccms_offer"
)
&&
extraFields
.
optString
(
"ccms_offer"
).
equals
(
"true"
))
{
for
(
LoyaltyContextualOfferModel
ccms
:
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
())
{
if
(
ccms
.
getLoyaltyCampaignId
().
equals
(
mergedgiftsItem
.
getCampaign
().
getSessionUUID
())
&&
ccms
.
getZone
().
equals
(
"COSMOTE_APP_GIFTS4U"
))
{
if
(!
TextUtils
.
isEmpty
(
ccms
.
getImageUrl
()))
{
Glide
.
with
(
mContext
)
.
load
(
ccms
.
getImageUrl
())
.
transform
(
new
CenterCrop
(),
new
RoundedCorners
(
4
))
.
diskCacheStrategy
(
DiskCacheStrategy
.
DATA
)
.
into
(
holder
.
ivMergedGiftsLogo
);
}
else
{
Glide
.
with
(
mContext
)
.
load
(
R
.
drawable
.
ic_cosmote_logo_horizontal_grey
)
.
into
(
holder
.
ivMergedGiftsLogo
);
}
holder
.
tvMergedGiftsTitle
.
setText
(
ccms
.
getTitle
());
if
(
mergedgiftsItem
.
getCampaign
().
getIsNew
())
holder
.
ivIsNew
.
setVisibility
(
View
.
VISIBLE
);
else
holder
.
ivIsNew
.
setVisibility
(
View
.
GONE
);
holder
.
itemView
.
setOnClickListener
(
v
->
onClickSubject
.
onNext
(
mergedgiftsItem
));
return
;
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MoreCampaignAdapter.java
View file @
da4a1e8
...
...
@@ -15,12 +15,17 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
import
com.bumptech.glide.load.resource.bitmap.CenterCrop
;
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
io.reactivex.Observable
;
import
io.reactivex.subjects.PublishSubject
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.LoyaltyContextualOfferModel
;
import
ly.warp.sdk.utils.WarpJSONParser
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
public
class
MoreCampaignAdapter
extends
RecyclerView
.
Adapter
<
MoreCampaignAdapter
.
MoreCampaignViewHolder
>
{
...
...
@@ -86,6 +91,40 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte
Campaign
campaignItem
=
mCampaigns
.
get
(
position
);
if
(
campaignItem
!=
null
)
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
campaignItem
.
getExtraFields
());
if
(
extraFields
!=
null
)
{
if
(
extraFields
.
has
(
"ccms_offer"
)
&&
extraFields
.
optString
(
"ccms_offer"
).
equals
(
"true"
))
{
for
(
LoyaltyContextualOfferModel
ccms
:
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
())
{
if
(
ccms
.
getLoyaltyCampaignId
().
equals
(
campaignItem
.
getSessionUUID
())
&&
ccms
.
getZone
().
equals
(
"COSMOTE_APP_MORE4U"
))
{
if
(!
TextUtils
.
isEmpty
(
ccms
.
getImageUrl
()))
{
Glide
.
with
(
mContext
)
.
load
(
ccms
.
getImageUrl
())
.
transform
(
new
CenterCrop
(),
new
RoundedCorners
(
4
))
.
diskCacheStrategy
(
DiskCacheStrategy
.
DATA
)
.
into
(
holder
.
ivCampaignTitle
);
}
else
{
Glide
.
with
(
mContext
)
.
load
(
R
.
drawable
.
ic_cosmote_logo_horizontal_grey
)
.
into
(
holder
.
ivCampaignTitle
);
}
holder
.
tvCampaignTitle
.
setText
(
ccms
.
getTitle
());
holder
.
tvCampaignSubtitle
.
setText
(
ccms
.
getSubtitle
());
holder
.
tvCampaignMessage
.
setText
(
ccms
.
getMessage
());
if
(
campaignItem
.
getIsNew
())
holder
.
ivIsNew
.
setVisibility
(
View
.
VISIBLE
);
else
holder
.
ivIsNew
.
setVisibility
(
View
.
GONE
);
holder
.
itemView
.
setOnClickListener
(
v
->
onClickSubject
.
onNext
(
campaignItem
));
return
;
}
}
return
;
}
}
if
(!
TextUtils
.
isEmpty
(
campaignItem
.
getLogoUrl
()))
{
Glide
.
with
(
mContext
)
.
load
(
campaignItem
.
getLogoUrl
())
...
...
Please
register
or
login
to post a comment