Panagiotis Triantafyllou

redesign part2

......@@ -49,7 +49,7 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
private TextView mTvValue;
private TextView mTvMoreButton;
private ImageView mIvImage;
private LinearLayout mRedeemButton;
private LinearLayout mRedeemButton, mSuccessButton;
private boolean mIsDescriptionExpanded = false;
private RelativeLayout mPbLoading;
// Terms of Use section
......@@ -59,7 +59,8 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
private ImageView mIvTermsArrow;
private TextView mTvTermsText;
private boolean mIsTermsExpanded = false;
private TextView mTvTermsTitle, mTvRedeemTitle, mTvMerchantName;
private TextView mTvTermsTitle, mTvRedeemTitle, mTvMerchantName,
mTvSuccessRedeemTitle;
// ===========================================================
......@@ -114,6 +115,8 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
mRedeemButton = findViewById(R.id.ll_redeem_coupon);
mRedeemButton.setOnClickListener(this);
mSuccessButton = findViewById(R.id.ll_success_redeem);
// Initialize views
mTvSmallDescription = findViewById(R.id.tv_coupon_small_description);
mTvFullDescription = findViewById(R.id.tv_coupon_full_description);
......@@ -132,13 +135,14 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
mTvTermsTitle = findViewById(R.id.tv_terms_title);
mTvRedeemTitle = findViewById(R.id.tv_redeem_title);
mTvSuccessRedeemTitle = findViewById(R.id.tv_success_redeem_title);
WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvValue,
mTvTermsTitle, mTvMoreButton, mTvMerchantName,
mTvEndDate);
WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, mTvSmallDescription,
mTvFullDescription, mTvTermsText, mTvRedeemTitle);
mTvFullDescription, mTvTermsText, mTvRedeemTitle, mTvSuccessRedeemTitle);
if (mOfferItem != null) {
if (mOfferItem.getEndDate() != null && !mOfferItem.getEndDate().isEmpty()) {
......@@ -274,13 +278,16 @@ public class SingleCouponsetActivity extends Activity implements View.OnClickLis
public void onSuccess(JSONObject result) {
mPbLoading.setVisibility(View.GONE);
Toast.makeText(SingleCouponsetActivity.this, "RETRIEVE SUCCESS", Toast.LENGTH_SHORT).show();
Coupon coupon = new Coupon();
coupon.setCoupon(result.optString("coupon", ""));
coupon.setExpiration(result.optString("expiration", ""));
coupon.setCouponsetDetails(mOfferItem);
Intent myIntent = new Intent(SingleCouponsetActivity.this, SingleCouponActivity.class);
myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, (Parcelable) coupon);
startActivity(myIntent);
// Coupon coupon = new Coupon();
// coupon.setCoupon(result.optString("coupon", ""));
// coupon.setExpiration(result.optString("expiration", ""));
// coupon.setCouponsetDetails(mOfferItem);
// Intent myIntent = new Intent(SingleCouponsetActivity.this, SingleCouponActivity.class);
// myIntent.putExtra(SingleCouponActivity.EXTRA_OFFER_ITEM, (Parcelable) coupon);
// startActivity(myIntent);
mRedeemButton.setVisibility(View.GONE);
mSuccessButton.setVisibility(View.VISIBLE);
}
@Override
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="1000dp" />
<solid
android:width="2dp"
android:color="@color/custom_light_green" />
</shape>
\ No newline at end of file
......@@ -177,18 +177,46 @@
android:id="@+id/tv_redeem_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/demo_redeem"
android:includeFontPadding="false"
android:text="@string/demo_redeem"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_success_redeem"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginTop="20dp"
android:background="@drawable/shape_rectangle_rounded_light_green"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@drawable/demo_tick_green" />
<View
android:layout_width="12dp"
android:layout_height="match_parent" />
<TextView
android:id="@+id/tv_success_redeem_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="@string/demo_success_redeem"
android:textColor="@color/custom_green"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/terms_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginTop="28dp"
android:orientation="vertical"
android:paddingHorizontal="2dp">
......@@ -196,8 +224,8 @@
android:id="@+id/terms_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_gravity="center"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
......
......@@ -30,4 +30,6 @@
<color name="custom_black7">#002430</color>
<color name="custom_skyblue4">#DDEFFB</color>
<color name="custom_skyblue5">#CCE9FB</color>
<color name="custom_green">#0D9E5B</color>
<color name="custom_light_green">#DBF6E6</color>
</resources>
......
......@@ -22,6 +22,7 @@
<string name="demo_shops">Καταστήματα κοντά μου</string>
<string name="demo_website">Δες το website</string>
<string name="demo_redeem">Get coupon</string>
<string name="demo_success_redeem">Saved to My Coupons</string>
<string name="demo_profile">Το προφίλ μου</string>
<string name="demo_my_coupons">Τα κουπόνια μου</string>
<string name="demo_active">Ενεργά</string>
......