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
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
253 additions
and
27 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,27 +33,19 @@ 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
);
}
}
}
@Override
public
int
getItemCount
()
{
...
...
@@ -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
...
...
@@ -25,13 +25,13 @@
<TextView
android:id=
"@+id/textView3"
fontPath=
"fonts/pf_square_sans_pro_bold.ttf"
android:layout_width=
"206dp"
android:layout_height=
"32dp"
android:gravity=
"center"
android:text=
"@string/cos_more_title"
android:textColor=
"@color/grey"
android:textSize=
"17sp"
fontPath=
"fonts/pf_square_sans_pro_bold.ttf"
android:text=
"@string/cos_more_title"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.356"
...
...
@@ -46,6 +46,16 @@
android:background=
"@drawable/shape_cos_loyalty"
android:orientation=
"vertical"
>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fillViewport=
"true"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_more_popup"
android:layout_width=
"match_parent"
...
...
@@ -55,7 +65,7 @@
android:orientation=
"vertical"
android:paddingVertical=
"16dp"
android:visibility=
"gone"
tools:visibility=
"visibl
e"
>
tools:visibility=
"gon
e"
>
<ImageView
android:id=
"@+id/iv_popup_more_close"
...
...
@@ -102,6 +112,122 @@
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:paddingTop=
"44dp"
android:paddingBottom=
"24dp"
/>
android:paddingBottom=
"24dp"
android:visibility=
"gone"
/>
<LinearLayout
android:id=
"@+id/ll_research_items"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/ll_more_popup"
android:orientation=
"vertical"
android:paddingTop=
"44dp"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_research_section"
fontPath=
"fonts/pf_square_sans_pro_bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:textColor=
"@android:color/white"
android:textSize=
"16sp"
tools:text=
"ΕΡΕΥΝΑ"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_research_items"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:paddingBottom=
"4dp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_exclusive_items"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/ll_research_items"
android:orientation=
"vertical"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_exclusive_section"
fontPath=
"fonts/pf_square_sans_pro_bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:textColor=
"@android:color/white"
android:textSize=
"16sp"
tools:text=
"ΕΡΕΥΝΑ"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_exclusive_items"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:paddingBottom=
"4dp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_contest_items"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/ll_exclusive_items"
android:orientation=
"vertical"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_contest_section"
fontPath=
"fonts/pf_square_sans_pro_bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:textColor=
"@android:color/white"
android:textSize=
"16sp"
tools:text=
"ΕΡΕΥΝΑ"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_contest_items"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:paddingBottom=
"4dp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_contextual_items"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/ll_contest_items"
android:orientation=
"vertical"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_contextual_section"
fontPath=
"fonts/pf_square_sans_pro_bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:textColor=
"@android:color/white"
android:textSize=
"16sp"
tools:text=
"ΕΡΕΥΝΑ"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_contextual_items"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:paddingBottom=
"4dp"
/>
</LinearLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
...
...
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