Showing
7 changed files
with
56 additions
and
7 deletions
... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { | ... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { |
36 | public void onWarplyReady() { | 36 | public void onWarplyReady() { |
37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { | 37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { |
38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() | 38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() |
39 | - .setGuid("6012049321"), //6012049321, 6012049322, 6012049323 | 39 | + .setGuid("6012049139"), //6012049321, 6012049322, 6012049323 |
40 | mLoginReceiver); | 40 | mLoginReceiver); |
41 | } else { | 41 | } else { |
42 | startNextActivity(); | 42 | startNextActivity(); | ... | ... |
... | @@ -46,7 +46,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -46,7 +46,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
46 | 46 | ||
47 | private ImageView mIvBack, mIvCouponPhoto, mIvBarcode; | 47 | private ImageView mIvBack, mIvCouponPhoto, mIvBarcode; |
48 | private TextView mTvTerms, mTvCouponCode, mTvCouponTitle, mTvCouponSubtitle, mTvCouponDate, | 48 | private TextView mTvTerms, mTvCouponCode, mTvCouponTitle, mTvCouponSubtitle, mTvCouponDate, |
49 | - mTvTermsValue; | 49 | + mTvTermsValue, mTvFullBarcode; |
50 | private LinearLayout mLlGiftIt, mLlShops, mLlBarcodeShown, mLlBarcodeContainer, mLlTerms; | 50 | private LinearLayout mLlGiftIt, mLlShops, mLlBarcodeShown, mLlBarcodeContainer, mLlTerms; |
51 | private Coupon mCoupon; | 51 | private Coupon mCoupon; |
52 | private Couponset mCouponset; | 52 | private Couponset mCouponset; |
... | @@ -77,6 +77,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -77,6 +77,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
77 | mLlBarcodeContainer = findViewById(R.id.ll_barcode_container_items); | 77 | mLlBarcodeContainer = findViewById(R.id.ll_barcode_container_items); |
78 | mLlTerms = findViewById(R.id.ll_terms_inner); | 78 | mLlTerms = findViewById(R.id.ll_terms_inner); |
79 | mTvTermsValue = findViewById(R.id.tv_terms_value); | 79 | mTvTermsValue = findViewById(R.id.tv_terms_value); |
80 | + mTvFullBarcode = findViewById(R.id.tv_full_barcode); | ||
80 | 81 | ||
81 | initViews(); | 82 | initViews(); |
82 | } | 83 | } |
... | @@ -149,7 +150,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -149,7 +150,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
149 | private void initViews() { | 150 | private void initViews() { |
150 | mTvCouponCode.setText(mCoupon.getCoupon()); | 151 | mTvCouponCode.setText(mCoupon.getCoupon()); |
151 | mTvCouponTitle.setText(mCoupon.getName()); | 152 | mTvCouponTitle.setText(mCoupon.getName()); |
152 | - mTvCouponSubtitle.setText(mCoupon.getDescription()); | 153 | +// mTvCouponSubtitle.setText(mCoupon.getDescription()); |
153 | 154 | ||
154 | if (WarplyManagerHelper.getCouponsets() != null && WarplyManagerHelper.getCouponsets().size() > 0) { | 155 | if (WarplyManagerHelper.getCouponsets() != null && WarplyManagerHelper.getCouponsets().size() > 0) { |
155 | for (Couponset couponset : WarplyManagerHelper.getCouponsets()) { | 156 | for (Couponset couponset : WarplyManagerHelper.getCouponsets()) { |
... | @@ -161,6 +162,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -161,6 +162,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
161 | } | 162 | } |
162 | 163 | ||
163 | if (mCouponset != null) { | 164 | if (mCouponset != null) { |
165 | + mTvCouponSubtitle.setText(mCouponset.getShortDescription()); | ||
164 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | 166 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
165 | mTvTermsValue.setText(Html.fromHtml(mCouponset.getTerms(), Html.FROM_HTML_MODE_COMPACT)); | 167 | mTvTermsValue.setText(Html.fromHtml(mCouponset.getTerms(), Html.FROM_HTML_MODE_COMPACT)); |
166 | } else { | 168 | } else { |
... | @@ -219,6 +221,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -219,6 +221,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
219 | } | 221 | } |
220 | } | 222 | } |
221 | mIvBarcode.setImageBitmap(bmp); | 223 | mIvBarcode.setImageBitmap(bmp); |
224 | + mTvFullBarcode.setText(barcodeString); | ||
222 | 225 | ||
223 | } catch (Exception e) { | 226 | } catch (Exception e) { |
224 | e.printStackTrace(); | 227 | e.printStackTrace(); | ... | ... |
... | @@ -61,6 +61,7 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -61,6 +61,7 @@ public class Coupon implements Parcelable, Serializable { |
61 | private static final String CHANGES_DATES = "changes_dates"; | 61 | private static final String CHANGES_DATES = "changes_dates"; |
62 | private static final String COUPONSET_UUID = "couponset_uuid"; | 62 | private static final String COUPONSET_UUID = "couponset_uuid"; |
63 | private static final String MERCHANT_UUID = "merchant_uuid"; | 63 | private static final String MERCHANT_UUID = "merchant_uuid"; |
64 | + private static final String INNER_TEXT = "inner_text"; | ||
64 | 65 | ||
65 | /* Member variables of the Campaign object */ | 66 | /* Member variables of the Campaign object */ |
66 | 67 | ||
... | @@ -79,6 +80,7 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -79,6 +80,7 @@ public class Coupon implements Parcelable, Serializable { |
79 | private JSONObject changesDates = new JSONObject(); | 80 | private JSONObject changesDates = new JSONObject(); |
80 | private String couponsetUuid = ""; | 81 | private String couponsetUuid = ""; |
81 | private String merchantUuid = ""; | 82 | private String merchantUuid = ""; |
83 | + private String innerText = ""; | ||
82 | 84 | ||
83 | /** | 85 | /** |
84 | * Basic constructor used to create an object from a String, representing a | 86 | * Basic constructor used to create an object from a String, representing a |
... | @@ -113,6 +115,7 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -113,6 +115,7 @@ public class Coupon implements Parcelable, Serializable { |
113 | this.changesDates = json.optJSONObject(CHANGES_DATES); | 115 | this.changesDates = json.optJSONObject(CHANGES_DATES); |
114 | this.couponsetUuid = json.optString(COUPONSET_UUID); | 116 | this.couponsetUuid = json.optString(COUPONSET_UUID); |
115 | this.merchantUuid = json.optString(MERCHANT_UUID); | 117 | this.merchantUuid = json.optString(MERCHANT_UUID); |
118 | + this.innerText = json.optString(INNER_TEXT); | ||
116 | } | 119 | } |
117 | } | 120 | } |
118 | 121 | ||
... | @@ -131,6 +134,7 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -131,6 +134,7 @@ public class Coupon implements Parcelable, Serializable { |
131 | this.transactionUuid = source.readString(); | 134 | this.transactionUuid = source.readString(); |
132 | this.couponsetUuid = source.readString(); | 135 | this.couponsetUuid = source.readString(); |
133 | this.merchantUuid = source.readString(); | 136 | this.merchantUuid = source.readString(); |
137 | + this.innerText = source.readString(); | ||
134 | } | 138 | } |
135 | 139 | ||
136 | @Override | 140 | @Override |
... | @@ -149,6 +153,7 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -149,6 +153,7 @@ public class Coupon implements Parcelable, Serializable { |
149 | dest.writeString(this.transactionUuid); | 153 | dest.writeString(this.transactionUuid); |
150 | dest.writeString(this.couponsetUuid); | 154 | dest.writeString(this.couponsetUuid); |
151 | dest.writeString(this.merchantUuid); | 155 | dest.writeString(this.merchantUuid); |
156 | + dest.writeString(this.innerText); | ||
152 | } | 157 | } |
153 | 158 | ||
154 | /** | 159 | /** |
... | @@ -174,6 +179,7 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -174,6 +179,7 @@ public class Coupon implements Parcelable, Serializable { |
174 | jObj.putOpt(CHANGES_DATES, this.changesDates); | 179 | jObj.putOpt(CHANGES_DATES, this.changesDates); |
175 | jObj.putOpt(COUPONSET_UUID, this.couponsetUuid); | 180 | jObj.putOpt(COUPONSET_UUID, this.couponsetUuid); |
176 | jObj.putOpt(MERCHANT_UUID, this.merchantUuid); | 181 | jObj.putOpt(MERCHANT_UUID, this.merchantUuid); |
182 | + jObj.putOpt(INNER_TEXT, this.innerText); | ||
177 | } catch (JSONException e) { | 183 | } catch (JSONException e) { |
178 | if (WarpConstants.DEBUG) { | 184 | if (WarpConstants.DEBUG) { |
179 | e.printStackTrace(); | 185 | e.printStackTrace(); |
... | @@ -333,6 +339,14 @@ public class Coupon implements Parcelable, Serializable { | ... | @@ -333,6 +339,14 @@ public class Coupon implements Parcelable, Serializable { |
333 | this.merchantUuid = merchantUuid; | 339 | this.merchantUuid = merchantUuid; |
334 | } | 340 | } |
335 | 341 | ||
342 | + public String getInnerText() { | ||
343 | + return innerText; | ||
344 | + } | ||
345 | + | ||
346 | + public void setInnerText(String innerText) { | ||
347 | + this.innerText = innerText; | ||
348 | + } | ||
349 | + | ||
336 | @Override | 350 | @Override |
337 | public int describeContents() { | 351 | public int describeContents() { |
338 | return 0; | 352 | return 0; | ... | ... |
... | @@ -73,6 +73,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -73,6 +73,7 @@ public class Couponset implements Parcelable, Serializable { |
73 | private static final String TERMS = "terms"; | 73 | private static final String TERMS = "terms"; |
74 | private static final String AVAILABILITY = "availability"; | 74 | private static final String AVAILABILITY = "availability"; |
75 | private static final String MERCHANT_UUID = "merchant_uuid"; | 75 | private static final String MERCHANT_UUID = "merchant_uuid"; |
76 | + private static final String INNER_TEXT = "inner_text"; | ||
76 | 77 | ||
77 | 78 | ||
78 | /* Member variables of the Campaign object */ | 79 | /* Member variables of the Campaign object */ |
... | @@ -102,6 +103,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -102,6 +103,7 @@ public class Couponset implements Parcelable, Serializable { |
102 | private String terms = ""; | 103 | private String terms = ""; |
103 | private int availability = 0; | 104 | private int availability = 0; |
104 | private String merchantUuid = ""; | 105 | private String merchantUuid = ""; |
106 | + private String innerText = ""; | ||
105 | 107 | ||
106 | /** | 108 | /** |
107 | * Basic constructor used to create an object from a String, representing a | 109 | * Basic constructor used to create an object from a String, representing a |
... | @@ -153,6 +155,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -153,6 +155,7 @@ public class Couponset implements Parcelable, Serializable { |
153 | this.terms = json.optString(TERMS); | 155 | this.terms = json.optString(TERMS); |
154 | this.availability = json.optInt(AVAILABILITY); | 156 | this.availability = json.optInt(AVAILABILITY); |
155 | this.merchantUuid = json.optString(MERCHANT_UUID); | 157 | this.merchantUuid = json.optString(MERCHANT_UUID); |
158 | + this.innerText = json.optString(INNER_TEXT); | ||
156 | } | 159 | } |
157 | } | 160 | } |
158 | 161 | ||
... | @@ -180,6 +183,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -180,6 +183,7 @@ public class Couponset implements Parcelable, Serializable { |
180 | this.terms = source.readString(); | 183 | this.terms = source.readString(); |
181 | this.availability = source.readInt(); | 184 | this.availability = source.readInt(); |
182 | this.merchantUuid = source.readString(); | 185 | this.merchantUuid = source.readString(); |
186 | + this.innerText = source.readString(); | ||
183 | } | 187 | } |
184 | 188 | ||
185 | @Override | 189 | @Override |
... | @@ -207,6 +211,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -207,6 +211,7 @@ public class Couponset implements Parcelable, Serializable { |
207 | dest.writeString(this.terms); | 211 | dest.writeString(this.terms); |
208 | dest.writeInt(this.availability); | 212 | dest.writeInt(this.availability); |
209 | dest.writeString(this.merchantUuid); | 213 | dest.writeString(this.merchantUuid); |
214 | + dest.writeString(this.innerText); | ||
210 | } | 215 | } |
211 | 216 | ||
212 | /** | 217 | /** |
... | @@ -242,6 +247,7 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -242,6 +247,7 @@ public class Couponset implements Parcelable, Serializable { |
242 | jObj.putOpt(TERMS, this.terms); | 247 | jObj.putOpt(TERMS, this.terms); |
243 | jObj.putOpt(AVAILABILITY, this.availability); | 248 | jObj.putOpt(AVAILABILITY, this.availability); |
244 | jObj.putOpt(MERCHANT_UUID, this.merchantUuid); | 249 | jObj.putOpt(MERCHANT_UUID, this.merchantUuid); |
250 | + jObj.putOpt(INNER_TEXT, this.innerText); | ||
245 | } catch (JSONException e) { | 251 | } catch (JSONException e) { |
246 | if (WarpConstants.DEBUG) { | 252 | if (WarpConstants.DEBUG) { |
247 | e.printStackTrace(); | 253 | e.printStackTrace(); |
... | @@ -381,6 +387,10 @@ public class Couponset implements Parcelable, Serializable { | ... | @@ -381,6 +387,10 @@ public class Couponset implements Parcelable, Serializable { |
381 | return merchantUuid; | 387 | return merchantUuid; |
382 | } | 388 | } |
383 | 389 | ||
390 | + public String getInnerText() { | ||
391 | + return innerText; | ||
392 | + } | ||
393 | + | ||
384 | @Override | 394 | @Override |
385 | public int describeContents() { | 395 | public int describeContents() { |
386 | return 0; | 396 | return 0; | ... | ... |
... | @@ -2189,6 +2189,7 @@ public class WarplyManager { | ... | @@ -2189,6 +2189,7 @@ public class WarplyManager { |
2189 | coupon.setImage(couponset.getImgPreview()); | 2189 | coupon.setImage(couponset.getImgPreview()); |
2190 | coupon.setName(couponset.getName()); | 2190 | coupon.setName(couponset.getName()); |
2191 | coupon.setMerchantUuid(couponset.getMerchantUuid()); | 2191 | coupon.setMerchantUuid(couponset.getMerchantUuid()); |
2192 | + coupon.setInnerText(couponset.getInnerText()); | ||
2192 | mCouponList.add(coupon); | 2193 | mCouponList.add(coupon); |
2193 | } | 2194 | } |
2194 | } | 2195 | } | ... | ... |
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; |
... | @@ -126,8 +128,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -126,8 +128,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
126 | } | 128 | } |
127 | 129 | ||
128 | holder.tvCouponTitle.setText(couponItem.getName()); | 130 | holder.tvCouponTitle.setText(couponItem.getName()); |
129 | - if (!mIsPast) | 131 | + if (!mIsPast) { |
130 | - holder.tvCouponDescription.setText(couponItem.getDescription()); | 132 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
133 | + holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText(), Html.FROM_HTML_MODE_COMPACT)); | ||
134 | + } else { | ||
135 | + holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText())); | ||
136 | + } | ||
137 | + } | ||
131 | } else { | 138 | } else { |
132 | if (!TextUtils.isEmpty(merchant.getImage())) { | 139 | if (!TextUtils.isEmpty(merchant.getImage())) { |
133 | Glide.with(mContext) | 140 | Glide.with(mContext) |
... | @@ -145,8 +152,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte | ... | @@ -145,8 +152,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte |
145 | } | 152 | } |
146 | 153 | ||
147 | holder.tvCouponTitle.setText(merchant.getAdminName()); | 154 | holder.tvCouponTitle.setText(merchant.getAdminName()); |
148 | - if (!mIsPast) | 155 | + if (!mIsPast) { |
149 | - holder.tvCouponDescription.setText(merchant.getShortDescription()); | 156 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
157 | + holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText(), Html.FROM_HTML_MODE_COMPACT)); | ||
158 | + } else { | ||
159 | + holder.tvCouponDescription.setText(Html.fromHtml(couponItem.getInnerText())); | ||
160 | + } | ||
161 | + } | ||
150 | } | 162 | } |
151 | 163 | ||
152 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 164 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | ... | ... |
... | @@ -167,6 +167,15 @@ | ... | @@ -167,6 +167,15 @@ |
167 | app:layout_constraintTop_toBottomOf="@+id/view5" | 167 | app:layout_constraintTop_toBottomOf="@+id/view5" |
168 | tools:srcCompat="@tools:sample/avatars" /> | 168 | tools:srcCompat="@tools:sample/avatars" /> |
169 | 169 | ||
170 | + <TextView | ||
171 | + android:id="@+id/tv_full_barcode" | ||
172 | + fontPath="fonts/pf_square_sans_pro_regular.ttf" | ||
173 | + android:layout_width="wrap_content" | ||
174 | + android:layout_height="wrap_content" | ||
175 | + android:layout_marginTop="12dp" | ||
176 | + android:textColor="@color/grey" | ||
177 | + android:textSize="20sp" | ||
178 | + tools:text="@string/cos_show_barcode" /> | ||
170 | 179 | ||
171 | <View | 180 | <View |
172 | android:id="@+id/view4" | 181 | android:id="@+id/view4" | ... | ... |
-
Please register or login to post a comment