Showing
5 changed files
with
13 additions
and
4 deletions
| ... | @@ -16,6 +16,7 @@ import androidx.recyclerview.widget.RecyclerView; | ... | @@ -16,6 +16,7 @@ import androidx.recyclerview.widget.RecyclerView; |
| 16 | import org.json.JSONException; | 16 | import org.json.JSONException; |
| 17 | 17 | ||
| 18 | import ly.warp.sdk.R; | 18 | import ly.warp.sdk.R; |
| 19 | +import ly.warp.sdk.fragments.BaseFragment; | ||
| 19 | import ly.warp.sdk.io.models.Coupon; | 20 | import ly.warp.sdk.io.models.Coupon; |
| 20 | import ly.warp.sdk.io.models.CouponList; | 21 | import ly.warp.sdk.io.models.CouponList; |
| 21 | import ly.warp.sdk.views.adapters.HomeCouponAdapter; | 22 | import ly.warp.sdk.views.adapters.HomeCouponAdapter; |
| ... | @@ -36,7 +37,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, | ... | @@ -36,7 +37,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, |
| 36 | private RecyclerView mRecyclerCoupons, mRecyclerBurntCoupons; | 37 | private RecyclerView mRecyclerCoupons, mRecyclerBurntCoupons; |
| 37 | private HomeCouponAdapter mAdapterCoupons, mAdapterBurntCoupons; | 38 | private HomeCouponAdapter mAdapterCoupons, mAdapterBurntCoupons; |
| 38 | private Spinner mCouponSpinner, mRedemptionSpinner; | 39 | private Spinner mCouponSpinner, mRedemptionSpinner; |
| 39 | - private TextView mTvAnalysisButton; | 40 | + private TextView mTvAnalysisButton, mTvUsername; |
| 40 | 41 | ||
| 41 | // =========================================================== | 42 | // =========================================================== |
| 42 | // Methods for/from SuperClass/Interfaces | 43 | // Methods for/from SuperClass/Interfaces |
| ... | @@ -54,6 +55,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, | ... | @@ -54,6 +55,7 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, |
| 54 | mCouponSpinner = findViewById(R.id.sp_coupons); | 55 | mCouponSpinner = findViewById(R.id.sp_coupons); |
| 55 | mRedemptionSpinner = findViewById(R.id.sp_redemption); | 56 | mRedemptionSpinner = findViewById(R.id.sp_redemption); |
| 56 | mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details); | 57 | mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details); |
| 58 | + mTvUsername = findViewById(R.id.cl_loyalty_info_banner).findViewById(R.id.tv_card_username); | ||
| 57 | 59 | ||
| 58 | initViews(); | 60 | initViews(); |
| 59 | } | 61 | } |
| ... | @@ -90,6 +92,11 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, | ... | @@ -90,6 +92,11 @@ public class LoyaltyActivity extends Activity implements View.OnClickListener, |
| 90 | // =========================================================== | 92 | // =========================================================== |
| 91 | 93 | ||
| 92 | private void initViews() { | 94 | private void initViews() { |
| 95 | + if (BaseFragment.getConsumer() != null) | ||
| 96 | + mTvUsername.setText(String.format(getResources().getString(R.string.cos_profile_loyalty_name), | ||
| 97 | + BaseFragment.getConsumer().getFirstName(), BaseFragment.getConsumer().getLastName())); | ||
| 98 | + | ||
| 99 | + | ||
| 93 | /********* TEST COUPONS DATA **********/ | 100 | /********* TEST COUPONS DATA **********/ |
| 94 | CouponList clist = new CouponList(); | 101 | CouponList clist = new CouponList(); |
| 95 | try { | 102 | try { | ... | ... |
| ... | @@ -81,6 +81,7 @@ | ... | @@ -81,6 +81,7 @@ |
| 81 | android:inputType="textPersonName" | 81 | android:inputType="textPersonName" |
| 82 | android:text="0€" | 82 | android:text="0€" |
| 83 | android:textSize="25dp" | 83 | android:textSize="25dp" |
| 84 | + android:textColor="#2F4455" | ||
| 84 | app:layout_constraintBottom_toBottomOf="@+id/view" | 85 | app:layout_constraintBottom_toBottomOf="@+id/view" |
| 85 | app:layout_constraintEnd_toEndOf="@+id/view" | 86 | app:layout_constraintEnd_toEndOf="@+id/view" |
| 86 | app:layout_constraintHorizontal_bias="0.475" | 87 | app:layout_constraintHorizontal_bias="0.475" | ... | ... |
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | - android:layout_width="@dimen/width_full" | 4 | + android:layout_width="360dp" |
| 5 | android:layout_height="240dp" | 5 | android:layout_height="240dp" |
| 6 | app:cardCornerRadius="20dp" | 6 | app:cardCornerRadius="20dp" |
| 7 | android:layout_marginBottom="2dp" | 7 | android:layout_marginBottom="2dp" |
| ... | @@ -86,9 +86,9 @@ | ... | @@ -86,9 +86,9 @@ |
| 86 | android:layout_width="wrap_content" | 86 | android:layout_width="wrap_content" |
| 87 | android:layout_height="wrap_content" | 87 | android:layout_height="wrap_content" |
| 88 | android:layout_gravity="end" | 88 | android:layout_gravity="end" |
| 89 | + android:layout_marginBottom="16dp" | ||
| 89 | android:background="@drawable/shape_cos_gradient3" | 90 | android:background="@drawable/shape_cos_gradient3" |
| 90 | android:paddingHorizontal="12dp" | 91 | android:paddingHorizontal="12dp" |
| 91 | - android:layout_marginBottom="16dp" | ||
| 92 | android:paddingVertical="4dp" | 92 | android:paddingVertical="4dp" |
| 93 | android:text="Πάρε το δώρο σου" | 93 | android:text="Πάρε το δώρο σου" |
| 94 | android:textColor="@android:color/white" | 94 | android:textColor="@android:color/white" | ... | ... |
| ... | @@ -35,6 +35,7 @@ | ... | @@ -35,6 +35,7 @@ |
| 35 | android:src="@drawable/ic_traveller_white" /> | 35 | android:src="@drawable/ic_traveller_white" /> |
| 36 | 36 | ||
| 37 | <TextView | 37 | <TextView |
| 38 | + android:id="@+id/tv_card_username" | ||
| 38 | android:layout_width="wrap_content" | 39 | android:layout_width="wrap_content" |
| 39 | android:layout_height="wrap_content" | 40 | android:layout_height="wrap_content" |
| 40 | android:layout_below="@+id/iv_loyalty_type" | 41 | android:layout_below="@+id/iv_loyalty_type" | ... | ... |
| ... | @@ -20,7 +20,7 @@ | ... | @@ -20,7 +20,7 @@ |
| 20 | <string name="menu_shop">Shop</string> | 20 | <string name="menu_shop">Shop</string> |
| 21 | <string name="menu_loyalty">Loyalty</string> | 21 | <string name="menu_loyalty">Loyalty</string> |
| 22 | <string name="menu_profile">Προφίλ</string> | 22 | <string name="menu_profile">Προφίλ</string> |
| 23 | - <string name="cos_profile_loyalty_name">Γιώργος Γεωργίου</string> | 23 | + <string name="cos_profile_loyalty_name">%1$s %2$s</string> |
| 24 | <string name="cos_questionnaire">Ερωτηματολόγιο</string> | 24 | <string name="cos_questionnaire">Ερωτηματολόγιο</string> |
| 25 | <string name="cos_gifts_loyalty_title">Τα δώρα μου</string> | 25 | <string name="cos_gifts_loyalty_title">Τα δώρα μου</string> |
| 26 | <string name="cos_coupons_loyalty_title">Ενεργά κουπόνια</string> | 26 | <string name="cos_coupons_loyalty_title">Ενεργά κουπόνια</string> | ... | ... |
-
Please register or login to post a comment