Showing
5 changed files
with
126 additions
and
20 deletions
| ... | @@ -142,15 +142,15 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -142,15 +142,15 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl |
| 142 | mSecondsHandler.postDelayed(this, 1000); | 142 | mSecondsHandler.postDelayed(this, 1000); |
| 143 | } | 143 | } |
| 144 | }); | 144 | }); |
| 145 | - mSharedCoupons.clear(); | 145 | +// mSharedCoupons.clear(); |
| 146 | - new Thread(() -> { | 146 | +// new Thread(() -> { |
| 147 | - if (!Thread.currentThread().isInterrupted()) { | 147 | +// if (!Thread.currentThread().isInterrupted()) { |
| 148 | - WarplyManager.getSharingHistory(new WarplySharingHistoryRequest() | 148 | +// WarplyManager.getSharingHistory(new WarplySharingHistoryRequest() |
| 149 | - .setType("supermarket") | 149 | +// .setType("supermarket") |
| 150 | - , mSharingHistoryCallback); | 150 | +// , mSharingHistoryCallback); |
| 151 | - } | 151 | +// } |
| 152 | - Thread.currentThread().interrupt(); | 152 | +// Thread.currentThread().interrupt(); |
| 153 | - }).start(); | 153 | +// }).start(); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | @Override | 156 | @Override | ... | ... |
| ... | @@ -484,7 +484,8 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener | ... | @@ -484,7 +484,8 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener |
| 484 | Handler mUIHandler = new Handler(Looper.getMainLooper()); | 484 | Handler mUIHandler = new Handler(Looper.getMainLooper()); |
| 485 | mUIHandler.post(() -> { | 485 | mUIHandler.post(() -> { |
| 486 | // if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) | 486 | // if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) |
| 487 | - mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size() + WarplyManagerHelper.getSmCouponsList().size())); | 487 | +// mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size() + WarplyManagerHelper.getSmCouponsList().size())); |
| 488 | + mTvUnifiedCountBadge.setText(String.valueOf(1)); | ||
| 488 | // else | 489 | // else |
| 489 | // mTvUnifiedCountBadge.setText("0"); | 490 | // mTvUnifiedCountBadge.setText("0"); |
| 490 | // checkHistoryEmpty(); | 491 | // checkHistoryEmpty(); |
| ... | @@ -521,13 +522,14 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener | ... | @@ -521,13 +522,14 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener |
| 521 | mSortTileList.add(tileDeals); | 522 | mSortTileList.add(tileDeals); |
| 522 | 523 | ||
| 523 | SortTileModel tileUnified = new SortTileModel(); | 524 | SortTileModel tileUnified = new SortTileModel(); |
| 524 | - if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) { | 525 | +// if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) { |
| 525 | - tileUnified.setCount(WarplyManagerHelper.getMarketCouponsList().size()); | 526 | +// tileUnified.setCount(WarplyManagerHelper.getMarketCouponsList().size()); |
| 527 | + tileUnified.setCount(1); | ||
| 526 | tileUnified.setWeight(2); | 528 | tileUnified.setWeight(2); |
| 527 | - } else { | 529 | +// } else { |
| 528 | - tileUnified.setCount(0); | 530 | +// tileUnified.setCount(0); |
| 529 | - tileUnified.setWeight(2); | 531 | +// tileUnified.setWeight(2); |
| 530 | - } | 532 | +// } |
| 531 | if (WarplyManagerHelper.getSmCouponsList() != null && WarplyManagerHelper.getSmCouponsList().size() > 0) { | 533 | if (WarplyManagerHelper.getSmCouponsList() != null && WarplyManagerHelper.getSmCouponsList().size() > 0) { |
| 532 | int smTileCount = tileUnified.getCount(); | 534 | int smTileCount = tileUnified.getCount(); |
| 533 | tileUnified.setCount(smTileCount + WarplyManagerHelper.getSmCouponsList().size()); | 535 | tileUnified.setCount(smTileCount + WarplyManagerHelper.getSmCouponsList().size()); |
| ... | @@ -696,7 +698,8 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener | ... | @@ -696,7 +698,8 @@ public class MyRewardsFragment extends Fragment implements View.OnClickListener |
| 696 | 698 | ||
| 697 | /** Unified Coupons List */ | 699 | /** Unified Coupons List */ |
| 698 | // if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0){ | 700 | // if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0){ |
| 699 | - mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size() + WarplyManagerHelper.getSmCouponsList().size())); | 701 | +// mTvUnifiedCountBadge.setText(String.valueOf(WarplyManagerHelper.getMarketCouponsList().size() + WarplyManagerHelper.getSmCouponsList().size())); |
| 702 | + mTvUnifiedCountBadge.setText(String.valueOf(1)); | ||
| 700 | // }else{ | 703 | // }else{ |
| 701 | // mTvUnifiedCountBadge.setText("0"); | 704 | // mTvUnifiedCountBadge.setText("0"); |
| 702 | // } | 705 | // } | ... | ... |
| 1 | package ly.warp.sdk.views.adapters; | 1 | package ly.warp.sdk.views.adapters; |
| 2 | 2 | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | +import android.os.Build; | ||
| 5 | +import android.text.Html; | ||
| 4 | import android.text.TextUtils; | 6 | import android.text.TextUtils; |
| 5 | import android.view.LayoutInflater; | 7 | import android.view.LayoutInflater; |
| 6 | import android.view.View; | 8 | import android.view.View; |
| ... | @@ -50,7 +52,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -50,7 +52,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 50 | } | 52 | } |
| 51 | 53 | ||
| 52 | public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { | 54 | public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { |
| 53 | - private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvCouponSubtitle; | 55 | + private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvCouponSubtitle, tvCouponsShop; |
| 54 | private ImageView ivCouponLogo; | 56 | private ImageView ivCouponLogo; |
| 55 | 57 | ||
| 56 | public ExpiredCouponViewHolder(View view) { | 58 | public ExpiredCouponViewHolder(View view) { |
| ... | @@ -60,9 +62,13 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -60,9 +62,13 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 60 | tvCouponDate = view.findViewById(R.id.tv_expired_coupons_date); | 62 | tvCouponDate = view.findViewById(R.id.tv_expired_coupons_date); |
| 61 | ivCouponLogo = view.findViewById(R.id.iv_expired_logo); | 63 | ivCouponLogo = view.findViewById(R.id.iv_expired_logo); |
| 62 | tvCouponSubtitle = view.findViewById(R.id.tv_expired_coupons_label); | 64 | tvCouponSubtitle = view.findViewById(R.id.tv_expired_coupons_label); |
| 65 | + tvCouponsShop = view.findViewById(R.id.tv_expired_coupons_shop); | ||
| 63 | 66 | ||
| 64 | WarpUtils.renderCustomFont(mContext, R.font.peridot_bold, tvCouponDate, tvCouponValue); | 67 | WarpUtils.renderCustomFont(mContext, R.font.peridot_bold, tvCouponDate, tvCouponValue); |
| 65 | WarpUtils.renderCustomFont(mContext, R.font.peridot_regular, tvCouponTitle, tvCouponSubtitle); | 68 | WarpUtils.renderCustomFont(mContext, R.font.peridot_regular, tvCouponTitle, tvCouponSubtitle); |
| 69 | + if (mIsCustom) { | ||
| 70 | + WarpUtils.renderCustomFont(mContext, R.font.peridot_semi_bold, tvCouponTitle, tvCouponsShop); | ||
| 71 | + } | ||
| 66 | } | 72 | } |
| 67 | } | 73 | } |
| 68 | 74 | ||
| ... | @@ -89,6 +95,9 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -89,6 +95,9 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 89 | @Override | 95 | @Override |
| 90 | public ExpiredCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | 96 | public ExpiredCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
| 91 | View itemView; | 97 | View itemView; |
| 98 | + if (mIsCustom) | ||
| 99 | + itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.expired_coupon_layout_custom, parent, false); | ||
| 100 | + else | ||
| 92 | itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.expired_coupon_layout, parent, false); | 101 | itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.expired_coupon_layout, parent, false); |
| 93 | return new ExpiredCouponViewHolder(itemView); | 102 | return new ExpiredCouponViewHolder(itemView); |
| 94 | } | 103 | } |
| ... | @@ -100,6 +109,11 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -100,6 +109,11 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
| 100 | if (couponItem != null) { | 109 | if (couponItem != null) { |
| 101 | if (mIsCustom) { | 110 | if (mIsCustom) { |
| 102 | holder.tvCouponTitle.setText(couponItem.getMerchantDetails().getAdminName()); | 111 | holder.tvCouponTitle.setText(couponItem.getMerchantDetails().getAdminName()); |
| 112 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | ||
| 113 | + holder.tvCouponSubtitle.setText(Html.fromHtml(couponItem.getCouponsetDetails().getInnerText(), Html.FROM_HTML_MODE_COMPACT)); | ||
| 114 | + } else { | ||
| 115 | + holder.tvCouponSubtitle.setText(Html.fromHtml(couponItem.getCouponsetDetails().getInnerText())); | ||
| 116 | + } | ||
| 103 | if (!TextUtils.isEmpty(couponItem.getMerchantDetails().getImgPreview())) { | 117 | if (!TextUtils.isEmpty(couponItem.getMerchantDetails().getImgPreview())) { |
| 104 | Glide.with(mContext) | 118 | Glide.with(mContext) |
| 105 | // .setDefaultRequestOptions( | 119 | // .setDefaultRequestOptions( | ... | ... |
| ... | @@ -46,7 +46,8 @@ | ... | @@ -46,7 +46,8 @@ |
| 46 | android:gravity="center_horizontal" | 46 | android:gravity="center_horizontal" |
| 47 | android:paddingHorizontal="12dp" | 47 | android:paddingHorizontal="12dp" |
| 48 | android:paddingTop="12dp" | 48 | android:paddingTop="12dp" |
| 49 | - android:paddingBottom="8dp"> | 49 | + android:paddingBottom="8dp" |
| 50 | + android:visibility="gone"> | ||
| 50 | 51 | ||
| 51 | <include | 52 | <include |
| 52 | android:id="@+id/cl_tab_coupon_analysis" | 53 | android:id="@+id/cl_tab_coupon_analysis" |
| ... | @@ -65,7 +66,8 @@ | ... | @@ -65,7 +66,8 @@ |
| 65 | <RelativeLayout | 66 | <RelativeLayout |
| 66 | android:layout_width="match_parent" | 67 | android:layout_width="match_parent" |
| 67 | android:layout_height="wrap_content" | 68 | android:layout_height="wrap_content" |
| 68 | - android:paddingVertical="20dp"> | 69 | + android:paddingBottom="20dp" |
| 70 | + android:paddingTop="28dp"> | ||
| 69 | 71 | ||
| 70 | <ImageView | 72 | <ImageView |
| 71 | android:id="@+id/iv_gift_circle_logo" | 73 | android:id="@+id/iv_gift_circle_logo" | ... | ... |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + xmlns:tools="http://schemas.android.com/tools" | ||
| 4 | + android:layout_width="match_parent" | ||
| 5 | + android:layout_height="wrap_content" | ||
| 6 | + android:layout_marginBottom="32dp"> | ||
| 7 | + | ||
| 8 | + <TextView | ||
| 9 | + android:id="@+id/tv_expired_coupons_date" | ||
| 10 | + android:layout_width="wrap_content" | ||
| 11 | + android:layout_height="wrap_content" | ||
| 12 | + android:textColor="@color/cos_light_black" | ||
| 13 | + android:textSize="13sp" | ||
| 14 | + tools:text="05/05/2022" /> | ||
| 15 | + | ||
| 16 | + <LinearLayout | ||
| 17 | + android:layout_width="match_parent" | ||
| 18 | + android:layout_height="wrap_content" | ||
| 19 | + android:layout_below="@+id/tv_expired_coupons_date" | ||
| 20 | + android:layout_marginTop="8dp" | ||
| 21 | + android:orientation="horizontal" | ||
| 22 | + android:gravity="center_vertical"> | ||
| 23 | + | ||
| 24 | + <ImageView | ||
| 25 | + android:id="@+id/iv_expired_logo" | ||
| 26 | + android:layout_width="28dp" | ||
| 27 | + android:layout_height="28dp" | ||
| 28 | + tools:src="@drawable/ic_deals_circle" /> | ||
| 29 | + | ||
| 30 | + <LinearLayout | ||
| 31 | + android:layout_width="match_parent" | ||
| 32 | + android:layout_height="wrap_content" | ||
| 33 | + android:layout_marginStart="6dp" | ||
| 34 | + android:orientation="vertical"> | ||
| 35 | + | ||
| 36 | + <TextView | ||
| 37 | + android:id="@+id/tv_expired_coupons_title" | ||
| 38 | + android:layout_width="wrap_content" | ||
| 39 | + android:layout_height="wrap_content" | ||
| 40 | + android:maxLines="2" | ||
| 41 | + android:textColor="@color/cos_light_black" | ||
| 42 | + android:textSize="16sp" | ||
| 43 | + tools:text="Box" /> | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + <LinearLayout | ||
| 47 | + android:id="@+id/ll_expired_info_view" | ||
| 48 | + android:layout_width="match_parent" | ||
| 49 | + android:layout_height="wrap_content" | ||
| 50 | + android:orientation="horizontal" | ||
| 51 | + android:weightSum="1"> | ||
| 52 | + | ||
| 53 | + <TextView | ||
| 54 | + android:id="@+id/tv_expired_coupons_label" | ||
| 55 | + android:layout_width="wrap_content" | ||
| 56 | + android:layout_height="wrap_content" | ||
| 57 | + android:layout_weight="0.8" | ||
| 58 | + android:ellipsize="end" | ||
| 59 | + android:maxLines="1" | ||
| 60 | + android:text="@string/cos_expired_coupon_label" | ||
| 61 | + android:textColor="@color/cos_light_black" | ||
| 62 | + android:textSize="15sp" /> | ||
| 63 | + | ||
| 64 | + <TextView | ||
| 65 | + android:id="@+id/tv_expired_coupons_value" | ||
| 66 | + android:layout_width="wrap_content" | ||
| 67 | + android:layout_height="wrap_content" | ||
| 68 | + android:layout_weight="0.2" | ||
| 69 | + android:gravity="end" | ||
| 70 | + android:textColor="@color/cos_light_black" | ||
| 71 | + android:textSize="18sp" | ||
| 72 | + tools:text="4$" /> | ||
| 73 | + </LinearLayout> | ||
| 74 | + | ||
| 75 | + <TextView | ||
| 76 | + android:id="@+id/tv_expired_coupons_shop" | ||
| 77 | + android:layout_width="wrap_content" | ||
| 78 | + android:layout_height="wrap_content" | ||
| 79 | + android:layout_weight="0.8" | ||
| 80 | + android:ellipsize="end" | ||
| 81 | + android:maxLines="1" | ||
| 82 | + android:textColor="@color/cos_light_black" | ||
| 83 | + android:textSize="15sp" | ||
| 84 | + tools:text="@string/cos_expired_coupon_label" /> | ||
| 85 | + </LinearLayout> | ||
| 86 | + </LinearLayout> | ||
| 87 | +</RelativeLayout> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment