Panagiotis Triantafyllou

redesign part2

...@@ -49,7 +49,7 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis ...@@ -49,7 +49,7 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
49 private TextView mTvValue; 49 private TextView mTvValue;
50 private TextView mTvMoreButton; 50 private TextView mTvMoreButton;
51 private ImageView mIvImage; 51 private ImageView mIvImage;
52 - private LinearLayout mRedeemButton; 52 + private LinearLayout mRedeemButton, mSuccessButton;
53 private boolean mIsDescriptionExpanded = false; 53 private boolean mIsDescriptionExpanded = false;
54 private RelativeLayout mPbLoading; 54 private RelativeLayout mPbLoading;
55 // Terms of Use section 55 // Terms of Use section
...@@ -59,7 +59,8 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis ...@@ -59,7 +59,8 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
59 private ImageView mIvTermsArrow; 59 private ImageView mIvTermsArrow;
60 private TextView mTvTermsText; 60 private TextView mTvTermsText;
61 private boolean mIsTermsExpanded = false; 61 private boolean mIsTermsExpanded = false;
62 - private TextView mTvTermsTitle, mTvRedeemTitle, mTvMerchantName; 62 + private TextView mTvTermsTitle, mTvRedeemTitle, mTvMerchantName,
63 + mTvSuccessRedeemTitle;
63 64
64 65
65 // =========================================================== 66 // ===========================================================
...@@ -114,6 +115,8 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis ...@@ -114,6 +115,8 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
114 mRedeemButton = findViewById(R.id.ll_redeem_coupon); 115 mRedeemButton = findViewById(R.id.ll_redeem_coupon);
115 mRedeemButton.setOnClickListener(this); 116 mRedeemButton.setOnClickListener(this);
116 117
118 + mSuccessButton = findViewById(R.id.ll_success_redeem);
119 +
117 // Initialize views 120 // Initialize views
118 mTvSmallDescription = findViewById(R.id.tv_coupon_small_description); 121 mTvSmallDescription = findViewById(R.id.tv_coupon_small_description);
119 mTvFullDescription = findViewById(R.id.tv_coupon_full_description); 122 mTvFullDescription = findViewById(R.id.tv_coupon_full_description);
...@@ -132,13 +135,14 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis ...@@ -132,13 +135,14 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
132 135
133 mTvTermsTitle = findViewById(R.id.tv_terms_title); 136 mTvTermsTitle = findViewById(R.id.tv_terms_title);
134 mTvRedeemTitle = findViewById(R.id.tv_redeem_title); 137 mTvRedeemTitle = findViewById(R.id.tv_redeem_title);
138 + mTvSuccessRedeemTitle = findViewById(R.id.tv_success_redeem_title);
135 139
136 WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvValue, 140 WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvValue,
137 mTvTermsTitle, mTvMoreButton, mTvMerchantName, 141 mTvTermsTitle, mTvMoreButton, mTvMerchantName,
138 mTvEndDate); 142 mTvEndDate);
139 143
140 WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, mTvSmallDescription, 144 WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, mTvSmallDescription,
141 - mTvFullDescription, mTvTermsText, mTvRedeemTitle); 145 + mTvFullDescription, mTvTermsText, mTvRedeemTitle, mTvSuccessRedeemTitle);
142 146
143 if (mOfferItem != null) { 147 if (mOfferItem != null) {
144 if (mOfferItem.getEndDate() != null && !mOfferItem.getEndDate().isEmpty()) { 148 if (mOfferItem.getEndDate() != null && !mOfferItem.getEndDate().isEmpty()) {
...@@ -274,13 +278,16 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis ...@@ -274,13 +278,16 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
274 public void onSuccess(JSONObject result) { 278 public void onSuccess(JSONObject result) {
275 mPbLoading.setVisibility(View.GONE); 279 mPbLoading.setVisibility(View.GONE);
276 Toast.makeText(SingleCouponsetActivity.this, "RETRIEVE SUCCESS", Toast.LENGTH_SHORT).show(); 280 Toast.makeText(SingleCouponsetActivity.this, "RETRIEVE SUCCESS", Toast.LENGTH_SHORT).show();
277 - Coupon coupon = new Coupon(); 281 +// Coupon coupon = new Coupon();
278 - coupon.setCoupon(result.optString("coupon", "")); 282 +// coupon.setCoupon(result.optString("coupon", ""));
279 - coupon.setExpiration(result.optString("expiration", "")); 283 +// coupon.setExpiration(result.optString("expiration", ""));
280 - coupon.setCouponsetDetails(mOfferItem); 284 +// coupon.setCouponsetDetails(mOfferItem);
281 - Intent myIntent = new Intent(SingleCouponsetActivity.this, SingleCouponActivity.class); 285 +// Intent myIntent = new Intent(SingleCouponsetActivity.this, SingleCouponActivity.class);
282 - myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, (Parcelable) coupon); 286 +// myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, (Parcelable) coupon);
283 - startActivity(myIntent); 287 +// startActivity(myIntent);
288 +
289 + mRedeemButton.setVisibility(View.GONE);
290 + mSuccessButton.setVisibility(View.VISIBLE);
284 } 291 }
285 292
286 @Override 293 @Override
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
3 + android:shape="rectangle">
4 + <corners android:radius="1000dp" />
5 +
6 + <solid
7 + android:width="2dp"
8 + android:color="@color/custom_light_green" />
9 +</shape>
...\ No newline at end of file ...\ No newline at end of file
...@@ -177,18 +177,46 @@ ...@@ -177,18 +177,46 @@
177 android:id="@+id/tv_redeem_title" 177 android:id="@+id/tv_redeem_title"
178 android:layout_width="wrap_content" 178 android:layout_width="wrap_content"
179 android:layout_height="wrap_content" 179 android:layout_height="wrap_content"
180 - android:text="@string/demo_redeem"
181 android:includeFontPadding="false" 180 android:includeFontPadding="false"
181 + android:text="@string/demo_redeem"
182 android:textColor="@color/white" 182 android:textColor="@color/white"
183 - android:textSize="16sp" 183 + android:textSize="16sp" />
184 - android:textStyle="bold" /> 184 + </LinearLayout>
185 +
186 + <LinearLayout
187 + android:id="@+id/ll_success_redeem"
188 + android:layout_width="match_parent"
189 + android:layout_height="55dp"
190 + android:layout_marginTop="20dp"
191 + android:background="@drawable/shape_rectangle_rounded_light_green"
192 + android:gravity="center"
193 + android:orientation="horizontal"
194 + android:visibility="gone">
195 +
196 + <ImageView
197 + android:layout_width="18dp"
198 + android:layout_height="18dp"
199 + android:src="@drawable/demo_tick_green" />
200 +
201 + <View
202 + android:layout_width="12dp"
203 + android:layout_height="match_parent" />
204 +
205 + <TextView
206 + android:id="@+id/tv_success_redeem_title"
207 + android:layout_width="wrap_content"
208 + android:layout_height="wrap_content"
209 + android:includeFontPadding="false"
210 + android:text="@string/demo_success_redeem"
211 + android:textColor="@color/custom_green"
212 + android:textSize="16sp" />
185 </LinearLayout> 213 </LinearLayout>
186 214
187 <LinearLayout 215 <LinearLayout
188 android:id="@+id/terms_container" 216 android:id="@+id/terms_container"
189 android:layout_width="match_parent" 217 android:layout_width="match_parent"
190 android:layout_height="wrap_content" 218 android:layout_height="wrap_content"
191 - android:layout_marginTop="32dp" 219 + android:layout_marginTop="28dp"
192 android:orientation="vertical" 220 android:orientation="vertical"
193 android:paddingHorizontal="2dp"> 221 android:paddingHorizontal="2dp">
194 222
...@@ -196,8 +224,8 @@ ...@@ -196,8 +224,8 @@
196 android:id="@+id/terms_header" 224 android:id="@+id/terms_header"
197 android:layout_width="wrap_content" 225 android:layout_width="wrap_content"
198 android:layout_height="wrap_content" 226 android:layout_height="wrap_content"
199 - android:gravity="center_vertical"
200 android:layout_gravity="center" 227 android:layout_gravity="center"
228 + android:gravity="center_vertical"
201 android:orientation="horizontal"> 229 android:orientation="horizontal">
202 230
203 <TextView 231 <TextView
......
...@@ -30,4 +30,6 @@ ...@@ -30,4 +30,6 @@
30 <color name="custom_black7">#002430</color> 30 <color name="custom_black7">#002430</color>
31 <color name="custom_skyblue4">#DDEFFB</color> 31 <color name="custom_skyblue4">#DDEFFB</color>
32 <color name="custom_skyblue5">#CCE9FB</color> 32 <color name="custom_skyblue5">#CCE9FB</color>
33 + <color name="custom_green">#0D9E5B</color>
34 + <color name="custom_light_green">#DBF6E6</color>
33 </resources> 35 </resources>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
22 <string name="demo_shops">Καταστήματα κοντά μου</string> 22 <string name="demo_shops">Καταστήματα κοντά μου</string>
23 <string name="demo_website">Δες το website</string> 23 <string name="demo_website">Δες το website</string>
24 <string name="demo_redeem">Get coupon</string> 24 <string name="demo_redeem">Get coupon</string>
25 + <string name="demo_success_redeem">Saved to My Coupons</string>
25 <string name="demo_profile">Το προφίλ μου</string> 26 <string name="demo_profile">Το προφίλ μου</string>
26 <string name="demo_my_coupons">Τα κουπόνια μου</string> 27 <string name="demo_my_coupons">Τα κουπόνια μου</string>
27 <string name="demo_active">Ενεργά</string> 28 <string name="demo_active">Ενεργά</string>
......