Showing
3 changed files
with
26 additions
and
3 deletions
| ... | @@ -167,9 +167,13 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup | ... | @@ -167,9 +167,13 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup |
| 167 | 167 | ||
| 168 | @Override | 168 | @Override |
| 169 | public void onCouponsetClick(Couponset couponset, int position) { | 169 | public void onCouponsetClick(Couponset couponset, int position) { |
| 170 | - Intent myIntent = new Intent(HomeActivity.this, SingleCouponsetActivity.class); | 170 | +// if (!couponset.isLocked()) { |
| 171 | - myIntent.putExtra(SingleCouponsetActivity.EXTRA_OFFER_ITEM, (Parcelable) couponset); | 171 | + Intent myIntent = new Intent(HomeActivity.this, SingleCouponsetActivity.class); |
| 172 | - startActivity(myIntent); | 172 | + myIntent.putExtra(SingleCouponsetActivity.EXTRA_OFFER_ITEM, (Parcelable) couponset); |
| 173 | + startActivity(myIntent); | ||
| 174 | +// } else { | ||
| 175 | +// //TODO: make something | ||
| 176 | +// } | ||
| 173 | } | 177 | } |
| 174 | 178 | ||
| 175 | // =========================================================== | 179 | // =========================================================== | ... | ... |
| ... | @@ -80,6 +80,7 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup | ... | @@ -80,6 +80,7 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup |
| 80 | private final TextView tvTitle; | 80 | private final TextView tvTitle; |
| 81 | private final TextView tvDescription; | 81 | private final TextView tvDescription; |
| 82 | private final TextView tvValidity; | 82 | private final TextView tvValidity; |
| 83 | + private final ImageView ivLock; | ||
| 83 | 84 | ||
| 84 | CouponsetViewHolder(@NonNull View itemView) { | 85 | CouponsetViewHolder(@NonNull View itemView) { |
| 85 | super(itemView); | 86 | super(itemView); |
| ... | @@ -89,6 +90,7 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup | ... | @@ -89,6 +90,7 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup |
| 89 | tvTitle = itemView.findViewById(R.id.tv_title); | 90 | tvTitle = itemView.findViewById(R.id.tv_title); |
| 90 | tvDescription = itemView.findViewById(R.id.tv_description); | 91 | tvDescription = itemView.findViewById(R.id.tv_description); |
| 91 | tvValidity = itemView.findViewById(R.id.tv_validity); | 92 | tvValidity = itemView.findViewById(R.id.tv_validity); |
| 93 | + ivLock = itemView.findViewById(R.id.iv_lock); | ||
| 92 | 94 | ||
| 93 | WarpUtils.renderCustomFont(context, R.font.ping_lcg_bold, tvPrice, tvTitle); | 95 | WarpUtils.renderCustomFont(context, R.font.ping_lcg_bold, tvPrice, tvTitle); |
| 94 | WarpUtils.renderCustomFont(context, R.font.ping_lcg_regular, tvDescription, tvValidity); | 96 | WarpUtils.renderCustomFont(context, R.font.ping_lcg_regular, tvDescription, tvValidity); |
| ... | @@ -120,6 +122,12 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup | ... | @@ -120,6 +122,12 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup |
| 120 | } else { | 122 | } else { |
| 121 | ivLogo.setVisibility(View.GONE); | 123 | ivLogo.setVisibility(View.GONE); |
| 122 | } | 124 | } |
| 125 | + | ||
| 126 | +// if (couponset.isLocked()) { | ||
| 127 | +// ivLogo.setVisibility(View.VISIBLE); | ||
| 128 | +// } else { | ||
| 129 | +// ivLogo.setVisibility(View.GONE); | ||
| 130 | +// } | ||
| 123 | } | 131 | } |
| 124 | 132 | ||
| 125 | private String formatValidityDate(String endDate) { | 133 | private String formatValidityDate(String endDate) { | ... | ... |
| ... | @@ -26,6 +26,17 @@ | ... | @@ -26,6 +26,17 @@ |
| 26 | android:textSize="16sp" | 26 | android:textSize="16sp" |
| 27 | tools:text="17,95€" /> | 27 | tools:text="17,95€" /> |
| 28 | 28 | ||
| 29 | + <ImageView | ||
| 30 | + android:id="@+id/iv_lock" | ||
| 31 | + android:layout_width="20dp" | ||
| 32 | + android:layout_height="20dp" | ||
| 33 | + android:layout_alignParentStart="true" | ||
| 34 | + android:layout_marginStart="8dp" | ||
| 35 | + android:layout_marginTop="88dp" | ||
| 36 | + android:scaleType="centerInside" | ||
| 37 | + android:src="@drawable/demo_avis" | ||
| 38 | + android:visibility="gone"/> | ||
| 39 | + | ||
| 29 | <androidx.constraintlayout.widget.ConstraintLayout | 40 | <androidx.constraintlayout.widget.ConstraintLayout |
| 30 | android:layout_width="match_parent" | 41 | android:layout_width="match_parent" |
| 31 | android:layout_height="match_parent" | 42 | android:layout_height="match_parent" | ... | ... |
-
Please register or login to post a comment