Panagiotis Triantafyllou

my rewards fragment

package ly.warp.sdk.activities;
import android.content.Context;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.Toast;
......@@ -12,15 +13,14 @@ import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationBarView;
import java.util.ArrayList;
import java.util.HashMap;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import ly.warp.sdk.R;
import ly.warp.sdk.fragments.HomeFragment;
import ly.warp.sdk.fragments.LoyaltyFragment;
import ly.warp.sdk.fragments.MyRewardsFragment;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
import ly.warp.sdk.io.models.Consumer;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.request.WarplyGetCampaignsRequest;
......@@ -89,10 +89,22 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
.addToBackStack(null)
.commit();
return true;
} else if (itemId == R.id.menu_profile) {
mFragmentToSet = MyRewardsFragment.newInstance();
getSupportFragmentManager().beginTransaction()
.replace(R.id.fl_fragment, mFragmentToSet)
.addToBackStack(null)
.commit();
return true;
}
return false;
}
@Override
public void attachBaseContext(Context newBase) {
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
}
// ===========================================================
// Methods
// ===========================================================
......
package ly.warp.sdk.fragments;
import static android.app.Activity.RESULT_OK;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import net.cachapa.expandablelayout.ExpandableLayout;
import org.apmem.tools.layouts.FlowLayout;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import ly.warp.sdk.R;
import ly.warp.sdk.activities.ActiveCouponsActivity;
import ly.warp.sdk.activities.ActiveUnifiedCouponsActivity;
import ly.warp.sdk.activities.LoyaltyAnalysisActivity;
import ly.warp.sdk.activities.LoyaltyHistoryActivity;
import ly.warp.sdk.activities.LoyaltyMarketAnalysisActivity;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.models.VouchersActivityEventModel;
import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
import ly.warp.sdk.views.adapters.MarketCouponAdapter;
public class MyRewardsFragment extends Fragment implements View.OnClickListener {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private ImageView mIvDealsLogo, mIvProfilePhoto, mIvExpArrow;
private TextView mTvUsername, mTvDealsValue, mTvDealsValueAll,
mTvUserBadge, mTvGiftsValue, mTvGiftsValueAll, mTvActiveCode, mTvActiveDate,
mTvActiveTitle, mTvActiveCouponsHeader, mTvMarketValue, mTvMarketAll, mTvFavValue,
mTvFavValueAll, mTvDealsCountBadge, mTvUnifiedCountBadge, mTvGiftsCountBadge,
mTvVouchersDisabledTitle, mTvVouchersDisabledSubtitle, mTvVouchersTitle, mTvVouchersSubtitle;
private ConstraintLayout mClDealsBanner, mClDealsView,
mClGiftsBanner, mClMarket;
private LinearLayout mLlQuestionnaire, mLlUserBadge, mLlEmptyWallet, mLlDeals, mLlGifts,
mLlMarketView, mLlHistory, mLlBannerInfo, mLlVouchers, mLlVouchersSpinner,
mLlVouchersDisabled;
private FlowLayout mLlActiveCodesView;
private float couponDfyValue = 0.0f, mFavValue = 0.0f;
private RecyclerView mRecyclerCoupons, mRvMarketCoupons;
private ActiveCouponAdapter mAdapterCoupons;
private AlertDialog mAlertDialogNonTelco, mAlertDialogVouchersService;
private ScrollView mScActiveCodes;
private int mTimer = 0;
private Handler mSecondsHandler;
private ArrayList<UnifiedCoupon> mUnifiedCoupons = new ArrayList<UnifiedCoupon>();
private float countValue = 0.0f;
private MarketCouponAdapter mAdapterMarketCoupons;
private ExpandableLayout mElGifts;
private boolean mIsStayCollapsed = true;
private CardView mClExp, mCvVouchers, mCvVouchersDisabled;
private boolean mDfyPressed = false, mDealsBannerPressed = false, mQuestionnairePressed = false,
mHistoryPressed = false, mHistoryMarketPressed = false, mUnifiedPressed = false,
mCouponPressed = false, mHistoryBadgePressed = false, mUnifiedCountPressed = false,
mGiftsCountPressed = false;
private RelativeLayout mRlDeals, mRlUnified, mRlGifts;
private View mSeparator, mSeparatorDisabled;
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
public static Fragment newInstance() {
MyRewardsFragment myRewardsFragment = new MyRewardsFragment();
return myRewardsFragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_my_rewards, container, false);
}
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mSecondsHandler = new Handler();
mTvUsername = view.findViewById(R.id.tv_profile_name);
mLlQuestionnaire = view.findViewById(R.id.ll_user_questionnaire);
mLlUserBadge = view.findViewById(R.id.ll_user_badge);
mTvUserBadge = view.findViewById(R.id.tv_type);
mTvGiftsValue = view.findViewById(R.id.tv_gifts_value);
mTvGiftsValueAll = view.findViewById(R.id.tv_gifts_value_all);
mClDealsBanner = view.findViewById(R.id.cl_deals_win_inner_cos);
mClGiftsBanner = view.findViewById(R.id.cl_deals_win_inner);
mTvDealsValue = view.findViewById(R.id.tv_deals_value);
mTvDealsValueAll = view.findViewById(R.id.tv_deals_value_all);
mTvActiveCode = view.findViewById(R.id.tv_active_deals_text);
mTvActiveDate = view.findViewById(R.id.tv_active_deals_date_text);
mIvDealsLogo = view.findViewById(R.id.dfy_logo);
mClDealsView = view.findViewById(R.id.cl_mygifts);
mLlDeals = view.findViewById(R.id.ll_mygifts);
mIvProfilePhoto = view.findViewById(R.id.iv_profile_photo);
mTvActiveTitle = view.findViewById(R.id.tv_active_gifts);
mTvActiveCouponsHeader = view.findViewById(R.id.tv_active_coupons_header);
mLlEmptyWallet = view.findViewById(R.id.ll_empty_wallet);
mLlActiveCodesView = view.findViewById(R.id.ll_active_deals_codes_view);
mScActiveCodes = view.findViewById(R.id.sv_active_deals_codes_view);
mLlGifts = view.findViewById(R.id.ll_gifts_view);
mLlMarketView = view.findViewById(R.id.ll_market_view);
mRvMarketCoupons = view.findViewById(R.id.rv_market_coupons);
mRvMarketCoupons.setNestedScrollingEnabled(false);
mRvMarketCoupons.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
mElGifts = view.findViewById(R.id.el_exp);
mClExp = view.findViewById(R.id.cl_exp);
mIvExpArrow = view.findViewById(R.id.iv_exp_arrow);
mTvMarketValue = view.findViewById(R.id.tv_market_value);
mTvMarketAll = view.findViewById(R.id.tv_market_value_all);
mClMarket = view.findViewById(R.id.cl_market_inner);
mTvFavValue = view.findViewById(R.id.tv_exp_value);
mTvFavValueAll = view.findViewById(R.id.tv_exp_value_all);
mLlHistory = view.findViewById(R.id.ll_loyalty_history);
mTvDealsCountBadge = view.findViewById(R.id.tv_deals_count);
mTvUnifiedCountBadge = view.findViewById(R.id.tv_sm_count);
mTvGiftsCountBadge = view.findViewById(R.id.tv_gifts_count);
mLlBannerInfo = view.findViewById(R.id.ll_banner_info_new);
mRlDeals = view.findViewById(R.id.rv_deals_count);
mRlUnified = view.findViewById(R.id.rv_sm_count);
mRlGifts = view.findViewById(R.id.rv_gifts_count);
mRecyclerCoupons = view.findViewById(R.id.rv_active_coupons);
mCvVouchers = view.findViewById(R.id.cv_vouchers);
mCvVouchersDisabled = view.findViewById(R.id.cv_vouchers_disabled);
mLlVouchers = view.findViewById(R.id.ll_vouchers);
mLlVouchersDisabled = view.findViewById(R.id.ll_vouchers_disabled);
mLlVouchersSpinner = view.findViewById(R.id.ll_vouchers_spinner);
mSeparator = view.findViewById(R.id.v_separator_vouchers);
mSeparatorDisabled = view.findViewById(R.id.v_separator_vouchers_disabled);
mTvVouchersDisabledTitle = view.findViewById(R.id.tv_vouchers_title_disabled);
mTvVouchersDisabledSubtitle = view.findViewById(R.id.tv_vouchers_info_title_disabled);
mTvVouchersTitle = view.findViewById(R.id.tv_vouchers_title);
mTvVouchersSubtitle = view.findViewById(R.id.tv_vouchers_info_title);
}
@Override
public void onStart() {
super.onStart();
if (!EventBus.getDefault().isRegistered(this))
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
// EventBus.getDefault().unregister(this);
}
@Override
public void onDestroy() {
super.onDestroy();
WarplyManagerHelper.clearShowVouchersBanner();
EventBus.getDefault().unregister(this);
}
@Override
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent(getContext(), "screen", "LoyaltyWalletScreen");
mTimer = 0;
mSecondsHandler.post(new Runnable() {
@Override
public void run() {
mTimer++;
mSecondsHandler.postDelayed(this, 1000);
}
});
mDfyPressed = false;
mDealsBannerPressed = false;
mQuestionnairePressed = false;
mHistoryPressed = false;
mHistoryMarketPressed = false;
mUnifiedPressed = false;
mCouponPressed = false;
mHistoryBadgePressed = false;
mGiftsCountPressed = false;
mUnifiedCountPressed = false;
initViews();
}
@Override
public void onPause() {
super.onPause();
if (mSecondsHandler != null) {
mSecondsHandler.removeCallbacksAndMessages(null);
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("time_spent_on_loyalty_sdk");
analyticsEvent.setParameter("name", "MyRewards");
analyticsEvent.setParameter("seconds", String.valueOf(mTimer));
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
}
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.ll_user_questionnaire || view.getId() == R.id.ll_user_badge) {
if (!WarplyManagerHelper.noInternetDialog(getContext(), true)) {
if (getActivity() != null && !getActivity().isFinishing()) {
WarplyManagerHelper.noInternetDialog(getActivity());
}
return;
}
if (!mQuestionnairePressed) {
mQuestionnairePressed = true;
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("Questionnaire"));
startActivityForResult(WarpViewActivity.createIntentFromURL(getContext(), WarplyManagerHelper.openQuestionnaire()), 1000);
}
return;
}
/** Deals History */
if (view.getId() == R.id.cl_deals_win_inner_cos) {
if (!mDealsBannerPressed) {
mDealsBannerPressed = true;
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("DealsBanner"));
WarplyDealsAnalysisEventModel warplyDealsAnalysisEventModel = new WarplyDealsAnalysisEventModel();
warplyDealsAnalysisEventModel.setPressed(true);
EventBus.getDefault().post(new WarplyEventBusManager(warplyDealsAnalysisEventModel));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_deals_for_you_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
}
return;
}
/** Active Unified Banner */
if (view.getId() == R.id.rv_sm_count) {
if (!mUnifiedCountPressed) {
mUnifiedCountPressed = true;
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("ActiveMarketBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_market_active_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(getContext(), ActiveUnifiedCouponsActivity.class);
startActivity(intent);
}
return;
}
/** Active Coupons Banner */
if (view.getId() == R.id.rv_gifts_count) {
if (!mGiftsCountPressed) {
mGiftsCountPressed = true;
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("ActiveLoyaltyBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_gifts_for_you_active_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(getContext(), ActiveCouponsActivity.class);
startActivity(intent);
}
return;
}
/** Coupons History */
if (view.getId() == R.id.cl_deals_win_inner) {
if (!mHistoryPressed) {
mHistoryPressed = true;
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("LoyaltyBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_gifts_for_you_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(getContext(), LoyaltyAnalysisActivity.class);
startActivity(intent);
}
return;
}
if (view.getId() == R.id.cl_exp) {
if (!mIsStayCollapsed) {
mElGifts.toggle(true);
if (mElGifts.isExpanded()) {
mIvExpArrow.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_up_dark_new));
} else {
mIvExpArrow.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_down_dark_new));
}
}
return;
}
/** Unified History */
if (view.getId() == R.id.cl_market_inner) {
if (!mHistoryMarketPressed) {
mHistoryMarketPressed = true;
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("MarketBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_market_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(getContext(), LoyaltyMarketAnalysisActivity.class);
startActivity(intent);
}
return;
}
/** New History */
if (view.getId() == R.id.ll_loyalty_history) {
if (!mHistoryBadgePressed) {
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("LoyaltyHistoryBadge"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_history_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(getContext(), LoyaltyHistoryActivity.class);
startActivity(intent);
}
return;
}
/** Vouchers Client's Screen */
if (view.getId() == R.id.cv_vouchers || view.getId() == R.id.cv_vouchers_disabled) {
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("VouchersBadge"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_vouchers_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
VouchersActivityEventModel vouchersActivity = new VouchersActivityEventModel();
EventBus.getDefault().post(new WarplyEventBusManager(vouchersActivity));
return;
}
/** Active Deals Banner */
if (view.getId() == R.id.cl_mygifts || view.getId() == R.id.rv_deals_count) {
if (!mDfyPressed) {
mDfyPressed = true;
WarplyAnalyticsManager.logTrackersEvent(getContext(), "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("ActiveDealsBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_deals_for_you_active_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
ActiveDFYCouponEventModel activeCouponEventModel = new ActiveDFYCouponEventModel();
activeCouponEventModel.setPressed(true);
EventBus.getDefault().post(new WarplyEventBusManager(activeCouponEventModel));
}
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
// super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1000) {
if (resultCode == RESULT_OK) {
if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag(getContext()))) {
mTvUserBadge.setText(WarplyManagerHelper.getUserTag(getContext()));
mLlQuestionnaire.setVisibility(View.GONE);
mLlUserBadge.setVisibility(View.VISIBLE);
} else {
mLlUserBadge.setVisibility(View.GONE);
mLlQuestionnaire.setVisibility(View.VISIBLE);
}
}
}
}
@Subscribe()
public void onMessageEvent(WarplyEventBusManager event) {
if (event.getVouchersServiceUnavailableEventModel() != null) {
Handler mUIHandler = new Handler(Looper.getMainLooper());
mUIHandler.post(new Runnable() {
@Override
public void run() {
vouchersServiceUnavailableDialog();
}
});
return;
}
if (event.getVouchersFetched() != null) {
/** Vouchers */
Handler mUIHandler = new Handler(Looper.getMainLooper());
mUIHandler.post(new Runnable() {
@Override
public void run() {
checkForEmpty();
}
});
/** Vouchers */
return;
}
if (event.getUnifiedCouponsAdded() != null) {
Handler mUIHandler = new Handler(Looper.getMainLooper());
mUIHandler.post(new Runnable() {
@Override
public void run() {
if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0)
mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size()));
else
mTvUnifiedCountBadge.setText("0");
checkForEmpty();
}
});
return;
}
if (event.getCouponsAdded() != null) {
Handler mUIHandler = new Handler(Looper.getMainLooper());
mUIHandler.post(new Runnable() {
@Override
public void run() {
if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0)
mTvGiftsCountBadge.setText(String.valueOf(WarplyManagerHelper.getCouponList().size()));
else
mTvGiftsCountBadge.setText("0");
checkForEmpty();
}
});
}
}
// ===========================================================
// Methods
// ===========================================================
private void initViews() {
if (WarpUtils.getUserNonTelco(getContext())) {
nonTelcoDialog();
}
/** Unified Coupons List */
if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0)
mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size()));
else
mTvUnifiedCountBadge.setText("0");
/** Unified Coupons List */
/** Coupon List */
if (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() > 0)
mTvGiftsCountBadge.setText(String.valueOf(WarplyManagerHelper.getCouponList().size()));
else
mTvGiftsCountBadge.setText("0");
/** Coupon List */
/** Deals Badge */
if (WarplyManagerHelper.getActiveDFYCoupons() != null)
mTvDealsCountBadge.setText(String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size()));
else
mTvDealsCountBadge.setText("0");
/** Deals Badge */
if (WarplyManagerHelper.getConsumer() != null) {
mTvUsername.setText(String.format(getResources().getString(R.string.cos_profile_loyalty_name),
WarplyManagerHelper.getConsumer().getFirstName(), WarplyManagerHelper.getConsumer().getLastName()));
if (!TextUtils.isEmpty(WarplyManagerHelper.getConsumer().getImageUrl()) && !WarplyManagerHelper.getConsumer().getImageUrl().equals("null")) {
Glide.with(this)
.load(WarplyManagerHelper.getConsumer().getImageUrl())
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(mIvProfilePhoto);
} else {
Glide.with(this)
.load(R.drawable.ic_default_photo)
.into(mIvProfilePhoto);
}
if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag(getContext()))) {
mTvUserBadge.setText(WarplyManagerHelper.getUserTag(getContext()));
mLlQuestionnaire.setVisibility(View.GONE);
mLlUserBadge.setVisibility(View.VISIBLE);
} else {
mLlUserBadge.setVisibility(View.GONE);
mLlQuestionnaire.setVisibility(View.VISIBLE);
}
}
/** Empty View */
checkForEmpty();
/** Empty View */
mLlQuestionnaire.setOnClickListener(this);
mLlUserBadge.setOnClickListener(this);
mClDealsBanner.setOnClickListener(this);
mClGiftsBanner.setOnClickListener(this);
mClDealsView.setOnClickListener(this);
mClExp.setOnClickListener(this);
mClMarket.setOnClickListener(this);
mLlHistory.setOnClickListener(this);
mRlDeals.setOnClickListener(this);
mRlUnified.setOnClickListener(this);
mRlGifts.setOnClickListener(this);
mCvVouchers.setOnClickListener(this);
mCvVouchersDisabled.setOnClickListener(this);
}
private void nonTelcoDialog() {
if (getActivity() != null && !getActivity().isFinishing()) {
mAlertDialogNonTelco = new AlertDialog.Builder(getActivity())
.setTitle(R.string.cos_dlg_non_telco_title)
.setMessage(R.string.cos_dlg_non_telco)
.setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.setCancelable(false)
.show();
}
}
private void vouchersServiceUnavailableDialog() {
if (getActivity() != null && !getActivity().isFinishing()) {
mLlVouchersSpinner.setVisibility(View.GONE);
mAlertDialogVouchersService = new AlertDialog.Builder(getActivity())
.setTitle(R.string.cos_dlg_try_again)
.setMessage(R.string.cos_dlg_service_unavailable)
.setPositiveButton(R.string.cos_dlg_return, (dialogPositive, whichPositive) -> {
dialogPositive.dismiss();
})
.setCancelable(false)
.show();
}
}
private void checkForEmpty() {
if (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()) || (!TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()) && WarplyManagerHelper.getShowVouchersBanner().equals("null"))) {
/** Show spinner only if empty */
mLlVouchers.setVisibility(View.GONE);
mSeparator.setVisibility(View.VISIBLE);
if (TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()))
mLlVouchersSpinner.setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(WarplyManagerHelper.getShowVouchersBanner()) && WarplyManagerHelper.getShowVouchersBanner().equals("null"))
mLlVouchersSpinner.setVisibility(View.GONE);
if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
&& (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
&& (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
/** Hide all and show empty view */
mLlVouchers.setVisibility(View.GONE);
mLlVouchersSpinner.setVisibility(View.GONE);
mSeparator.setVisibility(View.VISIBLE);
mLlEmptyWallet.setVisibility(View.VISIBLE);
} else {
/** Show loyalty banners and hide empty view
* Show spinner only if empty */
mLlEmptyWallet.setVisibility(View.GONE);
mLlBannerInfo.setVisibility(View.VISIBLE);
}
} else {
if (WarplyManagerHelper.getShowVouchersBanner().equals("true")) {
/** Hide spinner and hide empty view and show vouchers and hide disabled vouchers */
mLlVouchersSpinner.setVisibility(View.GONE);
mLlEmptyWallet.setVisibility(View.GONE);
if (TextUtils.isEmpty(WarpUtils.getLanguage(getContext())) || WarpUtils.getLanguage(getContext()).equals("el")) {
mTvVouchersTitle.setText(getString(R.string.cos_vouchers_title));
mTvVouchersSubtitle.setText(getString(R.string.cos_vouchers_info_title));
} else {
mTvVouchersTitle.setText(getString(R.string.cos_vouchers_title_en));
mTvVouchersSubtitle.setText(getString(R.string.cos_vouchers_info_title_en));
}
mLlVouchers.setVisibility(View.VISIBLE);
mLlVouchersDisabled.setVisibility(View.GONE);
mSeparatorDisabled.setVisibility(View.VISIBLE);
if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
&& (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
&& (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
/** Hide loyalty banners and hide separator */
mSeparator.setVisibility(View.GONE);
mLlBannerInfo.setVisibility(View.GONE);
} else {
/** Show loyalty banners and show separator */
mSeparator.setVisibility(View.VISIBLE);
mLlBannerInfo.setVisibility(View.VISIBLE);
}
} else if (WarplyManagerHelper.getShowVouchersBanner().equals("false")) {
/** Hide spinner and hide vouchers and hide empty view and show disabled vouchers and show disabled separator */
mLlVouchersSpinner.setVisibility(View.GONE);
mLlEmptyWallet.setVisibility(View.GONE);
mLlVouchers.setVisibility(View.GONE);
mSeparator.setVisibility(View.VISIBLE);
if (TextUtils.isEmpty(WarpUtils.getLanguage(getContext())) || WarpUtils.getLanguage(getContext()).equals("el")) {
mTvVouchersDisabledTitle.setText(getString(R.string.cos_vouchers_title));
mTvVouchersDisabledSubtitle.setText(getString(R.string.cos_vouchers_info_title_disabled));
} else {
mTvVouchersDisabledTitle.setText(getString(R.string.cos_vouchers_title_en));
mTvVouchersDisabledSubtitle.setText(getString(R.string.cos_vouchers_info_title_disabled_en));
}
mLlVouchersDisabled.setVisibility(View.VISIBLE);
mSeparatorDisabled.setVisibility(View.VISIBLE);
if ((WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() == 0)
&& (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() == 0)
&& (WarplyManagerHelper.getCouponList() != null && WarplyManagerHelper.getCouponList().size() == 0)) {
/** Hide loyalty banners and hide empty view and hide disabled separator */
mLlBannerInfo.setVisibility(View.GONE);
mLlEmptyWallet.setVisibility(View.GONE);
mSeparatorDisabled.setVisibility(View.GONE);
} else {
/** Show loyalty banners and show disabled separator */
mLlBannerInfo.setVisibility(View.VISIBLE);
mSeparatorDisabled.setVisibility(View.VISIBLE);
}
}
}
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_light_grey3">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_first_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="24dp"
android:paddingHorizontal="16dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_profile_photo"
android:layout_width="74dp"
android:layout_height="74dp"
android:padding="1dp"
android:src="@drawable/ic_default_photo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/ShapeAppearanceProfileImage"
app:strokeColor="@color/cos_grey2"
app:strokeWidth="1dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_profile_photo"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_profile_name"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="22sp"
tools:text="Test Name" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_user_badge"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:background="@drawable/selector_button_green_border"
android:gravity="center"
android:visibility="gone"
tools:visibility="gone">
<TextView
android:id="@+id/tv_type"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:includeFontPadding="false"
android:textColor="@color/cos_green12"
android:textSize="16sp"
tools:text="@string/cos_profile_preferences_placeholder" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_user_questionnaire"
android:layout_width="160dp"
android:layout_height="42dp"
android:background="@drawable/selector_button_green_border"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="4dp"
android:src="@drawable/sv_plus_sign_green" />
<TextView
android:id="@+id/tv_questionnaire"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/cos_profile_preferences"
android:textColor="@color/cos_green12"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_loyalty_history"
android:layout_width="52dp"
android:layout_height="42dp"
android:layout_marginStart="4dp"
android:background="@drawable/selector_button_green_border"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/sv_history" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/ll_second_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_banner_info_new"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="14dp"
android:layout_marginTop="16dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/tv_coupons_header"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:maxLines="1"
android:text="@string/cos_coupons_loyalty_title"
android:textColor="@color/cos_light_black"
android:textSize="22sp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp">
<RelativeLayout
android:id="@+id/rv_deals_count"
android:layout_width="0dp"
android:layout_height="104dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/rv_sm_count"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:id="@+id/cv_deals_count"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:layout_marginVertical="4dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_green_tr">
<ImageView
android:id="@+id/iv_deals_logo_count"
android:layout_width="52dp"
android:layout_height="32dp"
android:src="@drawable/sv_deals_logo_redesign"
app:layout_constraintBottom_toTopOf="@+id/v_separator_deals_count"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/v_separator_deals_count"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginHorizontal="8dp"
android:background="@color/cos_grey2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_deals_count_title"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_deals_title2"
android:textColor="@color/cos_light_black"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v_separator_deals_count" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
android:layout_marginEnd="1dp"
android:background="@drawable/shape_cos_counter_orange"
android:gravity="center"
android:orientation="vertical"
android:translationZ="2dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_deals_count"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
tools:text="6" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rv_sm_count"
android:layout_width="0dp"
android:layout_height="104dp"
android:layout_marginHorizontal="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/rv_gifts_count"
app:layout_constraintStart_toEndOf="@+id/rv_deals_count"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:id="@+id/cv_sm_count"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:layout_marginVertical="4dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_creme">
<ImageView
android:id="@+id/iv_sm_logo_count"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/sv_unified_redesign"
app:layout_constraintBottom_toTopOf="@+id/v_separator_sm_count"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/v_separator_sm_count"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginHorizontal="8dp"
android:background="@color/cos_grey2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_sm_count_title"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_market_title"
android:textColor="@color/cos_light_black"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v_separator_sm_count" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
android:layout_marginEnd="1dp"
android:background="@drawable/shape_cos_counter_orange"
android:gravity="center"
android:orientation="vertical"
android:translationZ="2dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_sm_count"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
tools:text="6" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rv_gifts_count"
android:layout_width="0dp"
android:layout_height="104dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/rv_sm_count"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:id="@+id/cv_gifts_count"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:layout_marginVertical="4dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cos_skyblue5">
<ImageView
android:id="@+id/iv_gifts_logo_count"
android:layout_width="34dp"
android:layout_height="34dp"
android:src="@drawable/sv_gifts_redesign"
app:layout_constraintBottom_toTopOf="@+id/v_separator_gifts_count"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/v_separator_gifts_count"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginHorizontal="8dp"
android:background="@color/cos_grey2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_gifts_count_title"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="@string/cos_gifts_title"
android:textColor="@color/cos_light_black"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v_separator_gifts_count" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
android:layout_marginEnd="1dp"
android:background="@drawable/shape_cos_counter_orange"
android:gravity="center"
android:orientation="vertical"
android:translationZ="2dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_gifts_count"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/cos_light_black"
android:textSize="12sp"
tools:text="6" />
</LinearLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_vouchers_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="14dp"
android:layout_marginTop="32dp"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<ProgressBar
android:id="@+id/pb_vouchers"
android:layout_width="48dp"
android:layout_height="48dp"
android:theme="@style/progressBarGreen" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_vouchers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="14dp"
android:layout_marginTop="32dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone">
<View
android:id="@+id/v_separator_vouchers"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/cos_gray" />
<TextView
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:id="@+id/tv_vouchers_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:includeFontPadding="false"
android:maxLines="1"
android:text="@string/cos_vouchers_title"
android:textColor="@color/cos_light_black"
android:textSize="22sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_vouchers"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="4dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ImageView
android:id="@+id/iv_vouchers_logo"
android:layout_width="32dp"
android:layout_height="30dp"
android:layout_marginStart="16dp"
android:src="@drawable/sv_vouchers"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_vouchers_info_title"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:includeFontPadding="false"
android:lineHeight="24dp"
android:text="@string/cos_vouchers_info_title"
android:textColor="@color/cos_light_black"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@+id/iv_vouchers_logo"
app:layout_constraintEnd_toStartOf="@+id/iv_vouchers_arrow"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/iv_vouchers_logo"
app:layout_constraintTop_toTopOf="@+id/iv_vouchers_logo" />
<ImageView
android:id="@+id/iv_vouchers_arrow"
android:layout_width="16dp"
android:layout_height="10dp"
android:layout_marginEnd="16dp"
android:rotation="270"
android:src="@drawable/sv_arrow_down"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_vouchers_disabled"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="14dp"
android:layout_marginTop="32dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone">
<View
android:id="@+id/v_separator_vouchers_disabled"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/cos_gray" />
<TextView
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:id="@+id/tv_vouchers_title_disabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:includeFontPadding="false"
android:maxLines="1"
android:text="@string/cos_vouchers_title"
android:textColor="@color/cos_light_black"
android:textSize="22sp" />
<androidx.cardview.widget.CardView
android:id="@+id/cv_vouchers_disabled"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="4dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ImageView
android:id="@+id/iv_vouchers_logo_disabled"
android:layout_width="32dp"
android:layout_height="30dp"
android:layout_marginStart="16dp"
android:src="@drawable/sv_vouchers_disabled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_vouchers_info_title_disabled"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:includeFontPadding="false"
android:lineHeight="24dp"
android:text="@string/cos_vouchers_info_title_disabled"
android:textColor="@color/cos_gray2"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@+id/iv_vouchers_logo_disabled"
app:layout_constraintEnd_toStartOf="@+id/iv_vouchers_arrow_disabled"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/iv_vouchers_logo_disabled"
app:layout_constraintTop_toTopOf="@+id/iv_vouchers_logo_disabled" />
<ImageView
android:id="@+id/iv_vouchers_arrow_disabled"
android:layout_width="16dp"
android:layout_height="10dp"
android:layout_marginEnd="16dp"
android:rotation="270"
android:src="@drawable/sv_arrow_down"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginStart="2dp"
android:background="@drawable/shape_cos_counter_orange"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/tv_vouchers_info_title_disabled"
app:layout_constraintStart_toEndOf="@+id/tv_vouchers_info_title_disabled"
app:layout_constraintTop_toTopOf="@+id/tv_vouchers_info_title_disabled">
<TextView
android:id="@+id/tv_vouchers_count_disabled"
fontPath="fonts/PeridotPE-SemiBold.ttf"
android:layout_width="wrap_content"
android:layout_height="16dp"
android:includeFontPadding="false"
android:maxLines="1"
android:text="0"
android:textColor="@color/cos_light_black"
android:textSize="12sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_empty_wallet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="32dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone">
<ImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:src="@drawable/ic_empty_wallet" />
<TextView
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/cos_empty_wallet"
android:textColor="@color/cos_light_black"
android:textSize="16sp" />
</LinearLayout>
<androidx.cardview.widget.CardView
android:id="@+id/cl_exp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="11dp"
android:layout_marginTop="24dp"
android:visibility="gone"
app:cardCornerRadius="16dp"
app:cardElevation="2dp"
tools:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingHorizontal="14dp"
android:paddingVertical="14dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_horizontal_64_exp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.64" />
<ImageView
android:id="@+id/iv_exp_logo"
android:layout_width="76dp"
android:layout_height="76dp"
android:layout_marginVertical="4dp"
android:src="@drawable/ic_foryou_polygon_new"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_exp_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:textColor="@color/cos_light_black"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="@+id/iv_exp_logo"
app:layout_constraintStart_toStartOf="@+id/iv_exp_logo"
app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_64_exp"
tools:text="18.00€" />
<TextView
android:id="@+id/tv_exp_value_all"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:includeFontPadding="false"
android:text="@string/cos_for_you_all"
android:textColor="@color/cos_light_black"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_exp_arrow"
app:layout_constraintStart_toEndOf="@+id/iv_exp_logo"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_exp_arrow"
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/ic_down_dark_new"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<net.cachapa.expandablelayout.ExpandableLayout
android:id="@+id/el_exp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:el_duration="300"
app:el_expanded="false"
app:el_parallax="0.5">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/cv_deals_win_inner_cos"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="6dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_deals_win_inner_cos"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingHorizontal="6dp"
android:paddingVertical="4dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_horizontal_50_cos"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.64" />
<ImageView
android:id="@+id/iv_deals_logo"
android:layout_width="76dp"
android:layout_height="76dp"
android:src="@drawable/ic_deals_polygon_new"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_deals_value_all"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:includeFontPadding="false"
android:text="@string/cos_deals_win_title_cos"
android:textColor="@color/cos_light_black"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_deals_logo"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_deals_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:textColor="@color/cos_light_black"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="@+id/iv_deals_logo"
app:layout_constraintStart_toStartOf="@+id/iv_deals_logo"
app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_50_cos"
tools:text="18.00€" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cv_deals_win_inner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/cv_deals_win_inner_cos"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="6dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_deals_win_inner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingHorizontal="6dp"
android:paddingVertical="4dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_horizontal_50"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.64" />
<ImageView
android:id="@+id/iv_gifts_logo"
android:layout_width="76dp"
android:layout_height="76dp"
android:src="@drawable/ic_gifts_polygon_new"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_gifts_value_all"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:includeFontPadding="false"
android:text="@string/cos_deals_win_title"
android:textColor="@color/cos_light_black"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_gifts_logo"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_gifts_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:textColor="@color/cos_light_black"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="@+id/iv_gifts_logo"
app:layout_constraintStart_toStartOf="@+id/iv_gifts_logo"
app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_50"
tools:text="20.00€" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cv_market_inner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/cv_deals_win_inner"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_market_inner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingHorizontal="6dp"
android:paddingVertical="4dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_horizontal_50_market"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.64" />
<ImageView
android:id="@+id/iv_market_logo"
android:layout_width="76dp"
android:layout_height="76dp"
android:src="@drawable/ic_market_polygon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_market_value_all"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:includeFontPadding="false"
android:text="@string/cos_supermarket_win"
android:textColor="@color/cos_light_black"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_market_logo"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_market_value"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:textColor="@color/cos_light_black"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="@+id/iv_market_logo"
app:layout_constraintStart_toStartOf="@+id/iv_market_logo"
app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_50_market"
tools:text="20.00€" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</net.cachapa.expandablelayout.ExpandableLayout>
<LinearLayout
android:id="@+id/ll_market_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone">
<TextView
android:id="@+id/tv_market_header"
fontPath="fonts/BTCosmo-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginHorizontal="16dp"
android:layout_marginBottom="10dp"
android:text="@string/cos_market_title"
android:textColor="@color/cos_light_blue"
android:textSize="19sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_market_coupons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="2dp"
android:overScrollMode="never"
android:scrollbars="none" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_mygifts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone">
<ImageView
android:id="@+id/dfy_logo"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_gravity="start"
android:layout_marginHorizontal="16dp"
android:src="@drawable/ic_deals_horizontal" />
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="11dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="6dp"
android:paddingVertical="10dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_mygifts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingVertical="8dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="24dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/iv_deals_circle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_active_gifts"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/cos_light_black"
android:textSize="18sp"
tools:text="@string/cos_active_deals" />
<TextView
android:id="@+id/tv_active_deals_text"
fontPath="fonts/PeridotPE-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/cos_light_black"
android:textIsSelectable="true"
android:textSize="18sp"
tools:text="961544809"
tools:visibility="gone" />
<ScrollView
android:id="@+id/sv_active_deals_codes_view"
android:layout_width="match_parent"
android:layout_height="48dp"
android:nestedScrollingEnabled="true"
android:visibility="gone">
<org.apmem.tools.layouts.FlowLayout
android:id="@+id/ll_active_deals_codes_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
</org.apmem.tools.layouts.FlowLayout>
</ScrollView>
<TextView
android:id="@+id/tv_active_deals_date_text"
fontPath="fonts/PeridotPE-Regular.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/cos_light_black"
android:visibility="gone"
tools:text="@string/cos_active_coupon_date" />
</LinearLayout>
<ImageView
android:id="@+id/iv_deals_circle"
android:layout_width="86dp"
android:layout_height="86dp"
android:layout_marginVertical="4dp"
android:layout_marginEnd="20dp"
android:src="@drawable/ic_deals_new"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_gifts_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone">
<TextView
android:id="@+id/tv_active_coupons_header"
fontPath="fonts/BTCosmo-Bold.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginHorizontal="16dp"
android:layout_marginBottom="10dp"
android:text="@string/cos_gifts_title"
android:textColor="@color/cos_light_blue"
android:textSize="19sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_active_coupons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="2dp"
android:overScrollMode="never"
android:paddingBottom="40dp"
android:scrollbars="none" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>