Panagiotis Triantafyllou

my rewards fragment

1 package ly.warp.sdk.activities; 1 package ly.warp.sdk.activities;
2 2
3 +import android.content.Context;
3 import android.os.Bundle; 4 import android.os.Bundle;
4 import android.view.MenuItem; 5 import android.view.MenuItem;
5 import android.widget.Toast; 6 import android.widget.Toast;
...@@ -12,15 +13,14 @@ import com.google.android.material.bottomnavigation.BottomNavigationView; ...@@ -12,15 +13,14 @@ import com.google.android.material.bottomnavigation.BottomNavigationView;
12 import com.google.android.material.navigation.NavigationBarView; 13 import com.google.android.material.navigation.NavigationBarView;
13 14
14 import java.util.ArrayList; 15 import java.util.ArrayList;
15 -import java.util.HashMap;
16 16
17 +import io.github.inflationx.viewpump.ViewPumpContextWrapper;
17 import ly.warp.sdk.R; 18 import ly.warp.sdk.R;
18 import ly.warp.sdk.fragments.HomeFragment; 19 import ly.warp.sdk.fragments.HomeFragment;
19 import ly.warp.sdk.fragments.LoyaltyFragment; 20 import ly.warp.sdk.fragments.LoyaltyFragment;
21 +import ly.warp.sdk.fragments.MyRewardsFragment;
20 import ly.warp.sdk.io.callbacks.CallbackReceiver; 22 import ly.warp.sdk.io.callbacks.CallbackReceiver;
21 import ly.warp.sdk.io.models.Campaign; 23 import ly.warp.sdk.io.models.Campaign;
22 -import ly.warp.sdk.io.models.CampaignList;
23 -import ly.warp.sdk.io.models.Consumer;
24 import ly.warp.sdk.io.models.CouponList; 24 import ly.warp.sdk.io.models.CouponList;
25 import ly.warp.sdk.io.models.UnifiedCoupon; 25 import ly.warp.sdk.io.models.UnifiedCoupon;
26 import ly.warp.sdk.io.request.WarplyGetCampaignsRequest; 26 import ly.warp.sdk.io.request.WarplyGetCampaignsRequest;
...@@ -89,10 +89,22 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation ...@@ -89,10 +89,22 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
89 .addToBackStack(null) 89 .addToBackStack(null)
90 .commit(); 90 .commit();
91 return true; 91 return true;
92 + } else if (itemId == R.id.menu_profile) {
93 + mFragmentToSet = MyRewardsFragment.newInstance();
94 + getSupportFragmentManager().beginTransaction()
95 + .replace(R.id.fl_fragment, mFragmentToSet)
96 + .addToBackStack(null)
97 + .commit();
98 + return true;
92 } 99 }
93 return false; 100 return false;
94 } 101 }
95 102
103 + @Override
104 + public void attachBaseContext(Context newBase) {
105 + super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
106 + }
107 +
96 // =========================================================== 108 // ===========================================================
97 // Methods 109 // Methods
98 // =========================================================== 110 // ===========================================================
......
1 +package ly.warp.sdk.fragments;
2 +
3 +import static android.app.Activity.RESULT_OK;
4 +
5 +import android.content.Context;
6 +import android.content.Intent;
7 +import android.os.Bundle;
8 +import android.os.Handler;
9 +import android.os.Looper;
10 +import android.text.TextUtils;
11 +import android.view.LayoutInflater;
12 +import android.view.View;
13 +import android.view.ViewGroup;
14 +import android.widget.ImageView;
15 +import android.widget.LinearLayout;
16 +import android.widget.RelativeLayout;
17 +import android.widget.ScrollView;
18 +import android.widget.TextView;
19 +
20 +import androidx.annotation.NonNull;
21 +import androidx.appcompat.app.AlertDialog;
22 +import androidx.cardview.widget.CardView;
23 +import androidx.constraintlayout.widget.ConstraintLayout;
24 +import androidx.core.content.ContextCompat;
25 +import androidx.core.widget.NestedScrollView;
26 +import androidx.fragment.app.Fragment;
27 +import androidx.recyclerview.widget.LinearLayoutManager;
28 +import androidx.recyclerview.widget.RecyclerView;
29 +
30 +import com.bumptech.glide.Glide;
31 +import com.bumptech.glide.load.engine.DiskCacheStrategy;
32 +
33 +import net.cachapa.expandablelayout.ExpandableLayout;
34 +
35 +import org.apmem.tools.layouts.FlowLayout;
36 +import org.greenrobot.eventbus.EventBus;
37 +import org.greenrobot.eventbus.Subscribe;
38 +
39 +import java.util.ArrayList;
40 +
41 +import io.github.inflationx.viewpump.ViewPumpContextWrapper;
42 +import ly.warp.sdk.R;
43 +import ly.warp.sdk.activities.ActiveCouponsActivity;
44 +import ly.warp.sdk.activities.ActiveUnifiedCouponsActivity;
45 +import ly.warp.sdk.activities.LoyaltyAnalysisActivity;
46 +import ly.warp.sdk.activities.LoyaltyHistoryActivity;
47 +import ly.warp.sdk.activities.LoyaltyMarketAnalysisActivity;
48 +import ly.warp.sdk.activities.WarpViewActivity;
49 +import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
50 +import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
51 +import ly.warp.sdk.io.models.UnifiedCoupon;
52 +import ly.warp.sdk.io.models.VouchersActivityEventModel;
53 +import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel;
54 +import ly.warp.sdk.utils.WarpUtils;
55 +import ly.warp.sdk.utils.WarplyManagerHelper;
56 +import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
57 +import ly.warp.sdk.utils.managers.WarplyEventBusManager;
58 +import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
59 +import ly.warp.sdk.views.adapters.MarketCouponAdapter;
60 +
61 +
62 +public class MyRewardsFragment extends Fragment implements View.OnClickListener {
63 +
64 + // ===========================================================
65 + // Constants
66 + // ===========================================================
67 +
68 + // ===========================================================
69 + // Fields
70 + // ===========================================================
71 +
72 + private ImageView mIvDealsLogo, mIvProfilePhoto, mIvExpArrow;
73 + private TextView mTvUsername, mTvDealsValue, mTvDealsValueAll,
74 + mTvUserBadge, mTvGiftsValue, mTvGiftsValueAll, mTvActiveCode, mTvActiveDate,
75 + mTvActiveTitle, mTvActiveCouponsHeader, mTvMarketValue, mTvMarketAll, mTvFavValue,
76 + mTvFavValueAll, mTvDealsCountBadge, mTvUnifiedCountBadge, mTvGiftsCountBadge,
77 + mTvVouchersDisabledTitle, mTvVouchersDisabledSubtitle, mTvVouchersTitle, mTvVouchersSubtitle;
78 + private ConstraintLayout mClDealsBanner, mClDealsView,
79 + mClGiftsBanner, mClMarket;
80 + private LinearLayout mLlQuestionnaire, mLlUserBadge, mLlEmptyWallet, mLlDeals, mLlGifts,
81 + mLlMarketView, mLlHistory, mLlBannerInfo, mLlVouchers, mLlVouchersSpinner,
82 + mLlVouchersDisabled;
83 + private FlowLayout mLlActiveCodesView;
84 + private float couponDfyValue = 0.0f, mFavValue = 0.0f;
85 + private RecyclerView mRecyclerCoupons, mRvMarketCoupons;
86 + private ActiveCouponAdapter mAdapterCoupons;
87 + private AlertDialog mAlertDialogNonTelco, mAlertDialogVouchersService;
88 + private ScrollView mScActiveCodes;
89 + private int mTimer = 0;
90 + private Handler mSecondsHandler;
91 + private ArrayList<UnifiedCoupon> mUnifiedCoupons = new ArrayList<UnifiedCoupon>();
92 + private float countValue = 0.0f;
93 + private MarketCouponAdapter mAdapterMarketCoupons;
94 + private ExpandableLayout mElGifts;
95 + private boolean mIsStayCollapsed = true;
96 + private CardView mClExp, mCvVouchers, mCvVouchersDisabled;
97 + private boolean mDfyPressed = false, mDealsBannerPressed = false, mQuestionnairePressed = false,
98 + mHistoryPressed = false, mHistoryMarketPressed = false, mUnifiedPressed = false,
99 + mCouponPressed = false, mHistoryBadgePressed = false, mUnifiedCountPressed = false,
100 + mGiftsCountPressed = false;
101 + private RelativeLayout mRlDeals, mRlUnified, mRlGifts;
102 + private View mSeparator, mSeparatorDisabled;
103 +
104 + // ===========================================================
105 + // Methods for/from SuperClass/Interfaces
106 + // ===========================================================
107 +
108 + public static Fragment newInstance() {
109 + MyRewardsFragment myRewardsFragment = new MyRewardsFragment();
110 + return myRewardsFragment;
111 + }
112 +
113 + @Override
114 + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
115 + return inflater.inflate(R.layout.fragment_my_rewards, container, false);
116 + }
117 +
118 + public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
119 + super.onViewCreated(view, savedInstanceState);
120 +
121 + mSecondsHandler = new Handler();
122 +
123 + mTvUsername = view.findViewById(R.id.tv_profile_name);
124 + mLlQuestionnaire = view.findViewById(R.id.ll_user_questionnaire);
125 + mLlUserBadge = view.findViewById(R.id.ll_user_badge);
126 + mTvUserBadge = view.findViewById(R.id.tv_type);
127 + mTvGiftsValue = view.findViewById(R.id.tv_gifts_value);
128 + mTvGiftsValueAll = view.findViewById(R.id.tv_gifts_value_all);
129 + mClDealsBanner = view.findViewById(R.id.cl_deals_win_inner_cos);
130 + mClGiftsBanner = view.findViewById(R.id.cl_deals_win_inner);
131 + mTvDealsValue = view.findViewById(R.id.tv_deals_value);
132 + mTvDealsValueAll = view.findViewById(R.id.tv_deals_value_all);
133 + mTvActiveCode = view.findViewById(R.id.tv_active_deals_text);
134 + mTvActiveDate = view.findViewById(R.id.tv_active_deals_date_text);
135 + mIvDealsLogo = view.findViewById(R.id.dfy_logo);
136 + mClDealsView = view.findViewById(R.id.cl_mygifts);
137 + mLlDeals = view.findViewById(R.id.ll_mygifts);
138 + mIvProfilePhoto = view.findViewById(R.id.iv_profile_photo);
139 + mTvActiveTitle = view.findViewById(R.id.tv_active_gifts);
140 + mTvActiveCouponsHeader = view.findViewById(R.id.tv_active_coupons_header);
141 + mLlEmptyWallet = view.findViewById(R.id.ll_empty_wallet);
142 + mLlActiveCodesView = view.findViewById(R.id.ll_active_deals_codes_view);
143 + mScActiveCodes = view.findViewById(R.id.sv_active_deals_codes_view);
144 + mLlGifts = view.findViewById(R.id.ll_gifts_view);
145 + mLlMarketView = view.findViewById(R.id.ll_market_view);
146 + mRvMarketCoupons = view.findViewById(R.id.rv_market_coupons);
147 + mRvMarketCoupons.setNestedScrollingEnabled(false);
148 + mRvMarketCoupons.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
149 + mElGifts = view.findViewById(R.id.el_exp);
150 + mClExp = view.findViewById(R.id.cl_exp);
151 + mIvExpArrow = view.findViewById(R.id.iv_exp_arrow);
152 + mTvMarketValue = view.findViewById(R.id.tv_market_value);
153 + mTvMarketAll = view.findViewById(R.id.tv_market_value_all);
154 + mClMarket = view.findViewById(R.id.cl_market_inner);
155 + mTvFavValue = view.findViewById(R.id.tv_exp_value);
156 + mTvFavValueAll = view.findViewById(R.id.tv_exp_value_all);
157 + mLlHistory = view.findViewById(R.id.ll_loyalty_history);
158 + mTvDealsCountBadge = view.findViewById(R.id.tv_deals_count);
159 + mTvUnifiedCountBadge = view.findViewById(R.id.tv_sm_count);
160 + mTvGiftsCountBadge = view.findViewById(R.id.tv_gifts_count);
161 + mLlBannerInfo = view.findViewById(R.id.ll_banner_info_new);
162 + mRlDeals = view.findViewById(R.id.rv_deals_count);
163 + mRlUnified = view.findViewById(R.id.rv_sm_count);
164 + mRlGifts = view.findViewById(R.id.rv_gifts_count);
165 + mRecyclerCoupons = view.findViewById(R.id.rv_active_coupons);
166 + mCvVouchers = view.findViewById(R.id.cv_vouchers);
167 + mCvVouchersDisabled = view.findViewById(R.id.cv_vouchers_disabled);
168 + mLlVouchers = view.findViewById(R.id.ll_vouchers);
169 + mLlVouchersDisabled = view.findViewById(R.id.ll_vouchers_disabled);
170 + mLlVouchersSpinner = view.findViewById(R.id.ll_vouchers_spinner);
171 + mSeparator = view.findViewById(R.id.v_separator_vouchers);
172 + mSeparatorDisabled = view.findViewById(R.id.v_separator_vouchers_disabled);
173 + mTvVouchersDisabledTitle = view.findViewById(R.id.tv_vouchers_title_disabled);
174 + mTvVouchersDisabledSubtitle = view.findViewById(R.id.tv_vouchers_info_title_disabled);
175 + mTvVouchersTitle = view.findViewById(R.id.tv_vouchers_title);
176 + mTvVouchersSubtitle = view.findViewById(R.id.tv_vouchers_info_title);
177 + }
178 +
179 + @Override
180 + public void onStart() {
181 + super.onStart();
182 + if (!EventBus.getDefault().isRegistered(this))
183 + EventBus.getDefault().register(this);
184 + }
185 +
186 + @Override
187 + public void onStop() {
188 + super.onStop();
189 +// EventBus.getDefault().unregister(this);
190 + }
191 +
192 + @Override
193 + public void onDestroy() {
194 + super.onDestroy();
195 + WarplyManagerHelper.clearShowVouchersBanner();
196 + EventBus.getDefault().unregister(this);
197 + }
198 +
199 + @Override
200 + public void onResume() {
201 + super.onResume();
202 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "screen", "LoyaltyWalletScreen");
203 + mTimer = 0;
204 + mSecondsHandler.post(new Runnable() {
205 + @Override
206 + public void run() {
207 + mTimer++;
208 + mSecondsHandler.postDelayed(this, 1000);
209 + }
210 + });
211 + mDfyPressed = false;
212 + mDealsBannerPressed = false;
213 + mQuestionnairePressed = false;
214 + mHistoryPressed = false;
215 + mHistoryMarketPressed = false;
216 + mUnifiedPressed = false;
217 + mCouponPressed = false;
218 + mHistoryBadgePressed = false;
219 + mGiftsCountPressed = false;
220 + mUnifiedCountPressed = false;
221 + initViews();
222 + }
223 +
224 + @Override
225 + public void onPause() {
226 + super.onPause();
227 + if (mSecondsHandler != null) {
228 + mSecondsHandler.removeCallbacksAndMessages(null);
229 +
230 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
231 + analyticsEvent.setEventName("time_spent_on_loyalty_sdk");
232 + analyticsEvent.setParameter("name", "MyRewards");
233 + analyticsEvent.setParameter("seconds", String.valueOf(mTimer));
234 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
235 + }
236 + }
237 +
238 + @Override
239 + public void onClick(View view) {
240 + if (view.getId() == R.id.ll_user_questionnaire || view.getId() == R.id.ll_user_badge) {
241 + if (!WarplyManagerHelper.noInternetDialog(getContext(), true)) {
242 + if (getActivity() != null && !getActivity().isFinishing()) {
243 + WarplyManagerHelper.noInternetDialog(getActivity());
244 + }
245 + return;
246 + }
247 + if (!mQuestionnairePressed) {
248 + mQuestionnairePressed = true;
249 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
250 + .concat(":")
251 + .concat("Questionnaire"));
252 +
253 + startActivityForResult(WarpViewActivity.createIntentFromURL(getContext(), WarplyManagerHelper.openQuestionnaire()), 1000);
254 + }
255 + return;
256 + }
257 + /** Deals History */
258 + if (view.getId() == R.id.cl_deals_win_inner_cos) {
259 + if (!mDealsBannerPressed) {
260 + mDealsBannerPressed = true;
261 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
262 + .concat(":")
263 + .concat("DealsBanner"));
264 +
265 + WarplyDealsAnalysisEventModel warplyDealsAnalysisEventModel = new WarplyDealsAnalysisEventModel();
266 + warplyDealsAnalysisEventModel.setPressed(true);
267 + EventBus.getDefault().post(new WarplyEventBusManager(warplyDealsAnalysisEventModel));
268 +
269 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
270 + analyticsEvent.setEventName("did_tap_deals_for_you_badge");
271 + analyticsEvent.setParameter("screen", "Loyalty Wallet");
272 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
273 + }
274 + return;
275 + }
276 + /** Active Unified Banner */
277 + if (view.getId() == R.id.rv_sm_count) {
278 + if (!mUnifiedCountPressed) {
279 + mUnifiedCountPressed = true;
280 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
281 + .concat(":")
282 + .concat("ActiveMarketBanner"));
283 +
284 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
285 + analyticsEvent.setEventName("did_tap_market_active_badge");
286 + analyticsEvent.setParameter("screen", "Loyalty Wallet");
287 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
288 +
289 + Intent intent = new Intent(getContext(), ActiveUnifiedCouponsActivity.class);
290 + startActivity(intent);
291 + }
292 + return;
293 + }
294 + /** Active Coupons Banner */
295 + if (view.getId() == R.id.rv_gifts_count) {
296 + if (!mGiftsCountPressed) {
297 + mGiftsCountPressed = true;
298 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
299 + .concat(":")
300 + .concat("ActiveLoyaltyBanner"));
301 +
302 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
303 + analyticsEvent.setEventName("did_tap_gifts_for_you_active_badge");
304 + analyticsEvent.setParameter("screen", "Loyalty Wallet");
305 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
306 +
307 + Intent intent = new Intent(getContext(), ActiveCouponsActivity.class);
308 + startActivity(intent);
309 + }
310 + return;
311 + }
312 + /** Coupons History */
313 + if (view.getId() == R.id.cl_deals_win_inner) {
314 + if (!mHistoryPressed) {
315 + mHistoryPressed = true;
316 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
317 + .concat(":")
318 + .concat("LoyaltyBanner"));
319 +
320 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
321 + analyticsEvent.setEventName("did_tap_gifts_for_you_badge");
322 + analyticsEvent.setParameter("screen", "Loyalty Wallet");
323 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
324 +
325 + Intent intent = new Intent(getContext(), LoyaltyAnalysisActivity.class);
326 + startActivity(intent);
327 + }
328 + return;
329 + }
330 + if (view.getId() == R.id.cl_exp) {
331 + if (!mIsStayCollapsed) {
332 + mElGifts.toggle(true);
333 + if (mElGifts.isExpanded()) {
334 + mIvExpArrow.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_up_dark_new));
335 + } else {
336 + mIvExpArrow.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_down_dark_new));
337 + }
338 + }
339 + return;
340 + }
341 + /** Unified History */
342 + if (view.getId() == R.id.cl_market_inner) {
343 + if (!mHistoryMarketPressed) {
344 + mHistoryMarketPressed = true;
345 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
346 + .concat(":")
347 + .concat("MarketBanner"));
348 +
349 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
350 + analyticsEvent.setEventName("did_tap_market_badge");
351 + analyticsEvent.setParameter("screen", "Loyalty Wallet");
352 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
353 +
354 + Intent intent = new Intent(getContext(), LoyaltyMarketAnalysisActivity.class);
355 + startActivity(intent);
356 + }
357 + return;
358 + }
359 + /** New History */
360 + if (view.getId() == R.id.ll_loyalty_history) {
361 + if (!mHistoryBadgePressed) {
362 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
363 + .concat(":")
364 + .concat("LoyaltyHistoryBadge"));
365 +
366 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
367 + analyticsEvent.setEventName("did_tap_history_badge");
368 + analyticsEvent.setParameter("screen", "Loyalty Wallet");
369 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
370 +
371 + Intent intent = new Intent(getContext(), LoyaltyHistoryActivity.class);
372 + startActivity(intent);
373 + }
374 + return;
375 + }
376 + /** Vouchers Client's Screen */
377 + if (view.getId() == R.id.cv_vouchers || view.getId() == R.id.cv_vouchers_disabled) {
378 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
379 + .concat(":")
380 + .concat("VouchersBadge"));
381 +
382 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
383 + analyticsEvent.setEventName("did_tap_vouchers_badge");
384 + analyticsEvent.setParameter("screen", "Loyalty Wallet");
385 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
386 +
387 + VouchersActivityEventModel vouchersActivity = new VouchersActivityEventModel();
388 + EventBus.getDefault().post(new WarplyEventBusManager(vouchersActivity));
389 + return;
390 + }
391 + /** Active Deals Banner */
392 + if (view.getId() == R.id.cl_mygifts || view.getId() == R.id.rv_deals_count) {
393 + if (!mDfyPressed) {
394 + mDfyPressed = true;
395 + WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
396 + .concat(":")
397 + .concat("ActiveDealsBanner"));
398 +
399 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
400 + analyticsEvent.setEventName("did_tap_deals_for_you_active_badge");
401 + analyticsEvent.setParameter("screen", "Loyalty Wallet");
402 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
403 +
404 + ActiveDFYCouponEventModel activeCouponEventModel = new ActiveDFYCouponEventModel();
405 + activeCouponEventModel.setPressed(true);
406 + EventBus.getDefault().post(new WarplyEventBusManager(activeCouponEventModel));
407 + }
408 + }
409 + }
410 +
411 + @Override
412 + public void onActivityResult(int requestCode, int resultCode, Intent data) {
413 +// super.onActivityResult(requestCode, resultCode, data);
414 + if (requestCode == 1000) {
415 + if (resultCode == RESULT_OK) {
416 + if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag(getContext()))) {
417 + mTvUserBadge.setText(WarplyManagerHelper.getUserTag(getContext()));
418 + mLlQuestionnaire.setVisibility(View.GONE);
419 + mLlUserBadge.setVisibility(View.VISIBLE);
420 + } else {
421 + mLlUserBadge.setVisibility(View.GONE);
422 + mLlQuestionnaire.setVisibility(View.VISIBLE);
423 + }
424 + }
425 + }
426 + }
427 +
428 + @Subscribe()
429 + public void onMessageEvent(WarplyEventBusManager event) {
430 + if (event.getVouchersServiceUnavailableEventModel() != null) {
431 +
432 + Handler mUIHandler = new Handler(Looper.getMainLooper());
433 + mUIHandler.post(new Runnable() {
434 + @Override
435 + public void run() {
436 + vouchersServiceUnavailableDialog();
437 + }
438 + });
439 + return;
440 + }
441 + if (event.getVouchersFetched() != null) {
442 + /** Vouchers */
443 + Handler mUIHandler = new Handler(Looper.getMainLooper());
444 + mUIHandler.post(new Runnable() {
445 + @Override
446 + public void run() {
447 + checkForEmpty();
448 + }
449 + });
450 + /** Vouchers */
451 + return;
452 + }
453 + if (event.getUnifiedCouponsAdded() != null) {
454 + Handler mUIHandler = new Handler(Looper.getMainLooper());
455 + mUIHandler.post(new Runnable() {
456 + @Override
457 + public void run() {
458 + if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0)
459 + mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size()));
460 + else
461 + mTvUnifiedCountBadge.setText("0");
462 + checkForEmpty();
463 + }
464 + });
465 + return;
466 + }
467 + if (event.getCouponsAdded() != null) {
468 + Handler mUIHandler = new Handler(Looper.getMainLooper());
469 + mUIHandler.post(new Runnable() {
470 + @Override
471 + public void run() {
472 + if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0)
473 + mTvGiftsCountBadge.setText(String.valueOf(WarplyManagerHelper.getCouponList().size()));
474 + else
475 + mTvGiftsCountBadge.setText("0");
476 + checkForEmpty();
477 + }
478 + });
479 + }
480 + }
481 +
482 + // ===========================================================
483 + // Methods
484 + // ===========================================================
485 +
486 + private void initViews() {
487 + if (WarpUtils.getUserNonTelco(getContext())) {
488 + nonTelcoDialog();
489 + }
490 +
491 + /** Unified Coupons List */
492 + if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0)
493 + mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size()));
494 + else
495 + mTvUnifiedCountBadge.setText("0");
496 + /** Unified Coupons List */
497 +
498 + /** Coupon List */
499 + if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0)
500 + mTvGiftsCountBadge.setText(String.valueOf(WarplyManagerHelper.getCouponList().size()));
501 + else
502 + mTvGiftsCountBadge.setText("0");
503 + /** Coupon List */
504 +
505 + /** Deals Badge */
506 + if (WarplyManagerHelper.getActiveDFYCoupons() != null)
507 + mTvDealsCountBadge.setText(String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size()));
508 + else
509 + mTvDealsCountBadge.setText("0");
510 + /** Deals Badge */
511 +
512 + if (WarplyManagerHelper.getConsumer() != null) {
513 + mTvUsername.setText(String.format(getResources().getString(R.string.cos_profile_loyalty_name),
514 + WarplyManagerHelper.getConsumer().getFirstName(), WarplyManagerHelper.getConsumer().getLastName()));
515 +
516 + if (!TextUtils.isEmpty(WarplyManagerHelper.getConsumer().getImageUrl()) && !WarplyManagerHelper.getConsumer().getImageUrl().equals("null")) {
517 + Glide.with(this)
518 + .load(WarplyManagerHelper.getConsumer().getImageUrl())
519 + .diskCacheStrategy(DiskCacheStrategy.DATA)
520 + .into(mIvProfilePhoto);
521 + } else {
522 + Glide.with(this)
523 + .load(R.drawable.ic_default_photo)
524 + .into(mIvProfilePhoto);
525 + }
526 +
527 + if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag(getContext()))) {
528 + mTvUserBadge.setText(WarplyManagerHelper.getUserTag(getContext()));
529 + mLlQuestionnaire.setVisibility(View.GONE);
530 + mLlUserBadge.setVisibility(View.VISIBLE);
531 + } else {
532 + mLlUserBadge.setVisibility(View.GONE);
533 + mLlQuestionnaire.setVisibility(View.VISIBLE);
534 + }
535 + }
536 +
537 + /** Empty View */
538 + checkForEmpty();
539 + /** Empty View */
540 +
541 + mLlQuestionnaire.setOnClickListener(this);
542 + mLlUserBadge.setOnClickListener(this);
543 + mClDealsBanner.setOnClickListener(this);
544 + mClGiftsBanner.setOnClickListener(this);
545 + mClDealsView.setOnClickListener(this);
546 + mClExp.setOnClickListener(this);
547 + mClMarket.setOnClickListener(this);
548 + mLlHistory.setOnClickListener(this);
549 + mRlDeals.setOnClickListener(this);
550 + mRlUnified.setOnClickListener(this);
551 + mRlGifts.setOnClickListener(this);
552 + mCvVouchers.setOnClickListener(this);
553 + mCvVouchersDisabled.setOnClickListener(this);
554 + }
555 +
556 + private void nonTelcoDialog() {
557 + if (getActivity() != null && !getActivity().isFinishing()) {
558 + mAlertDialogNonTelco = new AlertDialog.Builder(getActivity())
559 + .setTitle(R.string.cos_dlg_non_telco_title)
560 + .setMessage(R.string.cos_dlg_non_telco)
561 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
562 + dialogPositive.dismiss();
563 + })
564 + .setCancelable(false)
565 + .show();
566 + }
567 + }
568 +
569 + private void vouchersServiceUnavailableDialog() {
570 + if (getActivity() != null && !getActivity().isFinishing()) {
571 + mLlVouchersSpinner.setVisibility(View.GONE);
572 + mAlertDialogVouchersService = new AlertDialog.Builder(getActivity())
573 + .setTitle(R.string.cos_dlg_try_again)
574 + .setMessage(R.string.cos_dlg_service_unavailable)
575 + .setPositiveButton(R.string.cos_dlg_return, (dialogPositive, whichPositive) -> {
576 + dialogPositive.dismiss();
577 + })
578 + .setCancelable(false)
579 + .show();
580 + }
581 + }
582 +
583 + private void checkForEmpty() {
584 + if (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()) || (!TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()) && WarplyManagerHelper.getShowVouchersBanner().equals("null"))) {
585 + /** Show spinner only if empty */
586 + mLlVouchers.setVisibility(View.GONE);
587 + mSeparator.setVisibility(View.VISIBLE);
588 + if (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()))
589 + mLlVouchersSpinner.setVisibility(View.VISIBLE);
590 + if (!TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()) && WarplyManagerHelper.getShowVouchersBanner().equals("null"))
591 + mLlVouchersSpinner.setVisibility(View.GONE);
592 + if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
593 + && (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
594 + && (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
595 + /** Hide all and show empty view */
596 + mLlVouchers.setVisibility(View.GONE);
597 + mLlVouchersSpinner.setVisibility(View.GONE);
598 + mSeparator.setVisibility(View.VISIBLE);
599 + mLlEmptyWallet.setVisibility(View.VISIBLE);
600 + } else {
601 + /** Show loyalty banners and hide empty view
602 + * Show spinner only if empty */
603 + mLlEmptyWallet.setVisibility(View.GONE);
604 + mLlBannerInfo.setVisibility(View.VISIBLE);
605 + }
606 + } else {
607 + if (WarplyManagerHelper.getShowVouchersBanner().equals("true")) {
608 + /** Hide spinner and hide empty view and show vouchers and hide disabled vouchers */
609 + mLlVouchersSpinner.setVisibility(View.GONE);
610 + mLlEmptyWallet.setVisibility(View.GONE);
611 + if (TextUtils.isEmpty(WarpUtils.getLanguage(getContext())) || WarpUtils.getLanguage(getContext()).equals("el")) {
612 + mTvVouchersTitle.setText(getString(R.string.cos_vouchers_title));
613 + mTvVouchersSubtitle.setText(getString(R.string.cos_vouchers_info_title));
614 + } else {
615 + mTvVouchersTitle.setText(getString(R.string.cos_vouchers_title_en));
616 + mTvVouchersSubtitle.setText(getString(R.string.cos_vouchers_info_title_en));
617 + }
618 + mLlVouchers.setVisibility(View.VISIBLE);
619 + mLlVouchersDisabled.setVisibility(View.GONE);
620 + mSeparatorDisabled.setVisibility(View.VISIBLE);
621 + if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
622 + && (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
623 + && (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
624 + /** Hide loyalty banners and hide separator */
625 + mSeparator.setVisibility(View.GONE);
626 + mLlBannerInfo.setVisibility(View.GONE);
627 + } else {
628 + /** Show loyalty banners and show separator */
629 + mSeparator.setVisibility(View.VISIBLE);
630 + mLlBannerInfo.setVisibility(View.VISIBLE);
631 + }
632 + } else if (WarplyManagerHelper.getShowVouchersBanner().equals("false")) {
633 + /** Hide spinner and hide vouchers and hide empty view and show disabled vouchers and show disabled separator */
634 + mLlVouchersSpinner.setVisibility(View.GONE);
635 + mLlEmptyWallet.setVisibility(View.GONE);
636 + mLlVouchers.setVisibility(View.GONE);
637 + mSeparator.setVisibility(View.VISIBLE);
638 + if (TextUtils.isEmpty(WarpUtils.getLanguage(getContext())) || WarpUtils.getLanguage(getContext()).equals("el")) {
639 + mTvVouchersDisabledTitle.setText(getString(R.string.cos_vouchers_title));
640 + mTvVouchersDisabledSubtitle.setText(getString(R.string.cos_vouchers_info_title_disabled));
641 + } else {
642 + mTvVouchersDisabledTitle.setText(getString(R.string.cos_vouchers_title_en));
643 + mTvVouchersDisabledSubtitle.setText(getString(R.string.cos_vouchers_info_title_disabled_en));
644 + }
645 + mLlVouchersDisabled.setVisibility(View.VISIBLE);
646 + mSeparatorDisabled.setVisibility(View.VISIBLE);
647 + if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
648 + && (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
649 + && (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
650 + /** Hide loyalty banners and hide empty view and hide disabled separator */
651 + mLlBannerInfo.setVisibility(View.GONE);
652 + mLlEmptyWallet.setVisibility(View.GONE);
653 + mSeparatorDisabled.setVisibility(View.GONE);
654 + } else {
655 + /** Show loyalty banners and show disabled separator */
656 + mLlBannerInfo.setVisibility(View.VISIBLE);
657 + mSeparatorDisabled.setVisibility(View.VISIBLE);
658 + }
659 + }
660 + }
661 + }
662 +
663 + // ===========================================================
664 + // Inner and Anonymous Classes
665 + // ===========================================================
666 +
667 +}
1 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 + xmlns:app="http://schemas.android.com/apk/res-auto"
3 + xmlns:tools="http://schemas.android.com/tools"
4 + android:layout_width="match_parent"
5 + android:layout_height="match_parent"
6 + android:background="@color/cos_light_grey3">
7 +
8 + <androidx.core.widget.NestedScrollView
9 + android:layout_width="match_parent"
10 + android:layout_height="match_parent"
11 + android:fillViewport="true"
12 + android:overScrollMode="never"
13 + android:scrollbars="none">
14 +
15 + <LinearLayout
16 + android:layout_width="match_parent"
17 + android:layout_height="wrap_content"
18 + android:orientation="vertical">
19 +
20 + <RelativeLayout
21 + android:layout_width="match_parent"
22 + android:layout_height="wrap_content"
23 + android:background="@android:color/white"
24 + android:orientation="vertical">
25 +
26 + <androidx.constraintlayout.widget.ConstraintLayout
27 + android:id="@+id/ll_first_view"
28 + android:layout_width="match_parent"
29 + android:layout_height="wrap_content"
30 + android:paddingVertical="24dp"
31 + android:paddingHorizontal="16dp">
32 +
33 + <com.google.android.material.imageview.ShapeableImageView
34 + android:id="@+id/iv_profile_photo"
35 + android:layout_width="74dp"
36 + android:layout_height="74dp"
37 + android:padding="1dp"
38 + android:src="@drawable/ic_default_photo"
39 + app:layout_constraintBottom_toBottomOf="parent"
40 + app:layout_constraintStart_toStartOf="parent"
41 + app:layout_constraintTop_toTopOf="parent"
42 + app:shapeAppearanceOverlay="@style/ShapeAppearanceProfileImage"
43 + app:strokeColor="@color/cos_grey2"
44 + app:strokeWidth="1dp" />
45 +
46 + <LinearLayout
47 + android:layout_width="0dp"
48 + android:layout_height="wrap_content"
49 + android:layout_marginStart="8dp"
50 + android:orientation="vertical"
51 + app:layout_constraintBottom_toBottomOf="parent"
52 + app:layout_constraintEnd_toEndOf="parent"
53 + app:layout_constraintStart_toEndOf="@+id/iv_profile_photo"
54 + app:layout_constraintTop_toTopOf="parent">
55 +
56 + <TextView
57 + android:id="@+id/tv_profile_name"
58 + fontPath="fonts/PeridotPE-SemiBold.ttf"
59 + android:layout_width="wrap_content"
60 + android:layout_height="wrap_content"
61 + android:layout_marginBottom="4dp"
62 + android:includeFontPadding="false"
63 + android:maxLines="1"
64 + android:textColor="@color/cos_light_black"
65 + android:textSize="22sp"
66 + tools:text="Test Name" />
67 +
68 + <LinearLayout
69 + android:layout_width="match_parent"
70 + android:layout_height="wrap_content"
71 + android:orientation="horizontal">
72 +
73 + <LinearLayout
74 + android:id="@+id/ll_user_badge"
75 + android:layout_width="wrap_content"
76 + android:layout_height="42dp"
77 + android:background="@drawable/selector_button_green_border"
78 + android:gravity="center"
79 + android:visibility="gone"
80 + tools:visibility="gone">
81 +
82 + <TextView
83 + android:id="@+id/tv_type"
84 + fontPath="fonts/PeridotPE-SemiBold.ttf"
85 + android:layout_width="wrap_content"
86 + android:layout_height="wrap_content"
87 + android:layout_marginHorizontal="20dp"
88 + android:includeFontPadding="false"
89 + android:textColor="@color/cos_green12"
90 + android:textSize="16sp"
91 + tools:text="@string/cos_profile_preferences_placeholder" />
92 + </LinearLayout>
93 +
94 + <LinearLayout
95 + android:id="@+id/ll_user_questionnaire"
96 + android:layout_width="160dp"
97 + android:layout_height="42dp"
98 + android:background="@drawable/selector_button_green_border"
99 + android:gravity="center"
100 + android:visibility="gone"
101 + tools:visibility="visible">
102 +
103 + <ImageView
104 + android:layout_width="16dp"
105 + android:layout_height="16dp"
106 + android:layout_marginEnd="4dp"
107 + android:src="@drawable/sv_plus_sign_green" />
108 +
109 + <TextView
110 + android:id="@+id/tv_questionnaire"
111 + fontPath="fonts/PeridotPE-Bold.ttf"
112 + android:layout_width="wrap_content"
113 + android:layout_height="wrap_content"
114 + android:includeFontPadding="false"
115 + android:text="@string/cos_profile_preferences"
116 + android:textColor="@color/cos_green12"
117 + android:textSize="16sp" />
118 + </LinearLayout>
119 +
120 + <LinearLayout
121 + android:id="@+id/ll_loyalty_history"
122 + android:layout_width="52dp"
123 + android:layout_height="42dp"
124 + android:layout_marginStart="4dp"
125 + android:background="@drawable/selector_button_green_border"
126 + android:gravity="center"
127 + android:orientation="vertical">
128 +
129 + <ImageView
130 + android:layout_width="16dp"
131 + android:layout_height="16dp"
132 + android:src="@drawable/sv_history" />
133 + </LinearLayout>
134 + </LinearLayout>
135 + </LinearLayout>
136 + </androidx.constraintlayout.widget.ConstraintLayout>
137 + </RelativeLayout>
138 +
139 + <RelativeLayout
140 + android:layout_width="match_parent"
141 + android:layout_height="wrap_content">
142 +
143 + <LinearLayout
144 + android:id="@+id/ll_second_view"
145 + android:layout_width="match_parent"
146 + android:layout_height="match_parent"
147 + android:gravity="center_horizontal"
148 + android:orientation="vertical">
149 +
150 + <LinearLayout
151 + android:id="@+id/ll_banner_info_new"
152 + android:layout_width="match_parent"
153 + android:layout_height="wrap_content"
154 + android:layout_marginHorizontal="14dp"
155 + android:layout_marginTop="16dp"
156 + android:orientation="vertical"
157 + android:visibility="gone"
158 + tools:visibility="visible">
159 +
160 + <TextView
161 + android:id="@+id/tv_coupons_header"
162 + fontPath="fonts/PeridotPE-SemiBold.ttf"
163 + android:layout_width="wrap_content"
164 + android:layout_height="wrap_content"
165 + android:includeFontPadding="false"
166 + android:maxLines="1"
167 + android:text="@string/cos_coupons_loyalty_title"
168 + android:textColor="@color/cos_light_black"
169 + android:textSize="22sp" />
170 +
171 + <androidx.constraintlayout.widget.ConstraintLayout
172 + android:layout_width="match_parent"
173 + android:layout_height="wrap_content"
174 + android:layout_marginTop="18dp">
175 +
176 + <RelativeLayout
177 + android:id="@+id/rv_deals_count"
178 + android:layout_width="0dp"
179 + android:layout_height="104dp"
180 + app:layout_constraintBottom_toBottomOf="parent"
181 + app:layout_constraintEnd_toStartOf="@+id/rv_sm_count"
182 + app:layout_constraintStart_toStartOf="parent"
183 + app:layout_constraintTop_toTopOf="parent">
184 +
185 + <androidx.cardview.widget.CardView
186 + android:id="@+id/cv_deals_count"
187 + android:layout_width="match_parent"
188 + android:layout_height="match_parent"
189 + android:layout_marginHorizontal="2dp"
190 + android:layout_marginVertical="4dp"
191 + app:cardCornerRadius="16dp"
192 + app:cardElevation="2dp">
193 +
194 + <androidx.constraintlayout.widget.ConstraintLayout
195 + android:layout_width="match_parent"
196 + android:layout_height="match_parent"
197 + android:background="@color/cos_green_tr">
198 +
199 + <ImageView
200 + android:id="@+id/iv_deals_logo_count"
201 + android:layout_width="52dp"
202 + android:layout_height="32dp"
203 + android:src="@drawable/sv_deals_logo_redesign"
204 + app:layout_constraintBottom_toTopOf="@+id/v_separator_deals_count"
205 + app:layout_constraintEnd_toEndOf="parent"
206 + app:layout_constraintStart_toStartOf="parent"
207 + app:layout_constraintTop_toTopOf="parent" />
208 +
209 + <View
210 + android:id="@+id/v_separator_deals_count"
211 + android:layout_width="match_parent"
212 + android:layout_height="1dp"
213 + android:layout_marginHorizontal="8dp"
214 + android:background="@color/cos_grey2"
215 + app:layout_constraintBottom_toBottomOf="parent"
216 + app:layout_constraintEnd_toEndOf="parent"
217 + app:layout_constraintStart_toStartOf="parent"
218 + app:layout_constraintTop_toTopOf="parent" />
219 +
220 + <TextView
221 + android:id="@+id/tv_deals_count_title"
222 + fontPath="fonts/PeridotPE-SemiBold.ttf"
223 + android:layout_width="0dp"
224 + android:layout_height="wrap_content"
225 + android:layout_marginHorizontal="8dp"
226 + android:gravity="center"
227 + android:includeFontPadding="false"
228 + android:text="@string/cos_deals_title2"
229 + android:textColor="@color/cos_light_black"
230 + android:textSize="10sp"
231 + app:layout_constraintBottom_toBottomOf="parent"
232 + app:layout_constraintEnd_toEndOf="parent"
233 + app:layout_constraintStart_toStartOf="parent"
234 + app:layout_constraintTop_toBottomOf="@+id/v_separator_deals_count" />
235 + </androidx.constraintlayout.widget.ConstraintLayout>
236 + </androidx.cardview.widget.CardView>
237 +
238 + <LinearLayout
239 + android:layout_width="16dp"
240 + android:layout_height="16dp"
241 + android:layout_alignParentEnd="true"
242 + android:layout_marginTop="4dp"
243 + android:layout_marginEnd="1dp"
244 + android:background="@drawable/shape_cos_counter_orange"
245 + android:gravity="center"
246 + android:orientation="vertical"
247 + android:translationZ="2dp"
248 + app:layout_constraintEnd_toEndOf="parent"
249 + app:layout_constraintTop_toTopOf="parent">
250 +
251 + <TextView
252 + android:id="@+id/tv_deals_count"
253 + fontPath="fonts/PeridotPE-SemiBold.ttf"
254 + android:layout_width="wrap_content"
255 + android:layout_height="16dp"
256 + android:includeFontPadding="false"
257 + android:maxLines="1"
258 + android:textColor="@color/cos_light_black"
259 + android:textSize="12sp"
260 + tools:text="6" />
261 + </LinearLayout>
262 + </RelativeLayout>
263 +
264 + <RelativeLayout
265 + android:id="@+id/rv_sm_count"
266 + android:layout_width="0dp"
267 + android:layout_height="104dp"
268 + android:layout_marginHorizontal="12dp"
269 + app:layout_constraintBottom_toBottomOf="parent"
270 + app:layout_constraintEnd_toStartOf="@+id/rv_gifts_count"
271 + app:layout_constraintStart_toEndOf="@+id/rv_deals_count"
272 + app:layout_constraintTop_toTopOf="parent">
273 +
274 + <androidx.cardview.widget.CardView
275 + android:id="@+id/cv_sm_count"
276 + android:layout_width="match_parent"
277 + android:layout_height="match_parent"
278 + android:layout_marginHorizontal="2dp"
279 + android:layout_marginVertical="4dp"
280 + app:cardCornerRadius="16dp"
281 + app:cardElevation="2dp">
282 +
283 + <androidx.constraintlayout.widget.ConstraintLayout
284 + android:layout_width="match_parent"
285 + android:layout_height="match_parent"
286 + android:background="@color/cos_creme">
287 +
288 + <ImageView
289 + android:id="@+id/iv_sm_logo_count"
290 + android:layout_width="32dp"
291 + android:layout_height="32dp"
292 + android:src="@drawable/sv_unified_redesign"
293 + app:layout_constraintBottom_toTopOf="@+id/v_separator_sm_count"
294 + app:layout_constraintEnd_toEndOf="parent"
295 + app:layout_constraintStart_toStartOf="parent"
296 + app:layout_constraintTop_toTopOf="parent" />
297 +
298 + <View
299 + android:id="@+id/v_separator_sm_count"
300 + android:layout_width="match_parent"
301 + android:layout_height="1dp"
302 + android:layout_marginHorizontal="8dp"
303 + android:background="@color/cos_grey2"
304 + app:layout_constraintBottom_toBottomOf="parent"
305 + app:layout_constraintEnd_toEndOf="parent"
306 + app:layout_constraintStart_toStartOf="parent"
307 + app:layout_constraintTop_toTopOf="parent" />
308 +
309 + <TextView
310 + android:id="@+id/tv_sm_count_title"
311 + fontPath="fonts/PeridotPE-SemiBold.ttf"
312 + android:layout_width="0dp"
313 + android:layout_height="wrap_content"
314 + android:layout_marginHorizontal="8dp"
315 + android:gravity="center"
316 + android:includeFontPadding="false"
317 + android:text="@string/cos_market_title"
318 + android:textColor="@color/cos_light_black"
319 + android:textSize="10sp"
320 + app:layout_constraintBottom_toBottomOf="parent"
321 + app:layout_constraintEnd_toEndOf="parent"
322 + app:layout_constraintStart_toStartOf="parent"
323 + app:layout_constraintTop_toBottomOf="@+id/v_separator_sm_count" />
324 + </androidx.constraintlayout.widget.ConstraintLayout>
325 + </androidx.cardview.widget.CardView>
326 +
327 + <LinearLayout
328 + android:layout_width="16dp"
329 + android:layout_height="16dp"
330 + android:layout_alignParentEnd="true"
331 + android:layout_marginTop="4dp"
332 + android:layout_marginEnd="1dp"
333 + android:background="@drawable/shape_cos_counter_orange"
334 + android:gravity="center"
335 + android:orientation="vertical"
336 + android:translationZ="2dp"
337 + app:layout_constraintEnd_toEndOf="parent"
338 + app:layout_constraintTop_toTopOf="parent">
339 +
340 + <TextView
341 + android:id="@+id/tv_sm_count"
342 + fontPath="fonts/PeridotPE-SemiBold.ttf"
343 + android:layout_width="wrap_content"
344 + android:layout_height="16dp"
345 + android:includeFontPadding="false"
346 + android:maxLines="1"
347 + android:textColor="@color/cos_light_black"
348 + android:textSize="12sp"
349 + tools:text="6" />
350 + </LinearLayout>
351 + </RelativeLayout>
352 +
353 + <RelativeLayout
354 + android:id="@+id/rv_gifts_count"
355 + android:layout_width="0dp"
356 + android:layout_height="104dp"
357 + app:layout_constraintBottom_toBottomOf="parent"
358 + app:layout_constraintEnd_toEndOf="parent"
359 + app:layout_constraintStart_toEndOf="@+id/rv_sm_count"
360 + app:layout_constraintTop_toTopOf="parent">
361 +
362 + <androidx.cardview.widget.CardView
363 + android:id="@+id/cv_gifts_count"
364 + android:layout_width="match_parent"
365 + android:layout_height="match_parent"
366 + android:layout_marginHorizontal="2dp"
367 + android:layout_marginVertical="4dp"
368 + app:cardCornerRadius="16dp"
369 + app:cardElevation="2dp">
370 +
371 + <androidx.constraintlayout.widget.ConstraintLayout
372 + android:layout_width="match_parent"
373 + android:layout_height="match_parent"
374 + android:background="@color/cos_skyblue5">
375 +
376 + <ImageView
377 + android:id="@+id/iv_gifts_logo_count"
378 + android:layout_width="34dp"
379 + android:layout_height="34dp"
380 + android:src="@drawable/sv_gifts_redesign"
381 + app:layout_constraintBottom_toTopOf="@+id/v_separator_gifts_count"
382 + app:layout_constraintEnd_toEndOf="parent"
383 + app:layout_constraintStart_toStartOf="parent"
384 + app:layout_constraintTop_toTopOf="parent" />
385 +
386 + <View
387 + android:id="@+id/v_separator_gifts_count"
388 + android:layout_width="match_parent"
389 + android:layout_height="1dp"
390 + android:layout_marginHorizontal="8dp"
391 + android:background="@color/cos_grey2"
392 + app:layout_constraintBottom_toBottomOf="parent"
393 + app:layout_constraintEnd_toEndOf="parent"
394 + app:layout_constraintStart_toStartOf="parent"
395 + app:layout_constraintTop_toTopOf="parent" />
396 +
397 + <TextView
398 + android:id="@+id/tv_gifts_count_title"
399 + fontPath="fonts/PeridotPE-SemiBold.ttf"
400 + android:layout_width="0dp"
401 + android:layout_height="wrap_content"
402 + android:layout_marginHorizontal="8dp"
403 + android:gravity="center"
404 + android:includeFontPadding="false"
405 + android:text="@string/cos_gifts_title"
406 + android:textColor="@color/cos_light_black"
407 + android:textSize="10sp"
408 + app:layout_constraintBottom_toBottomOf="parent"
409 + app:layout_constraintEnd_toEndOf="parent"
410 + app:layout_constraintStart_toStartOf="parent"
411 + app:layout_constraintTop_toBottomOf="@+id/v_separator_gifts_count" />
412 + </androidx.constraintlayout.widget.ConstraintLayout>
413 + </androidx.cardview.widget.CardView>
414 +
415 + <LinearLayout
416 + android:layout_width="16dp"
417 + android:layout_height="16dp"
418 + android:layout_alignParentEnd="true"
419 + android:layout_marginTop="4dp"
420 + android:layout_marginEnd="1dp"
421 + android:background="@drawable/shape_cos_counter_orange"
422 + android:gravity="center"
423 + android:orientation="vertical"
424 + android:translationZ="2dp"
425 + app:layout_constraintEnd_toEndOf="parent"
426 + app:layout_constraintTop_toTopOf="parent">
427 +
428 + <TextView
429 + android:id="@+id/tv_gifts_count"
430 + fontPath="fonts/PeridotPE-SemiBold.ttf"
431 + android:layout_width="wrap_content"
432 + android:layout_height="16dp"
433 + android:includeFontPadding="false"
434 + android:maxLines="1"
435 + android:textColor="@color/cos_light_black"
436 + android:textSize="12sp"
437 + tools:text="6" />
438 + </LinearLayout>
439 + </RelativeLayout>
440 + </androidx.constraintlayout.widget.ConstraintLayout>
441 + </LinearLayout>
442 +
443 + <LinearLayout
444 + android:id="@+id/ll_vouchers_spinner"
445 + android:layout_width="match_parent"
446 + android:layout_height="wrap_content"
447 + android:layout_marginHorizontal="14dp"
448 + android:layout_marginTop="32dp"
449 + android:gravity="center_horizontal"
450 + android:orientation="vertical"
451 + android:visibility="gone"
452 + tools:visibility="visible">
453 +
454 + <ProgressBar
455 + android:id="@+id/pb_vouchers"
456 + android:layout_width="48dp"
457 + android:layout_height="48dp"
458 + android:theme="@style/progressBarGreen" />
459 + </LinearLayout>
460 +
461 + <LinearLayout
462 + android:id="@+id/ll_vouchers"
463 + android:layout_width="match_parent"
464 + android:layout_height="wrap_content"
465 + android:layout_marginHorizontal="14dp"
466 + android:layout_marginTop="32dp"
467 + android:orientation="vertical"
468 + android:visibility="gone"
469 + tools:visibility="gone">
470 +
471 + <View
472 + android:id="@+id/v_separator_vouchers"
473 + android:layout_width="match_parent"
474 + android:layout_height="1dp"
475 + android:background="@color/cos_gray" />
476 +
477 + <TextView
478 + fontPath="fonts/PeridotPE-SemiBold.ttf"
479 + android:id="@+id/tv_vouchers_title"
480 + android:layout_width="wrap_content"
481 + android:layout_height="wrap_content"
482 + android:layout_marginTop="24dp"
483 + android:includeFontPadding="false"
484 + android:maxLines="1"
485 + android:text="@string/cos_vouchers_title"
486 + android:textColor="@color/cos_light_black"
487 + android:textSize="22sp" />
488 +
489 + <androidx.cardview.widget.CardView
490 + android:id="@+id/cv_vouchers"
491 + android:layout_width="match_parent"
492 + android:layout_height="70dp"
493 + android:layout_marginHorizontal="2dp"
494 + android:layout_marginTop="24dp"
495 + android:layout_marginBottom="4dp"
496 + app:cardCornerRadius="16dp"
497 + app:cardElevation="2dp">
498 +
499 + <androidx.constraintlayout.widget.ConstraintLayout
500 + android:layout_width="match_parent"
501 + android:layout_height="match_parent"
502 + android:background="@color/white">
503 +
504 + <ImageView
505 + android:id="@+id/iv_vouchers_logo"
506 + android:layout_width="32dp"
507 + android:layout_height="30dp"
508 + android:layout_marginStart="16dp"
509 + android:src="@drawable/sv_vouchers"
510 + app:layout_constraintBottom_toBottomOf="parent"
511 + app:layout_constraintStart_toStartOf="parent"
512 + app:layout_constraintTop_toTopOf="parent" />
513 +
514 + <TextView
515 + android:id="@+id/tv_vouchers_info_title"
516 + fontPath="fonts/PeridotPE-Regular.ttf"
517 + android:layout_width="0dp"
518 + android:layout_height="wrap_content"
519 + android:layout_marginHorizontal="8dp"
520 + android:includeFontPadding="false"
521 + android:lineHeight="24dp"
522 + android:text="@string/cos_vouchers_info_title"
523 + android:textColor="@color/cos_light_black"
524 + android:textSize="14sp"
525 + app:layout_constraintBottom_toBottomOf="@+id/iv_vouchers_logo"
526 + app:layout_constraintEnd_toStartOf="@+id/iv_vouchers_arrow"
527 + app:layout_constraintHorizontal_bias="0.0"
528 + app:layout_constraintStart_toEndOf="@+id/iv_vouchers_logo"
529 + app:layout_constraintTop_toTopOf="@+id/iv_vouchers_logo" />
530 +
531 + <ImageView
532 + android:id="@+id/iv_vouchers_arrow"
533 + android:layout_width="16dp"
534 + android:layout_height="10dp"
535 + android:layout_marginEnd="16dp"
536 + android:rotation="270"
537 + android:src="@drawable/sv_arrow_down"
538 + app:layout_constraintBottom_toBottomOf="parent"
539 + app:layout_constraintEnd_toEndOf="parent"
540 + app:layout_constraintTop_toTopOf="parent" />
541 + </androidx.constraintlayout.widget.ConstraintLayout>
542 + </androidx.cardview.widget.CardView>
543 + </LinearLayout>
544 +
545 + <LinearLayout
546 + android:id="@+id/ll_vouchers_disabled"
547 + android:layout_width="match_parent"
548 + android:layout_height="wrap_content"
549 + android:layout_marginHorizontal="14dp"
550 + android:layout_marginTop="32dp"
551 + android:orientation="vertical"
552 + android:visibility="gone"
553 + tools:visibility="gone">
554 +
555 + <View
556 + android:id="@+id/v_separator_vouchers_disabled"
557 + android:layout_width="match_parent"
558 + android:layout_height="1dp"
559 + android:background="@color/cos_gray" />
560 +
561 + <TextView
562 + fontPath="fonts/PeridotPE-SemiBold.ttf"
563 + android:id="@+id/tv_vouchers_title_disabled"
564 + android:layout_width="wrap_content"
565 + android:layout_height="wrap_content"
566 + android:layout_marginTop="24dp"
567 + android:includeFontPadding="false"
568 + android:maxLines="1"
569 + android:text="@string/cos_vouchers_title"
570 + android:textColor="@color/cos_light_black"
571 + android:textSize="22sp" />
572 +
573 + <androidx.cardview.widget.CardView
574 + android:id="@+id/cv_vouchers_disabled"
575 + android:layout_width="match_parent"
576 + android:layout_height="70dp"
577 + android:layout_marginHorizontal="2dp"
578 + android:layout_marginTop="24dp"
579 + android:layout_marginBottom="4dp"
580 + app:cardCornerRadius="16dp"
581 + app:cardElevation="2dp">
582 +
583 + <androidx.constraintlayout.widget.ConstraintLayout
584 + android:layout_width="match_parent"
585 + android:layout_height="match_parent"
586 + android:background="@color/white">
587 +
588 + <ImageView
589 + android:id="@+id/iv_vouchers_logo_disabled"
590 + android:layout_width="32dp"
591 + android:layout_height="30dp"
592 + android:layout_marginStart="16dp"
593 + android:src="@drawable/sv_vouchers_disabled"
594 + app:layout_constraintBottom_toBottomOf="parent"
595 + app:layout_constraintStart_toStartOf="parent"
596 + app:layout_constraintTop_toTopOf="parent" />
597 +
598 + <TextView
599 + android:id="@+id/tv_vouchers_info_title_disabled"
600 + fontPath="fonts/PeridotPE-Regular.ttf"
601 + android:layout_width="wrap_content"
602 + android:layout_height="wrap_content"
603 + android:layout_marginHorizontal="8dp"
604 + android:includeFontPadding="false"
605 + android:lineHeight="24dp"
606 + android:text="@string/cos_vouchers_info_title_disabled"
607 + android:textColor="@color/cos_gray2"
608 + android:textSize="14sp"
609 + app:layout_constraintBottom_toBottomOf="@+id/iv_vouchers_logo_disabled"
610 + app:layout_constraintEnd_toStartOf="@+id/iv_vouchers_arrow_disabled"
611 + app:layout_constraintHorizontal_bias="0.0"
612 + app:layout_constraintStart_toEndOf="@+id/iv_vouchers_logo_disabled"
613 + app:layout_constraintTop_toTopOf="@+id/iv_vouchers_logo_disabled" />
614 +
615 + <ImageView
616 + android:id="@+id/iv_vouchers_arrow_disabled"
617 + android:layout_width="16dp"
618 + android:layout_height="10dp"
619 + android:layout_marginEnd="16dp"
620 + android:rotation="270"
621 + android:src="@drawable/sv_arrow_down"
622 + app:layout_constraintBottom_toBottomOf="parent"
623 + app:layout_constraintEnd_toEndOf="parent"
624 + app:layout_constraintTop_toTopOf="parent" />
625 +
626 + <LinearLayout
627 + android:layout_width="16dp"
628 + android:layout_height="16dp"
629 + android:layout_marginStart="2dp"
630 + android:background="@drawable/shape_cos_counter_orange"
631 + android:gravity="center"
632 + android:orientation="vertical"
633 + app:layout_constraintBottom_toTopOf="@+id/tv_vouchers_info_title_disabled"
634 + app:layout_constraintStart_toEndOf="@+id/tv_vouchers_info_title_disabled"
635 + app:layout_constraintTop_toTopOf="@+id/tv_vouchers_info_title_disabled">
636 +
637 + <TextView
638 + android:id="@+id/tv_vouchers_count_disabled"
639 + fontPath="fonts/PeridotPE-SemiBold.ttf"
640 + android:layout_width="wrap_content"
641 + android:layout_height="16dp"
642 + android:includeFontPadding="false"
643 + android:maxLines="1"
644 + android:text="0"
645 + android:textColor="@color/cos_light_black"
646 + android:textSize="12sp" />
647 + </LinearLayout>
648 + </androidx.constraintlayout.widget.ConstraintLayout>
649 + </androidx.cardview.widget.CardView>
650 + </LinearLayout>
651 +
652 + <LinearLayout
653 + android:id="@+id/ll_empty_wallet"
654 + android:layout_width="match_parent"
655 + android:layout_height="wrap_content"
656 + android:layout_marginHorizontal="32dp"
657 + android:layout_marginTop="32dp"
658 + android:gravity="center"
659 + android:orientation="vertical"
660 + android:visibility="gone"
661 + tools:visibility="gone">
662 +
663 + <ImageView
664 + android:layout_width="72dp"
665 + android:layout_height="72dp"
666 + android:src="@drawable/ic_empty_wallet" />
667 +
668 + <TextView
669 + fontPath="fonts/PeridotPE-Regular.ttf"
670 + android:layout_width="wrap_content"
671 + android:layout_height="wrap_content"
672 + android:layout_marginTop="8dp"
673 + android:gravity="center"
674 + android:text="@string/cos_empty_wallet"
675 + android:textColor="@color/cos_light_black"
676 + android:textSize="16sp" />
677 + </LinearLayout>
678 +
679 + <androidx.cardview.widget.CardView
680 + android:id="@+id/cl_exp"
681 + android:layout_width="match_parent"
682 + android:layout_height="wrap_content"
683 + android:layout_marginHorizontal="11dp"
684 + android:layout_marginTop="24dp"
685 + android:visibility="gone"
686 + app:cardCornerRadius="16dp"
687 + app:cardElevation="2dp"
688 + tools:visibility="gone">
689 +
690 + <androidx.constraintlayout.widget.ConstraintLayout
691 + android:layout_width="match_parent"
692 + android:layout_height="wrap_content"
693 + android:background="@color/white"
694 + android:paddingHorizontal="14dp"
695 + android:paddingVertical="14dp">
696 +
697 + <androidx.constraintlayout.widget.Guideline
698 + android:id="@+id/gl_horizontal_64_exp"
699 + android:layout_width="wrap_content"
700 + android:layout_height="match_parent"
701 + android:orientation="horizontal"
702 + app:layout_constraintGuide_percent="0.64" />
703 +
704 + <ImageView
705 + android:id="@+id/iv_exp_logo"
706 + android:layout_width="76dp"
707 + android:layout_height="76dp"
708 + android:layout_marginVertical="4dp"
709 + android:src="@drawable/ic_foryou_polygon_new"
710 + app:layout_constraintBottom_toBottomOf="parent"
711 + app:layout_constraintStart_toStartOf="parent"
712 + app:layout_constraintTop_toTopOf="parent" />
713 +
714 + <TextView
715 + android:id="@+id/tv_exp_value"
716 + fontPath="fonts/PeridotPE-Bold.ttf"
717 + android:layout_width="wrap_content"
718 + android:layout_height="wrap_content"
719 + android:includeFontPadding="false"
720 + android:textColor="@color/cos_light_black"
721 + android:textSize="14sp"
722 + app:layout_constraintEnd_toEndOf="@+id/iv_exp_logo"
723 + app:layout_constraintStart_toStartOf="@+id/iv_exp_logo"
724 + app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_64_exp"
725 + tools:text="18.00€" />
726 +
727 + <TextView
728 + android:id="@+id/tv_exp_value_all"
729 + fontPath="fonts/PeridotPE-Regular.ttf"
730 + android:layout_width="0dp"
731 + android:layout_height="wrap_content"
732 + android:layout_marginHorizontal="8dp"
733 + android:includeFontPadding="false"
734 + android:text="@string/cos_for_you_all"
735 + android:textColor="@color/cos_light_black"
736 + android:textSize="15sp"
737 + app:layout_constraintBottom_toBottomOf="parent"
738 + app:layout_constraintEnd_toStartOf="@+id/iv_exp_arrow"
739 + app:layout_constraintStart_toEndOf="@+id/iv_exp_logo"
740 + app:layout_constraintTop_toTopOf="parent" />
741 +
742 + <ImageView
743 + android:id="@+id/iv_exp_arrow"
744 + android:layout_width="14dp"
745 + android:layout_height="14dp"
746 + android:src="@drawable/ic_down_dark_new"
747 + android:visibility="gone"
748 + app:layout_constraintBottom_toBottomOf="parent"
749 + app:layout_constraintEnd_toEndOf="parent"
750 + app:layout_constraintTop_toTopOf="parent" />
751 + </androidx.constraintlayout.widget.ConstraintLayout>
752 + </androidx.cardview.widget.CardView>
753 +
754 + <net.cachapa.expandablelayout.ExpandableLayout
755 + android:id="@+id/el_exp"
756 + android:layout_width="match_parent"
757 + android:layout_height="wrap_content"
758 + app:el_duration="300"
759 + app:el_expanded="false"
760 + app:el_parallax="0.5">
761 +
762 + <RelativeLayout
763 + android:layout_width="match_parent"
764 + android:layout_height="wrap_content">
765 +
766 + <androidx.cardview.widget.CardView
767 + android:id="@+id/cv_deals_win_inner_cos"
768 + android:layout_width="match_parent"
769 + android:layout_height="wrap_content"
770 + android:layout_marginHorizontal="16dp"
771 + android:layout_marginTop="6dp"
772 + app:cardCornerRadius="16dp"
773 + app:cardElevation="2dp">
774 +
775 + <androidx.constraintlayout.widget.ConstraintLayout
776 + android:id="@+id/cl_deals_win_inner_cos"
777 + android:layout_width="match_parent"
778 + android:layout_height="wrap_content"
779 + android:background="@color/white"
780 + android:paddingHorizontal="6dp"
781 + android:paddingVertical="4dp">
782 +
783 + <androidx.constraintlayout.widget.Guideline
784 + android:id="@+id/gl_horizontal_50_cos"
785 + android:layout_width="wrap_content"
786 + android:layout_height="match_parent"
787 + android:orientation="horizontal"
788 + app:layout_constraintGuide_percent="0.64" />
789 +
790 + <ImageView
791 + android:id="@+id/iv_deals_logo"
792 + android:layout_width="76dp"
793 + android:layout_height="76dp"
794 + android:src="@drawable/ic_deals_polygon_new"
795 + app:layout_constraintBottom_toBottomOf="parent"
796 + app:layout_constraintStart_toStartOf="parent"
797 + app:layout_constraintTop_toTopOf="parent" />
798 +
799 + <TextView
800 + android:id="@+id/tv_deals_value_all"
801 + fontPath="fonts/PeridotPE-Regular.ttf"
802 + android:layout_width="0dp"
803 + android:layout_height="wrap_content"
804 + android:layout_marginHorizontal="8dp"
805 + android:includeFontPadding="false"
806 + android:text="@string/cos_deals_win_title_cos"
807 + android:textColor="@color/cos_light_black"
808 + android:textSize="15sp"
809 + app:layout_constraintBottom_toBottomOf="parent"
810 + app:layout_constraintEnd_toEndOf="parent"
811 + app:layout_constraintStart_toEndOf="@+id/iv_deals_logo"
812 + app:layout_constraintTop_toTopOf="parent" />
813 +
814 + <TextView
815 + android:id="@+id/tv_deals_value"
816 + fontPath="fonts/PeridotPE-Bold.ttf"
817 + android:layout_width="wrap_content"
818 + android:layout_height="wrap_content"
819 + android:includeFontPadding="false"
820 + android:textColor="@color/cos_light_black"
821 + android:textSize="14sp"
822 + app:layout_constraintEnd_toEndOf="@+id/iv_deals_logo"
823 + app:layout_constraintStart_toStartOf="@+id/iv_deals_logo"
824 + app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_50_cos"
825 + tools:text="18.00€" />
826 + </androidx.constraintlayout.widget.ConstraintLayout>
827 + </androidx.cardview.widget.CardView>
828 +
829 + <androidx.cardview.widget.CardView
830 + android:id="@+id/cv_deals_win_inner"
831 + android:layout_width="match_parent"
832 + android:layout_height="wrap_content"
833 + android:layout_below="@+id/cv_deals_win_inner_cos"
834 + android:layout_marginHorizontal="16dp"
835 + android:layout_marginTop="6dp"
836 + app:cardCornerRadius="16dp"
837 + app:cardElevation="2dp">
838 +
839 + <androidx.constraintlayout.widget.ConstraintLayout
840 + android:id="@+id/cl_deals_win_inner"
841 + android:layout_width="match_parent"
842 + android:layout_height="wrap_content"
843 + android:background="@color/white"
844 + android:paddingHorizontal="6dp"
845 + android:paddingVertical="4dp">
846 +
847 + <androidx.constraintlayout.widget.Guideline
848 + android:id="@+id/gl_horizontal_50"
849 + android:layout_width="wrap_content"
850 + android:layout_height="match_parent"
851 + android:orientation="horizontal"
852 + app:layout_constraintGuide_percent="0.64" />
853 +
854 + <ImageView
855 + android:id="@+id/iv_gifts_logo"
856 + android:layout_width="76dp"
857 + android:layout_height="76dp"
858 + android:src="@drawable/ic_gifts_polygon_new"
859 + app:layout_constraintBottom_toBottomOf="parent"
860 + app:layout_constraintStart_toStartOf="parent"
861 + app:layout_constraintTop_toTopOf="parent" />
862 +
863 + <TextView
864 + android:id="@+id/tv_gifts_value_all"
865 + fontPath="fonts/PeridotPE-Regular.ttf"
866 + android:layout_width="0dp"
867 + android:layout_height="wrap_content"
868 + android:layout_marginHorizontal="8dp"
869 + android:includeFontPadding="false"
870 + android:text="@string/cos_deals_win_title"
871 + android:textColor="@color/cos_light_black"
872 + android:textSize="15sp"
873 + app:layout_constraintBottom_toBottomOf="parent"
874 + app:layout_constraintEnd_toEndOf="parent"
875 + app:layout_constraintStart_toEndOf="@+id/iv_gifts_logo"
876 + app:layout_constraintTop_toTopOf="parent" />
877 +
878 + <TextView
879 + android:id="@+id/tv_gifts_value"
880 + fontPath="fonts/PeridotPE-Bold.ttf"
881 + android:layout_width="wrap_content"
882 + android:layout_height="wrap_content"
883 + android:includeFontPadding="false"
884 + android:textColor="@color/cos_light_black"
885 + android:textSize="14sp"
886 + app:layout_constraintEnd_toEndOf="@+id/iv_gifts_logo"
887 + app:layout_constraintStart_toStartOf="@+id/iv_gifts_logo"
888 + app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_50"
889 + tools:text="20.00€" />
890 + </androidx.constraintlayout.widget.ConstraintLayout>
891 + </androidx.cardview.widget.CardView>
892 +
893 + <androidx.cardview.widget.CardView
894 + android:id="@+id/cv_market_inner"
895 + android:layout_width="match_parent"
896 + android:layout_height="wrap_content"
897 + android:layout_below="@+id/cv_deals_win_inner"
898 + android:layout_marginHorizontal="16dp"
899 + android:layout_marginTop="6dp"
900 + android:layout_marginBottom="6dp"
901 + app:cardCornerRadius="16dp"
902 + app:cardElevation="2dp">
903 +
904 + <androidx.constraintlayout.widget.ConstraintLayout
905 + android:id="@+id/cl_market_inner"
906 + android:layout_width="match_parent"
907 + android:layout_height="wrap_content"
908 + android:background="@color/white"
909 + android:paddingHorizontal="6dp"
910 + android:paddingVertical="4dp">
911 +
912 + <androidx.constraintlayout.widget.Guideline
913 + android:id="@+id/gl_horizontal_50_market"
914 + android:layout_width="wrap_content"
915 + android:layout_height="match_parent"
916 + android:orientation="horizontal"
917 + app:layout_constraintGuide_percent="0.64" />
918 +
919 + <ImageView
920 + android:id="@+id/iv_market_logo"
921 + android:layout_width="76dp"
922 + android:layout_height="76dp"
923 + android:src="@drawable/ic_market_polygon"
924 + app:layout_constraintBottom_toBottomOf="parent"
925 + app:layout_constraintStart_toStartOf="parent"
926 + app:layout_constraintTop_toTopOf="parent" />
927 +
928 + <TextView
929 + android:id="@+id/tv_market_value_all"
930 + fontPath="fonts/PeridotPE-Regular.ttf"
931 + android:layout_width="0dp"
932 + android:layout_height="wrap_content"
933 + android:layout_marginHorizontal="8dp"
934 + android:includeFontPadding="false"
935 + android:text="@string/cos_supermarket_win"
936 + android:textColor="@color/cos_light_black"
937 + android:textSize="15sp"
938 + app:layout_constraintBottom_toBottomOf="parent"
939 + app:layout_constraintEnd_toEndOf="parent"
940 + app:layout_constraintStart_toEndOf="@+id/iv_market_logo"
941 + app:layout_constraintTop_toTopOf="parent" />
942 +
943 + <TextView
944 + android:id="@+id/tv_market_value"
945 + fontPath="fonts/PeridotPE-Bold.ttf"
946 + android:layout_width="wrap_content"
947 + android:layout_height="wrap_content"
948 + android:includeFontPadding="false"
949 + android:textColor="@color/cos_light_black"
950 + android:textSize="14sp"
951 + app:layout_constraintEnd_toEndOf="@+id/iv_market_logo"
952 + app:layout_constraintStart_toStartOf="@+id/iv_market_logo"
953 + app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_50_market"
954 + tools:text="20.00€" />
955 + </androidx.constraintlayout.widget.ConstraintLayout>
956 + </androidx.cardview.widget.CardView>
957 + </RelativeLayout>
958 + </net.cachapa.expandablelayout.ExpandableLayout>
959 +
960 + <LinearLayout
961 + android:id="@+id/ll_market_view"
962 + android:layout_width="match_parent"
963 + android:layout_height="wrap_content"
964 + android:layout_marginTop="20dp"
965 + android:orientation="vertical"
966 + android:visibility="gone"
967 + tools:visibility="gone">
968 +
969 + <TextView
970 + android:id="@+id/tv_market_header"
971 + fontPath="fonts/BTCosmo-Bold.ttf"
972 + android:layout_width="wrap_content"
973 + android:layout_height="wrap_content"
974 + android:layout_gravity="start"
975 + android:layout_marginHorizontal="16dp"
976 + android:layout_marginBottom="10dp"
977 + android:text="@string/cos_market_title"
978 + android:textColor="@color/cos_light_blue"
979 + android:textSize="19sp" />
980 +
981 + <androidx.recyclerview.widget.RecyclerView
982 + android:id="@+id/rv_market_coupons"
983 + android:layout_width="match_parent"
984 + android:layout_height="wrap_content"
985 + android:layout_marginHorizontal="2dp"
986 + android:overScrollMode="never"
987 + android:scrollbars="none" />
988 + </LinearLayout>
989 +
990 + <LinearLayout
991 + android:id="@+id/ll_mygifts"
992 + android:layout_width="match_parent"
993 + android:layout_height="wrap_content"
994 + android:layout_marginTop="24dp"
995 + android:orientation="vertical"
996 + android:visibility="gone"
997 + tools:visibility="gone">
998 +
999 + <ImageView
1000 + android:id="@+id/dfy_logo"
1001 + android:layout_width="200dp"
1002 + android:layout_height="30dp"
1003 + android:layout_gravity="start"
1004 + android:layout_marginHorizontal="16dp"
1005 + android:src="@drawable/ic_deals_horizontal" />
1006 +
1007 + <androidx.cardview.widget.CardView
1008 + android:layout_width="match_parent"
1009 + android:layout_height="wrap_content"
1010 + android:layout_marginHorizontal="11dp"
1011 + android:layout_marginTop="8dp"
1012 + android:layout_marginBottom="6dp"
1013 + android:paddingVertical="10dp"
1014 + app:cardCornerRadius="16dp"
1015 + app:cardElevation="2dp">
1016 +
1017 + <androidx.constraintlayout.widget.ConstraintLayout
1018 + android:id="@+id/cl_mygifts"
1019 + android:layout_width="match_parent"
1020 + android:layout_height="wrap_content"
1021 + android:background="@color/white"
1022 + android:paddingVertical="8dp">
1023 +
1024 + <LinearLayout
1025 + android:layout_width="0dp"
1026 + android:layout_height="wrap_content"
1027 + android:layout_marginStart="20dp"
1028 + android:layout_marginEnd="24dp"
1029 + android:orientation="vertical"
1030 + app:layout_constraintBottom_toBottomOf="parent"
1031 + app:layout_constraintEnd_toStartOf="@+id/iv_deals_circle"
1032 + app:layout_constraintStart_toStartOf="parent"
1033 + app:layout_constraintTop_toTopOf="parent">
1034 +
1035 + <TextView
1036 + android:id="@+id/tv_active_gifts"
1037 + fontPath="fonts/PeridotPE-Regular.ttf"
1038 + android:layout_width="wrap_content"
1039 + android:layout_height="wrap_content"
1040 + android:textColor="@color/cos_light_black"
1041 + android:textSize="18sp"
1042 + tools:text="@string/cos_active_deals" />
1043 +
1044 + <TextView
1045 + android:id="@+id/tv_active_deals_text"
1046 + fontPath="fonts/PeridotPE-Bold.ttf"
1047 + android:layout_width="wrap_content"
1048 + android:layout_height="wrap_content"
1049 + android:ellipsize="end"
1050 + android:maxLines="2"
1051 + android:textColor="@color/cos_light_black"
1052 + android:textIsSelectable="true"
1053 + android:textSize="18sp"
1054 + tools:text="961544809"
1055 + tools:visibility="gone" />
1056 +
1057 + <ScrollView
1058 + android:id="@+id/sv_active_deals_codes_view"
1059 + android:layout_width="match_parent"
1060 + android:layout_height="48dp"
1061 + android:nestedScrollingEnabled="true"
1062 + android:visibility="gone">
1063 +
1064 + <org.apmem.tools.layouts.FlowLayout
1065 + android:id="@+id/ll_active_deals_codes_view"
1066 + android:layout_width="match_parent"
1067 + android:layout_height="wrap_content"
1068 + android:visibility="gone">
1069 +
1070 + </org.apmem.tools.layouts.FlowLayout>
1071 + </ScrollView>
1072 +
1073 + <TextView
1074 + android:id="@+id/tv_active_deals_date_text"
1075 + fontPath="fonts/PeridotPE-Regular.ttf"
1076 + android:layout_width="wrap_content"
1077 + android:layout_height="wrap_content"
1078 + android:textColor="@color/cos_light_black"
1079 + android:visibility="gone"
1080 + tools:text="@string/cos_active_coupon_date" />
1081 + </LinearLayout>
1082 +
1083 + <ImageView
1084 + android:id="@+id/iv_deals_circle"
1085 + android:layout_width="86dp"
1086 + android:layout_height="86dp"
1087 + android:layout_marginVertical="4dp"
1088 + android:layout_marginEnd="20dp"
1089 + android:src="@drawable/ic_deals_new"
1090 + app:layout_constraintBottom_toBottomOf="parent"
1091 + app:layout_constraintEnd_toEndOf="parent"
1092 + app:layout_constraintTop_toTopOf="parent" />
1093 + </androidx.constraintlayout.widget.ConstraintLayout>
1094 + </androidx.cardview.widget.CardView>
1095 + </LinearLayout>
1096 +
1097 + <LinearLayout
1098 + android:id="@+id/ll_gifts_view"
1099 + android:layout_width="match_parent"
1100 + android:layout_height="wrap_content"
1101 + android:layout_marginTop="24dp"
1102 + android:orientation="vertical"
1103 + android:visibility="gone"
1104 + tools:visibility="gone">
1105 +
1106 + <TextView
1107 + android:id="@+id/tv_active_coupons_header"
1108 + fontPath="fonts/BTCosmo-Bold.ttf"
1109 + android:layout_width="wrap_content"
1110 + android:layout_height="wrap_content"
1111 + android:layout_gravity="start"
1112 + android:layout_marginHorizontal="16dp"
1113 + android:layout_marginBottom="10dp"
1114 + android:text="@string/cos_gifts_title"
1115 + android:textColor="@color/cos_light_blue"
1116 + android:textSize="19sp" />
1117 +
1118 + <androidx.recyclerview.widget.RecyclerView
1119 + android:id="@+id/rv_active_coupons"
1120 + android:layout_width="match_parent"
1121 + android:layout_height="wrap_content"
1122 + android:layout_marginHorizontal="2dp"
1123 + android:overScrollMode="never"
1124 + android:paddingBottom="40dp"
1125 + android:scrollbars="none" />
1126 + </LinearLayout>
1127 + </LinearLayout>
1128 + </RelativeLayout>
1129 + </LinearLayout>
1130 + </androidx.core.widget.NestedScrollView>
1131 +</RelativeLayout>