Showing
8 changed files
with
253 additions
and
27 deletions
This diff is collapsed. Click to expand it.
... | @@ -31,17 +31,17 @@ package ly.warp.sdk.io.models; | ... | @@ -31,17 +31,17 @@ package ly.warp.sdk.io.models; |
31 | */ | 31 | */ |
32 | 32 | ||
33 | public class HealthEventModel { | 33 | public class HealthEventModel { |
34 | - private double steps; | 34 | + private double meters; |
35 | 35 | ||
36 | public HealthEventModel() { | 36 | public HealthEventModel() { |
37 | - this.steps = 0.0d; | 37 | + this.meters = 0.0d; |
38 | } | 38 | } |
39 | 39 | ||
40 | - public double getSteps() { | 40 | + public double getMeters() { |
41 | - return steps; | 41 | + return meters; |
42 | } | 42 | } |
43 | 43 | ||
44 | - public void setSteps(double steps) { | 44 | + public void setMeters(double meters) { |
45 | - this.steps = steps; | 45 | + this.meters = meters; |
46 | } | 46 | } |
47 | } | 47 | } | ... | ... |
... | @@ -211,7 +211,7 @@ public class WarplyHealthService extends Service implements SensorEventListener | ... | @@ -211,7 +211,7 @@ public class WarplyHealthService extends Service implements SensorEventListener |
211 | mSteps++; | 211 | mSteps++; |
212 | mStepsAll++; | 212 | mStepsAll++; |
213 | HealthEventModel healthSteps = new HealthEventModel(); | 213 | HealthEventModel healthSteps = new HealthEventModel(); |
214 | - healthSteps.setSteps((mStepsAll * 0.762)); | 214 | + healthSteps.setMeters((mStepsAll * 0.762)); |
215 | EventBus.getDefault().post(new WarplyEventBusManager(healthSteps)); | 215 | EventBus.getDefault().post(new WarplyEventBusManager(healthSteps)); |
216 | WarpUtils.setStepsMetersCounter(this, (mStepsAll * 0.762)); | 216 | WarpUtils.setStepsMetersCounter(this, (mStepsAll * 0.762)); |
217 | WarpUtils.setStepsCounter(this, mSteps); | 217 | WarpUtils.setStepsCounter(this, mSteps); | ... | ... |
... | @@ -745,7 +745,7 @@ public class WarplyManagerHelper { | ... | @@ -745,7 +745,7 @@ public class WarplyManagerHelper { |
745 | */ | 745 | */ |
746 | public static void setSeasonalList(ArrayList<LoyaltyGiftsForYouPackage> seasonalCoupons) { | 746 | public static void setSeasonalList(ArrayList<LoyaltyGiftsForYouPackage> seasonalCoupons) { |
747 | mSeasonalList.clear(); | 747 | mSeasonalList.clear(); |
748 | - mSeasonalList.addAll(seasonalCoupons); | 748 | + mSeasonalList = seasonalCoupons; |
749 | } | 749 | } |
750 | 750 | ||
751 | /** | 751 | /** | ... | ... |
... | @@ -22,8 +22,7 @@ import io.reactivex.subjects.PublishSubject; | ... | @@ -22,8 +22,7 @@ import io.reactivex.subjects.PublishSubject; |
22 | import ly.warp.sdk.R; | 22 | import ly.warp.sdk.R; |
23 | import ly.warp.sdk.io.models.Campaign; | 23 | import ly.warp.sdk.io.models.Campaign; |
24 | 24 | ||
25 | - | 25 | +public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapter.MoreCampaignViewHolder> { |
26 | -public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapter.ProfileCampaignViewHolder> { | ||
27 | 26 | ||
28 | private Context mContext; | 27 | private Context mContext; |
29 | private ArrayList<Campaign> mCampaigns; | 28 | private ArrayList<Campaign> mCampaigns; |
... | @@ -34,27 +33,19 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte | ... | @@ -34,27 +33,19 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte |
34 | this.mCampaigns = campaignList; | 33 | this.mCampaigns = campaignList; |
35 | } | 34 | } |
36 | 35 | ||
37 | - public class ProfileCampaignViewHolder extends RecyclerView.ViewHolder { | 36 | + public class MoreCampaignViewHolder extends RecyclerView.ViewHolder { |
38 | private ImageView ivCampaignTitle, ivIsNew; | 37 | private ImageView ivCampaignTitle, ivIsNew; |
39 | private TextView tvCampaignTitle, tvCampaignSubtitle, tvCampaignMessage; | 38 | private TextView tvCampaignTitle, tvCampaignSubtitle, tvCampaignMessage; |
40 | 39 | ||
41 | - public ProfileCampaignViewHolder(View view) { | 40 | + public MoreCampaignViewHolder(View view) { |
42 | - super(view); | ||
43 | - ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo); | ||
44 | - tvCampaignTitle = view.findViewById(R.id.tv_campaign_title); | ||
45 | - } | ||
46 | - | ||
47 | - public ProfileCampaignViewHolder(View view, boolean vertical) { | ||
48 | super(view); | 41 | super(view); |
49 | ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo); | 42 | ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo); |
50 | tvCampaignTitle = view.findViewById(R.id.tv_campaign_title); | 43 | tvCampaignTitle = view.findViewById(R.id.tv_campaign_title); |
51 | ivIsNew = view.findViewById(R.id.iv_campaign_new); | 44 | ivIsNew = view.findViewById(R.id.iv_campaign_new); |
52 | - if (vertical) { | ||
53 | tvCampaignSubtitle = view.findViewById(R.id.tv_campaign_subtitle); | 45 | tvCampaignSubtitle = view.findViewById(R.id.tv_campaign_subtitle); |
54 | tvCampaignMessage = view.findViewById(R.id.tv_campaign_message); | 46 | tvCampaignMessage = view.findViewById(R.id.tv_campaign_message); |
55 | } | 47 | } |
56 | } | 48 | } |
57 | - } | ||
58 | 49 | ||
59 | @Override | 50 | @Override |
60 | public int getItemCount() { | 51 | public int getItemCount() { |
... | @@ -76,15 +67,15 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte | ... | @@ -76,15 +67,15 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte |
76 | } | 67 | } |
77 | 68 | ||
78 | @Override | 69 | @Override |
79 | - public ProfileCampaignViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | 70 | + public MoreCampaignViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
80 | View itemView; | 71 | View itemView; |
81 | 72 | ||
82 | itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler_vertical, parent, false); | 73 | itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler_vertical, parent, false); |
83 | - return new ProfileCampaignViewHolder(itemView, true); | 74 | + return new MoreCampaignViewHolder(itemView); |
84 | } | 75 | } |
85 | 76 | ||
86 | @Override | 77 | @Override |
87 | - public void onBindViewHolder(final ProfileCampaignViewHolder holder, int position) { | 78 | + public void onBindViewHolder(final MoreCampaignViewHolder holder, int position) { |
88 | Campaign campaignItem = mCampaigns.get(position); | 79 | Campaign campaignItem = mCampaigns.get(position); |
89 | 80 | ||
90 | if (campaignItem != null) { | 81 | if (campaignItem != null) { | ... | ... |
1 | +package ly.warp.sdk.views.adapters; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.text.TextUtils; | ||
5 | +import android.view.LayoutInflater; | ||
6 | +import android.view.View; | ||
7 | +import android.view.ViewGroup; | ||
8 | +import android.widget.ImageView; | ||
9 | +import android.widget.TextView; | ||
10 | + | ||
11 | +import androidx.recyclerview.widget.RecyclerView; | ||
12 | + | ||
13 | +import com.bumptech.glide.Glide; | ||
14 | +import com.bumptech.glide.load.engine.DiskCacheStrategy; | ||
15 | +import com.bumptech.glide.load.resource.bitmap.CenterCrop; | ||
16 | +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | ||
17 | + | ||
18 | +import java.util.ArrayList; | ||
19 | + | ||
20 | +import io.reactivex.Observable; | ||
21 | +import io.reactivex.subjects.PublishSubject; | ||
22 | +import ly.warp.sdk.R; | ||
23 | +import ly.warp.sdk.io.models.Campaign; | ||
24 | +import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; | ||
25 | + | ||
26 | +public class MoreContextualAdapter extends RecyclerView.Adapter<MoreContextualAdapter.MoreContextualViewHolder> { | ||
27 | + | ||
28 | + private Context mContext; | ||
29 | + private ArrayList<LoyaltyContextualOfferModel> mCampaigns; | ||
30 | + private final PublishSubject<LoyaltyContextualOfferModel> onClickSubject = PublishSubject.create(); | ||
31 | + | ||
32 | + public MoreContextualAdapter(Context mContext, ArrayList<LoyaltyContextualOfferModel> campaignList) { | ||
33 | + this.mContext = mContext; | ||
34 | + this.mCampaigns = campaignList; | ||
35 | + } | ||
36 | + | ||
37 | + public class MoreContextualViewHolder extends RecyclerView.ViewHolder { | ||
38 | + private ImageView ivCampaignTitle, ivIsNew; | ||
39 | + private TextView tvCampaignTitle, tvCampaignSubtitle, tvCampaignMessage; | ||
40 | + | ||
41 | + public MoreContextualViewHolder(View view) { | ||
42 | + super(view); | ||
43 | + ivCampaignTitle = view.findViewById(R.id.iv_campaign_logo); | ||
44 | + tvCampaignTitle = view.findViewById(R.id.tv_campaign_title); | ||
45 | + ivIsNew = view.findViewById(R.id.iv_campaign_new); | ||
46 | + tvCampaignSubtitle = view.findViewById(R.id.tv_campaign_subtitle); | ||
47 | + tvCampaignMessage = view.findViewById(R.id.tv_campaign_message); | ||
48 | + } | ||
49 | + } | ||
50 | + | ||
51 | + @Override | ||
52 | + public int getItemCount() { | ||
53 | + if (mCampaigns == null) | ||
54 | + return 0; | ||
55 | + else | ||
56 | + return mCampaigns.size(); | ||
57 | + } | ||
58 | + | ||
59 | + | ||
60 | + public LoyaltyContextualOfferModel getItem(int id) { | ||
61 | + return mCampaigns.get(id); | ||
62 | + } | ||
63 | + | ||
64 | + public void updateData(ArrayList<LoyaltyContextualOfferModel> campaignList) { | ||
65 | + mCampaigns.clear(); | ||
66 | + mCampaigns.addAll(campaignList); | ||
67 | + notifyDataSetChanged(); | ||
68 | + } | ||
69 | + | ||
70 | + @Override | ||
71 | + public MoreContextualViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
72 | + View itemView; | ||
73 | + | ||
74 | + itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_profile_recycler_vertical, parent, false); | ||
75 | + return new MoreContextualViewHolder(itemView); | ||
76 | + } | ||
77 | + | ||
78 | + @Override | ||
79 | + public void onBindViewHolder(final MoreContextualViewHolder holder, int position) { | ||
80 | + LoyaltyContextualOfferModel campaignItem = mCampaigns.get(position); | ||
81 | + | ||
82 | + if (campaignItem != null) { | ||
83 | + if (!TextUtils.isEmpty(campaignItem.getImageUrl())) { | ||
84 | + Glide.with(mContext) | ||
85 | + .load(campaignItem.getImageUrl()) | ||
86 | + .transform(new CenterCrop(), new RoundedCorners(4)) | ||
87 | + .diskCacheStrategy(DiskCacheStrategy.DATA) | ||
88 | + .into(holder.ivCampaignTitle); | ||
89 | + } else { | ||
90 | + Glide.with(mContext) | ||
91 | + .load(R.drawable.ic_cosmote_logo_horizontal_grey) | ||
92 | + .into(holder.ivCampaignTitle); | ||
93 | + } | ||
94 | + | ||
95 | + holder.tvCampaignTitle.setText(campaignItem.getTitle()); | ||
96 | + holder.tvCampaignSubtitle.setText(campaignItem.getSubtitle()); | ||
97 | + holder.tvCampaignMessage.setText(campaignItem.getMessage()); | ||
98 | + holder.ivIsNew.setVisibility(View.GONE); | ||
99 | + | ||
100 | + holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem)); | ||
101 | + } | ||
102 | + } | ||
103 | + | ||
104 | + public Observable<LoyaltyContextualOfferModel> getPositionClicks() { | ||
105 | + return onClickSubject.cache(); | ||
106 | + } | ||
107 | + | ||
108 | +} |
... | @@ -25,13 +25,13 @@ | ... | @@ -25,13 +25,13 @@ |
25 | 25 | ||
26 | <TextView | 26 | <TextView |
27 | android:id="@+id/textView3" | 27 | android:id="@+id/textView3" |
28 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
28 | android:layout_width="206dp" | 29 | android:layout_width="206dp" |
29 | android:layout_height="32dp" | 30 | android:layout_height="32dp" |
30 | android:gravity="center" | 31 | android:gravity="center" |
32 | + android:text="@string/cos_more_title" | ||
31 | android:textColor="@color/grey" | 33 | android:textColor="@color/grey" |
32 | android:textSize="17sp" | 34 | android:textSize="17sp" |
33 | - fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
34 | - android:text="@string/cos_more_title" | ||
35 | app:layout_constraintBottom_toBottomOf="parent" | 35 | app:layout_constraintBottom_toBottomOf="parent" |
36 | app:layout_constraintEnd_toEndOf="parent" | 36 | app:layout_constraintEnd_toEndOf="parent" |
37 | app:layout_constraintHorizontal_bias="0.356" | 37 | app:layout_constraintHorizontal_bias="0.356" |
... | @@ -46,6 +46,16 @@ | ... | @@ -46,6 +46,16 @@ |
46 | android:background="@drawable/shape_cos_loyalty" | 46 | android:background="@drawable/shape_cos_loyalty" |
47 | android:orientation="vertical"> | 47 | android:orientation="vertical"> |
48 | 48 | ||
49 | + <ScrollView | ||
50 | + android:layout_width="match_parent" | ||
51 | + android:layout_height="match_parent" | ||
52 | + android:fillViewport="true"> | ||
53 | + | ||
54 | + <RelativeLayout | ||
55 | + android:layout_width="match_parent" | ||
56 | + android:layout_height="wrap_content" | ||
57 | + android:orientation="vertical"> | ||
58 | + | ||
49 | <LinearLayout | 59 | <LinearLayout |
50 | android:id="@+id/ll_more_popup" | 60 | android:id="@+id/ll_more_popup" |
51 | android:layout_width="match_parent" | 61 | android:layout_width="match_parent" |
... | @@ -55,7 +65,7 @@ | ... | @@ -55,7 +65,7 @@ |
55 | android:orientation="vertical" | 65 | android:orientation="vertical" |
56 | android:paddingVertical="16dp" | 66 | android:paddingVertical="16dp" |
57 | android:visibility="gone" | 67 | android:visibility="gone" |
58 | - tools:visibility="visible"> | 68 | + tools:visibility="gone"> |
59 | 69 | ||
60 | <ImageView | 70 | <ImageView |
61 | android:id="@+id/iv_popup_more_close" | 71 | android:id="@+id/iv_popup_more_close" |
... | @@ -102,6 +112,122 @@ | ... | @@ -102,6 +112,122 @@ |
102 | android:clipToPadding="false" | 112 | android:clipToPadding="false" |
103 | android:orientation="vertical" | 113 | android:orientation="vertical" |
104 | android:paddingTop="44dp" | 114 | android:paddingTop="44dp" |
105 | - android:paddingBottom="24dp" /> | 115 | + android:paddingBottom="24dp" |
116 | + android:visibility="gone" /> | ||
117 | + | ||
118 | + <LinearLayout | ||
119 | + android:id="@+id/ll_research_items" | ||
120 | + android:layout_width="match_parent" | ||
121 | + android:layout_height="wrap_content" | ||
122 | + android:layout_below="@+id/ll_more_popup" | ||
123 | + android:orientation="vertical" | ||
124 | + android:paddingTop="44dp" | ||
125 | + android:visibility="gone"> | ||
126 | + | ||
127 | + <TextView | ||
128 | + android:id="@+id/tv_research_section" | ||
129 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
130 | + android:layout_width="wrap_content" | ||
131 | + android:layout_height="wrap_content" | ||
132 | + android:layout_marginHorizontal="16dp" | ||
133 | + android:textColor="@android:color/white" | ||
134 | + android:textSize="16sp" | ||
135 | + tools:text="ΕΡΕΥΝΑ" /> | ||
136 | + | ||
137 | + <androidx.recyclerview.widget.RecyclerView | ||
138 | + android:id="@+id/rv_research_items" | ||
139 | + android:layout_width="match_parent" | ||
140 | + android:layout_height="wrap_content" | ||
141 | + android:layout_marginTop="4dp" | ||
142 | + android:clipToPadding="false" | ||
143 | + android:orientation="vertical" | ||
144 | + android:paddingBottom="4dp" /> | ||
145 | + </LinearLayout> | ||
146 | + | ||
147 | + <LinearLayout | ||
148 | + android:id="@+id/ll_exclusive_items" | ||
149 | + android:layout_width="match_parent" | ||
150 | + android:layout_height="wrap_content" | ||
151 | + android:layout_below="@+id/ll_research_items" | ||
152 | + android:orientation="vertical" | ||
153 | + android:visibility="gone"> | ||
154 | + | ||
155 | + <TextView | ||
156 | + android:id="@+id/tv_exclusive_section" | ||
157 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
158 | + android:layout_width="wrap_content" | ||
159 | + android:layout_height="wrap_content" | ||
160 | + android:layout_marginHorizontal="16dp" | ||
161 | + android:textColor="@android:color/white" | ||
162 | + android:textSize="16sp" | ||
163 | + tools:text="ΕΡΕΥΝΑ" /> | ||
164 | + | ||
165 | + <androidx.recyclerview.widget.RecyclerView | ||
166 | + android:id="@+id/rv_exclusive_items" | ||
167 | + android:layout_width="match_parent" | ||
168 | + android:layout_height="wrap_content" | ||
169 | + android:layout_marginTop="4dp" | ||
170 | + android:clipToPadding="false" | ||
171 | + android:orientation="vertical" | ||
172 | + android:paddingBottom="4dp" /> | ||
173 | + </LinearLayout> | ||
174 | + | ||
175 | + <LinearLayout | ||
176 | + android:id="@+id/ll_contest_items" | ||
177 | + android:layout_width="match_parent" | ||
178 | + android:layout_height="wrap_content" | ||
179 | + android:layout_below="@+id/ll_exclusive_items" | ||
180 | + android:orientation="vertical" | ||
181 | + android:visibility="gone"> | ||
182 | + | ||
183 | + <TextView | ||
184 | + android:id="@+id/tv_contest_section" | ||
185 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
186 | + android:layout_width="wrap_content" | ||
187 | + android:layout_height="wrap_content" | ||
188 | + android:layout_marginHorizontal="16dp" | ||
189 | + android:textColor="@android:color/white" | ||
190 | + android:textSize="16sp" | ||
191 | + tools:text="ΕΡΕΥΝΑ" /> | ||
192 | + | ||
193 | + <androidx.recyclerview.widget.RecyclerView | ||
194 | + android:id="@+id/rv_contest_items" | ||
195 | + android:layout_width="match_parent" | ||
196 | + android:layout_height="wrap_content" | ||
197 | + android:layout_marginTop="4dp" | ||
198 | + android:clipToPadding="false" | ||
199 | + android:orientation="vertical" | ||
200 | + android:paddingBottom="4dp" /> | ||
201 | + </LinearLayout> | ||
202 | + | ||
203 | + <LinearLayout | ||
204 | + android:id="@+id/ll_contextual_items" | ||
205 | + android:layout_width="match_parent" | ||
206 | + android:layout_height="wrap_content" | ||
207 | + android:layout_below="@+id/ll_contest_items" | ||
208 | + android:orientation="vertical" | ||
209 | + android:visibility="gone"> | ||
210 | + | ||
211 | + <TextView | ||
212 | + android:id="@+id/tv_contextual_section" | ||
213 | + fontPath="fonts/pf_square_sans_pro_bold.ttf" | ||
214 | + android:layout_width="wrap_content" | ||
215 | + android:layout_height="wrap_content" | ||
216 | + android:layout_marginHorizontal="16dp" | ||
217 | + android:textColor="@android:color/white" | ||
218 | + android:textSize="16sp" | ||
219 | + tools:text="ΕΡΕΥΝΑ" /> | ||
220 | + | ||
221 | + <androidx.recyclerview.widget.RecyclerView | ||
222 | + android:id="@+id/rv_contextual_items" | ||
223 | + android:layout_width="match_parent" | ||
224 | + android:layout_height="wrap_content" | ||
225 | + android:layout_marginTop="4dp" | ||
226 | + android:clipToPadding="false" | ||
227 | + android:orientation="vertical" | ||
228 | + android:paddingBottom="4dp" /> | ||
229 | + </LinearLayout> | ||
230 | + </RelativeLayout> | ||
231 | + </ScrollView> | ||
106 | </RelativeLayout> | 232 | </RelativeLayout> |
107 | </RelativeLayout> | 233 | </RelativeLayout> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -132,6 +132,7 @@ | ... | @@ -132,6 +132,7 @@ |
132 | <string name="cos_empty_shared_coupons">Δεν έχεις μοιραστεί ακόμη κουπόνια</string> | 132 | <string name="cos_empty_shared_coupons">Δεν έχεις μοιραστεί ακόμη κουπόνια</string> |
133 | <string name="cos_empty_expired_coupons">Δεν έχεις εξαργυρώσει ακόμη κουπόνια</string> | 133 | <string name="cos_empty_expired_coupons">Δεν έχεις εξαργυρώσει ακόμη κουπόνια</string> |
134 | <string name="cos_dlg_pacing_goal">Πέτυχες το στόχο του μήνα! Διάλεξε το δώρο που επιθυμείς να ενεργοποιήσεις!</string> | 134 | <string name="cos_dlg_pacing_goal">Πέτυχες το στόχο του μήνα! Διάλεξε το δώρο που επιθυμείς να ενεργοποιήσεις!</string> |
135 | + <string name="cos_mfy_other">ΆΛΛΕΣ</string> | ||
135 | 136 | ||
136 | <string-array name="coupons_array"> | 137 | <string-array name="coupons_array"> |
137 | <item>Κουπόνια</item> | 138 | <item>Κουπόνια</item> | ... | ... |
-
Please register or login to post a comment