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-07 19:01:02 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8b713b909facd16bc1c8a5b312f00a77558348d9
8b713b90
1 parent
579ef8b5
new mfy ui
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
125 additions
and
25 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/HealthEventModel.java
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MoreCampaignAdapter.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MoreContextualAdapter.java
warply_android_sdk/src/main/res/layout/activity_more_for_you.xml
warply_android_sdk/src/main/res/values/strings.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
View file @
8b713b9
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/HealthEventModel.java
View file @
8b713b9
...
...
@@ -31,17 +31,17 @@ package ly.warp.sdk.io.models;
*/
public
class
HealthEventModel
{
private
double
step
s
;
private
double
meter
s
;
public
HealthEventModel
()
{
this
.
step
s
=
0.0d
;
this
.
meter
s
=
0.0d
;
}
public
double
get
Step
s
()
{
return
step
s
;
public
double
get
Meter
s
()
{
return
meter
s
;
}
public
void
set
Steps
(
double
step
s
)
{
this
.
steps
=
step
s
;
public
void
set
Meters
(
double
meter
s
)
{
this
.
meters
=
meter
s
;
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
View file @
8b713b9
...
...
@@ -211,7 +211,7 @@ public class WarplyHealthService extends Service implements SensorEventListener
mSteps
++;
mStepsAll
++;
HealthEventModel
healthSteps
=
new
HealthEventModel
();
healthSteps
.
set
Step
s
((
mStepsAll
*
0.762
));
healthSteps
.
set
Meter
s
((
mStepsAll
*
0.762
));
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
healthSteps
));
WarpUtils
.
setStepsMetersCounter
(
this
,
(
mStepsAll
*
0.762
));
WarpUtils
.
setStepsCounter
(
this
,
mSteps
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
8b713b9
...
...
@@ -745,7 +745,7 @@ public class WarplyManagerHelper {
*/
public
static
void
setSeasonalList
(
ArrayList
<
LoyaltyGiftsForYouPackage
>
seasonalCoupons
)
{
mSeasonalList
.
clear
();
mSeasonalList
.
addAll
(
seasonalCoupons
)
;
mSeasonalList
=
seasonalCoupons
;
}
/**
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MoreCampaignAdapter.java
View file @
8b713b9
...
...
@@ -22,8 +22,7 @@ import io.reactivex.subjects.PublishSubject;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.io.models.Campaign
;
public
class
MoreCampaignAdapter
extends
RecyclerView
.
Adapter
<
MoreCampaignAdapter
.
ProfileCampaignViewHolder
>
{
public
class
MoreCampaignAdapter
extends
RecyclerView
.
Adapter
<
MoreCampaignAdapter
.
MoreCampaignViewHolder
>
{
private
Context
mContext
;
private
ArrayList
<
Campaign
>
mCampaigns
;
...
...
@@ -34,25 +33,17 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte
this
.
mCampaigns
=
campaignList
;
}
public
class
Profil
eCampaignViewHolder
extends
RecyclerView
.
ViewHolder
{
public
class
Mor
eCampaignViewHolder
extends
RecyclerView
.
ViewHolder
{
private
ImageView
ivCampaignTitle
,
ivIsNew
;
private
TextView
tvCampaignTitle
,
tvCampaignSubtitle
,
tvCampaignMessage
;
public
ProfileCampaignViewHolder
(
View
view
)
{
super
(
view
);
ivCampaignTitle
=
view
.
findViewById
(
R
.
id
.
iv_campaign_logo
);
tvCampaignTitle
=
view
.
findViewById
(
R
.
id
.
tv_campaign_title
);
}
public
ProfileCampaignViewHolder
(
View
view
,
boolean
vertical
)
{
public
MoreCampaignViewHolder
(
View
view
)
{
super
(
view
);
ivCampaignTitle
=
view
.
findViewById
(
R
.
id
.
iv_campaign_logo
);
tvCampaignTitle
=
view
.
findViewById
(
R
.
id
.
tv_campaign_title
);
ivIsNew
=
view
.
findViewById
(
R
.
id
.
iv_campaign_new
);
if
(
vertical
)
{
tvCampaignSubtitle
=
view
.
findViewById
(
R
.
id
.
tv_campaign_subtitle
);
tvCampaignMessage
=
view
.
findViewById
(
R
.
id
.
tv_campaign_message
);
}
tvCampaignSubtitle
=
view
.
findViewById
(
R
.
id
.
tv_campaign_subtitle
);
tvCampaignMessage
=
view
.
findViewById
(
R
.
id
.
tv_campaign_message
);
}
}
...
...
@@ -76,15 +67,15 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte
}
@Override
public
Profil
eCampaignViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
public
Mor
eCampaignViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
itemView
;
itemView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
R
.
layout
.
item_profile_recycler_vertical
,
parent
,
false
);
return
new
ProfileCampaignViewHolder
(
itemView
,
true
);
return
new
MoreCampaignViewHolder
(
itemView
);
}
@Override
public
void
onBindViewHolder
(
final
Profil
eCampaignViewHolder
holder
,
int
position
)
{
public
void
onBindViewHolder
(
final
Mor
eCampaignViewHolder
holder
,
int
position
)
{
Campaign
campaignItem
=
mCampaigns
.
get
(
position
);
if
(
campaignItem
!=
null
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MoreContextualAdapter.java
0 → 100644
View file @
8b713b9
package
ly
.
warp
.
sdk
.
views
.
adapters
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.load.resource.bitmap.CenterCrop
;
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
;
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
;
public
class
MoreContextualAdapter
extends
RecyclerView
.
Adapter
<
MoreContextualAdapter
.
MoreContextualViewHolder
>
{
private
Context
mContext
;
private
ArrayList
<
LoyaltyContextualOfferModel
>
mCampaigns
;
private
final
PublishSubject
<
LoyaltyContextualOfferModel
>
onClickSubject
=
PublishSubject
.
create
();
public
MoreContextualAdapter
(
Context
mContext
,
ArrayList
<
LoyaltyContextualOfferModel
>
campaignList
)
{
this
.
mContext
=
mContext
;
this
.
mCampaigns
=
campaignList
;
}
public
class
MoreContextualViewHolder
extends
RecyclerView
.
ViewHolder
{
private
ImageView
ivCampaignTitle
,
ivIsNew
;
private
TextView
tvCampaignTitle
,
tvCampaignSubtitle
,
tvCampaignMessage
;
public
MoreContextualViewHolder
(
View
view
)
{
super
(
view
);
ivCampaignTitle
=
view
.
findViewById
(
R
.
id
.
iv_campaign_logo
);
tvCampaignTitle
=
view
.
findViewById
(
R
.
id
.
tv_campaign_title
);
ivIsNew
=
view
.
findViewById
(
R
.
id
.
iv_campaign_new
);
tvCampaignSubtitle
=
view
.
findViewById
(
R
.
id
.
tv_campaign_subtitle
);
tvCampaignMessage
=
view
.
findViewById
(
R
.
id
.
tv_campaign_message
);
}
}
@Override
public
int
getItemCount
()
{
if
(
mCampaigns
==
null
)
return
0
;
else
return
mCampaigns
.
size
();
}
public
LoyaltyContextualOfferModel
getItem
(
int
id
)
{
return
mCampaigns
.
get
(
id
);
}
public
void
updateData
(
ArrayList
<
LoyaltyContextualOfferModel
>
campaignList
)
{
mCampaigns
.
clear
();
mCampaigns
.
addAll
(
campaignList
);
notifyDataSetChanged
();
}
@Override
public
MoreContextualViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
itemView
;
itemView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
R
.
layout
.
item_profile_recycler_vertical
,
parent
,
false
);
return
new
MoreContextualViewHolder
(
itemView
);
}
@Override
public
void
onBindViewHolder
(
final
MoreContextualViewHolder
holder
,
int
position
)
{
LoyaltyContextualOfferModel
campaignItem
=
mCampaigns
.
get
(
position
);
if
(
campaignItem
!=
null
)
{
if
(!
TextUtils
.
isEmpty
(
campaignItem
.
getImageUrl
()))
{
Glide
.
with
(
mContext
)
.
load
(
campaignItem
.
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
(
campaignItem
.
getTitle
());
holder
.
tvCampaignSubtitle
.
setText
(
campaignItem
.
getSubtitle
());
holder
.
tvCampaignMessage
.
setText
(
campaignItem
.
getMessage
());
holder
.
ivIsNew
.
setVisibility
(
View
.
GONE
);
holder
.
itemView
.
setOnClickListener
(
v
->
onClickSubject
.
onNext
(
campaignItem
));
}
}
public
Observable
<
LoyaltyContextualOfferModel
>
getPositionClicks
()
{
return
onClickSubject
.
cache
();
}
}
warply_android_sdk/src/main/res/layout/activity_more_for_you.xml
View file @
8b713b9
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/res/values/strings.xml
View file @
8b713b9
...
...
@@ -132,6 +132,7 @@
<string
name=
"cos_empty_shared_coupons"
>
Δεν έχεις μοιραστεί ακόμη κουπόνια
</string>
<string
name=
"cos_empty_expired_coupons"
>
Δεν έχεις εξαργυρώσει ακόμη κουπόνια
</string>
<string
name=
"cos_dlg_pacing_goal"
>
Πέτυχες το στόχο του μήνα! Διάλεξε το δώρο που επιθυμείς να ενεργοποιήσεις!
</string>
<string
name=
"cos_mfy_other"
>
ΆΛΛΕΣ
</string>
<string-array
name=
"coupons_array"
>
<item>
Κουπόνια
</item>
...
...
Please
register
or
login
to post a comment