Panagiotis Triantafyllou

all couponsets screen

...@@ -69,6 +69,12 @@ ...@@ -69,6 +69,12 @@
69 android:theme="@style/SDKAppTheme" /> 69 android:theme="@style/SDKAppTheme" />
70 70
71 <activity 71 <activity
72 + android:name=".activities.CouponsetsActivity"
73 + android:exported="false"
74 + android:screenOrientation="portrait"
75 + android:theme="@style/SDKAppTheme" />
76 +
77 + <activity
72 android:name=".dexter.PermissionsActivity" 78 android:name=".dexter.PermissionsActivity"
73 android:exported="false" 79 android:exported="false"
74 android:launchMode="singleInstance" 80 android:launchMode="singleInstance"
...@@ -78,7 +84,7 @@ ...@@ -78,7 +84,7 @@
78 <activity 84 <activity
79 android:name=".activities.BaseFragmentActivity" 85 android:name=".activities.BaseFragmentActivity"
80 android:exported="true" 86 android:exported="true"
81 - android:screenOrientation="portrait"/> 87 + android:screenOrientation="portrait" />
82 88
83 <!-- Service used for updating user's location. --> 89 <!-- Service used for updating user's location. -->
84 <service 90 <service
...@@ -96,22 +102,22 @@ ...@@ -96,22 +102,22 @@
96 android:exported="false" /> 102 android:exported="false" />
97 103
98 <!-- FCM Service for push notifications --> 104 <!-- FCM Service for push notifications -->
99 -<!-- <service--> 105 + <!-- <service-->
100 -<!-- android:name="ly.warp.sdk.services.FCMBaseMessagingService"--> 106 + <!-- android:name="ly.warp.sdk.services.FCMBaseMessagingService"-->
101 -<!-- android:exported="false">--> 107 + <!-- android:exported="false">-->
102 -<!-- <intent-filter>--> 108 + <!-- <intent-filter>-->
103 -<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />--> 109 + <!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
104 -<!-- </intent-filter>--> 110 + <!-- </intent-filter>-->
105 -<!-- </service>--> 111 + <!-- </service>-->
106 112
107 <!-- Service used for handling Huawei Push Notifications, comment if we are in Google build --> 113 <!-- Service used for handling Huawei Push Notifications, comment if we are in Google build -->
108 -<!-- <service--> 114 + <!-- <service-->
109 -<!-- android:name="ly.warp.sdk.services.HMSBaseMessagingService"--> 115 + <!-- android:name="ly.warp.sdk.services.HMSBaseMessagingService"-->
110 -<!-- android:exported="false">--> 116 + <!-- android:exported="false">-->
111 -<!-- <intent-filter>--> 117 + <!-- <intent-filter>-->
112 -<!-- <action android:name="com.huawei.push.action.MESSAGING_EVENT" />--> 118 + <!-- <action android:name="com.huawei.push.action.MESSAGING_EVENT" />-->
113 -<!-- </intent-filter>--> 119 + <!-- </intent-filter>-->
114 -<!-- </service>--> 120 + <!-- </service>-->
115 121
116 <receiver 122 <receiver
117 android:name="ly.warp.sdk.receivers.ConnectivityChangedReceiver" 123 android:name="ly.warp.sdk.receivers.ConnectivityChangedReceiver"
......
1 +package ly.warp.sdk.activities;
2 +
3 +import android.app.Activity;
4 +import android.content.Intent;
5 +import android.os.Bundle;
6 +import android.os.Parcelable;
7 +import android.util.TypedValue;
8 +import android.view.View;
9 +import android.widget.ImageView;
10 +import android.widget.TextView;
11 +
12 +import androidx.recyclerview.widget.GridLayoutManager;
13 +import androidx.recyclerview.widget.RecyclerView;
14 +
15 +import java.util.ArrayList;
16 +import java.util.LinkedHashMap;
17 +
18 +import ly.warp.sdk.R;
19 +import ly.warp.sdk.io.adapters.CouponsetAdapter;
20 +import ly.warp.sdk.io.models.Couponset;
21 +import ly.warp.sdk.utils.WarpUtils;
22 +import ly.warp.sdk.utils.WarplyManagerHelper;
23 +import ly.warp.sdk.views.GridSpaceItemDecoration;
24 +import ly.warp.sdk.views.VerticalSpaceItemDecoration;
25 +
26 +public class CouponsetsActivity extends Activity implements View.OnClickListener {
27 + // ===========================================================
28 + // Constants
29 + // ===========================================================
30 + public static final String EXTRA_CATEGORY = "category";
31 +
32 + // ===========================================================
33 + // Fields
34 + // ===========================================================
35 +
36 + private ImageView mIvBack;
37 + private RecyclerView mRvCouponsets;
38 + private CouponsetAdapter mCouponsetsAdapter;
39 + private TextView mTvHeaderTitle, mTvSearchTitle;
40 + private String mCouponsetsCategory = "";
41 +
42 + // ===========================================================
43 + // Methods for/from SuperClass/Interfaces
44 + // ===========================================================
45 +
46 + @Override
47 + public void onCreate(Bundle savedInstanceState) {
48 + super.onCreate(savedInstanceState);
49 + setContentView(R.layout.activity_couponsets);
50 +
51 + Intent intent = getIntent();
52 + if (intent != null && intent.hasExtra(EXTRA_CATEGORY)) {
53 + mCouponsetsCategory = intent.getStringExtra(EXTRA_CATEGORY);
54 + }
55 +
56 + initViews();
57 +
58 + WarpUtils.applyEdgeToEdge(this,
59 + findViewById(R.id.header_layout),
60 + null);
61 + }
62 +
63 + @Override
64 + public void onResume() {
65 + super.onResume();
66 + }
67 +
68 + @Override
69 + public void onClick(View v) {
70 + if (v.getId() == R.id.iv_back) {
71 + onBackPressed();
72 + }
73 + }
74 +
75 + // ===========================================================
76 + // Methods
77 + // ===========================================================
78 +
79 + private void initViews() {
80 + mIvBack = findViewById(R.id.iv_back);
81 + mIvBack.setOnClickListener(this);
82 +
83 + mRvCouponsets = findViewById(R.id.rv_couponsets);
84 + mTvHeaderTitle = findViewById(R.id.tv_header_title);
85 + mTvHeaderTitle.setText(mCouponsetsCategory);
86 + mTvSearchTitle = findViewById(R.id.tv_search_title);
87 +
88 + WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, mTvHeaderTitle);
89 + WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, mTvSearchTitle);
90 +
91 + setupCouponsetsSection();
92 + }
93 +
94 + private void setupCouponsetsSection() {
95 + LinkedHashMap<String, ArrayList<Couponset>> categorizedMap = WarplyManagerHelper.getCouponsetCategorizedMap();
96 + if (categorizedMap == null || categorizedMap.isEmpty()) return;
97 +
98 + ArrayList<Couponset> couponsets = categorizedMap.get(mCouponsetsCategory);
99 + if (couponsets == null || couponsets.isEmpty()) return;
100 +
101 + GridLayoutManager layoutManager = new GridLayoutManager(this, 2);
102 + mRvCouponsets.setLayoutManager(layoutManager);
103 + mRvCouponsets.setHasFixedSize(true);
104 +
105 + int columnSpacingPx = (int) TypedValue.applyDimension(
106 + TypedValue.COMPLEX_UNIT_DIP, 12, getResources().getDisplayMetrics());
107 + int rowSpacingPx = (int) TypedValue.applyDimension(
108 + TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics());
109 + mRvCouponsets.addItemDecoration(new GridSpaceItemDecoration(2, columnSpacingPx, rowSpacingPx));
110 +
111 + mCouponsetsAdapter = new CouponsetAdapter(this, couponsets, true);
112 + mCouponsetsAdapter.setOnCouponsetClickListener((couponset, position) -> {
113 + Intent myIntent = new Intent(CouponsetsActivity.this, SingleCouponsetActivity.class);
114 + myIntent.putExtra(SingleCouponsetActivity.EXTRA_OFFER_ITEM, (Parcelable) couponset);
115 + startActivity(myIntent);
116 + });
117 + mRvCouponsets.setAdapter(mCouponsetsAdapter);
118 + }
119 +
120 + // ===========================================================
121 + // Inner and Anonymous Classes
122 + // ===========================================================
123 +
124 +}
...@@ -109,6 +109,13 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -109,6 +109,13 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
109 if (v.getId() == R.id.ll_my_coupons) { 109 if (v.getId() == R.id.ll_my_coupons) {
110 Intent myIntent = new Intent(HomeActivity.this, CouponsActivity.class); 110 Intent myIntent = new Intent(HomeActivity.this, CouponsActivity.class);
111 startActivity(myIntent); 111 startActivity(myIntent);
112 + return;
113 + }
114 + if (v.getId() == R.id.ll_all) {
115 + String categoryName = (String) v.getTag();
116 + Intent myIntent = new Intent(HomeActivity.this, CouponsetsActivity.class);
117 + myIntent.putExtra(CouponsetsActivity.EXTRA_CATEGORY, categoryName);
118 + startActivity(myIntent);
112 } 119 }
113 } 120 }
114 121
...@@ -311,6 +318,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup ...@@ -311,6 +318,10 @@ public class HomeActivity extends Activity implements View.OnClickListener, Coup
311 tvTitle.setText(titleText); 318 tvTitle.setText(titleText);
312 WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, tvTitle); 319 WarpUtils.renderCustomFont(this, R.font.ping_lcg_bold, tvTitle);
313 320
321 + LinearLayout llAllButton = sectionView.findViewById(R.id.ll_all);
322 + llAllButton.setTag(categoryName);
323 + llAllButton.setOnClickListener(this);
324 +
314 TextView tvAll = sectionView.findViewById(R.id.tv_section_all); 325 TextView tvAll = sectionView.findViewById(R.id.tv_section_all);
315 WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, tvAll); 326 WarpUtils.renderCustomFont(this, R.font.ping_lcg_regular, tvAll);
316 327
......
...@@ -46,7 +46,6 @@ import java.util.ArrayList; ...@@ -46,7 +46,6 @@ import java.util.ArrayList;
46 46
47 import ly.warp.sdk.R; 47 import ly.warp.sdk.R;
48 import ly.warp.sdk.io.callbacks.CallbackReceiver; 48 import ly.warp.sdk.io.callbacks.CallbackReceiver;
49 -import ly.warp.sdk.io.models.Coupon;
50 import ly.warp.sdk.io.models.Merchant; 49 import ly.warp.sdk.io.models.Merchant;
51 import ly.warp.sdk.utils.WarpUtils; 50 import ly.warp.sdk.utils.WarpUtils;
52 import ly.warp.sdk.utils.constants.WarpConstants; 51 import ly.warp.sdk.utils.constants.WarpConstants;
...@@ -67,7 +66,6 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe ...@@ -67,7 +66,6 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
67 // =========================================================== 66 // ===========================================================
68 67
69 private ImageView mIvBack; 68 private ImageView mIvBack;
70 - private Coupon mCoupon;
71 private GoogleMap mMap; 69 private GoogleMap mMap;
72 private ClusterManager<Merchant> mClusterManager; 70 private ClusterManager<Merchant> mClusterManager;
73 private SupportMapFragment mMapView; 71 private SupportMapFragment mMapView;
......
...@@ -31,6 +31,7 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup ...@@ -31,6 +31,7 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup
31 31
32 private final List<Couponset> couponsets; 32 private final List<Couponset> couponsets;
33 private final Context context; 33 private final Context context;
34 + private final boolean isGrid;
34 private OnCouponsetClickListener listener; 35 private OnCouponsetClickListener listener;
35 36
36 public interface OnCouponsetClickListener { 37 public interface OnCouponsetClickListener {
...@@ -40,6 +41,13 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup ...@@ -40,6 +41,13 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup
40 public CouponsetAdapter(Context context, List<Couponset> couponsets) { 41 public CouponsetAdapter(Context context, List<Couponset> couponsets) {
41 this.context = context; 42 this.context = context;
42 this.couponsets = couponsets; 43 this.couponsets = couponsets;
44 + this.isGrid = false;
45 + }
46 +
47 + public CouponsetAdapter(Context context, List<Couponset> couponsets, boolean isGrid) {
48 + this.context = context;
49 + this.couponsets = couponsets;
50 + this.isGrid = isGrid;
43 } 51 }
44 52
45 public void setOnCouponsetClickListener(OnCouponsetClickListener listener) { 53 public void setOnCouponsetClickListener(OnCouponsetClickListener listener) {
...@@ -49,7 +57,8 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup ...@@ -49,7 +57,8 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup
49 @NonNull 57 @NonNull
50 @Override 58 @Override
51 public CouponsetViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 59 public CouponsetViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
52 - View view = LayoutInflater.from(context).inflate(R.layout.demo_item_offer, parent, false); 60 + int layoutRes = isGrid ? R.layout.demo_item_offer_grid : R.layout.demo_item_offer;
61 + View view = LayoutInflater.from(context).inflate(layoutRes, parent, false);
53 return new CouponsetViewHolder(view); 62 return new CouponsetViewHolder(view);
54 } 63 }
55 64
...@@ -134,7 +143,7 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup ...@@ -134,7 +143,7 @@ public class CouponsetAdapter extends RecyclerView.Adapter<CouponsetAdapter.Coup
134 private void loadCouponsetImage(String imageUrl) { 143 private void loadCouponsetImage(String imageUrl) {
135 if (imageUrl != null && !imageUrl.isEmpty()) { 144 if (imageUrl != null && !imageUrl.isEmpty()) {
136 int radiusInPixels = (int) TypedValue.applyDimension( 145 int radiusInPixels = (int) TypedValue.applyDimension(
137 - TypedValue.COMPLEX_UNIT_DIP, 9, 146 + TypedValue.COMPLEX_UNIT_DIP, 12,
138 context.getResources().getDisplayMetrics()); 147 context.getResources().getDisplayMetrics());
139 148
140 Glide.with(context) 149 Glide.with(context)
......
1 +package ly.warp.sdk.views;
2 +
3 +import android.graphics.Rect;
4 +import android.view.View;
5 +
6 +import androidx.annotation.NonNull;
7 +import androidx.recyclerview.widget.RecyclerView;
8 +
9 +/**
10 + * ItemDecoration for adding equal spacing between columns and rows in a GridLayoutManager.
11 + */
12 +public class GridSpaceItemDecoration extends RecyclerView.ItemDecoration {
13 + private final int spanCount;
14 + private final int columnSpacing;
15 + private final int rowSpacing;
16 +
17 + /**
18 + * @param spanCount Number of columns in the grid
19 + * @param columnSpacing Horizontal space between columns in pixels
20 + * @param rowSpacing Vertical space between rows in pixels
21 + */
22 + public GridSpaceItemDecoration(int spanCount, int columnSpacing, int rowSpacing) {
23 + this.spanCount = spanCount;
24 + this.columnSpacing = columnSpacing;
25 + this.rowSpacing = rowSpacing;
26 + }
27 +
28 + @Override
29 + public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
30 + @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
31 + int position = parent.getChildAdapterPosition(view);
32 + int column = position % spanCount;
33 +
34 + // Distribute column spacing evenly so all items have equal width
35 + outRect.left = column * columnSpacing / spanCount;
36 + outRect.right = columnSpacing - (column + 1) * columnSpacing / spanCount;
37 +
38 + // Add top spacing for all rows except the first
39 + if (position >= spanCount) {
40 + outRect.top = rowSpacing;
41 + }
42 + }
43 +}
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:topLeftRadius="12dp" android:topRightRadius="12dp" />
5 +
6 + <solid
7 + android:color="@color/custom_grey11" />
8 +</shape>
...\ No newline at end of file ...\ No newline at end of file
1 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 + xmlns:tools="http://schemas.android.com/tools"
3 + android:layout_width="match_parent"
4 + android:layout_height="match_parent"
5 + android:background="@color/white">
6 +
7 + <androidx.core.widget.NestedScrollView
8 + android:id="@+id/profile_scrollview"
9 + android:layout_width="match_parent"
10 + android:layout_height="match_parent"
11 + android:fillViewport="true">
12 +
13 + <LinearLayout
14 + android:id="@+id/profile_content_container"
15 + android:layout_width="match_parent"
16 + android:layout_height="wrap_content"
17 + android:orientation="vertical">
18 +
19 + <LinearLayout
20 + android:id="@+id/header_layout"
21 + android:layout_width="match_parent"
22 + android:layout_height="wrap_content"
23 + android:layout_gravity="center"
24 + android:background="@color/white"
25 + android:orientation="horizontal"
26 + android:padding="16dp">
27 +
28 + <LinearLayout
29 + android:layout_width="0dp"
30 + android:layout_height="wrap_content"
31 + android:layout_weight="1"
32 + android:gravity="center_vertical"
33 + android:orientation="horizontal">
34 +
35 + <ImageView
36 + android:id="@+id/iv_back"
37 + android:layout_width="16dp"
38 + android:layout_height="16dp"
39 + android:layout_marginEnd="24dp"
40 + android:src="@drawable/ic_back" />
41 + </LinearLayout>
42 + </LinearLayout>
43 +
44 + <LinearLayout
45 + android:layout_width="match_parent"
46 + android:layout_height="wrap_content"
47 + android:orientation="vertical"
48 + android:paddingHorizontal="16dp">
49 +
50 + <TextView
51 + android:id="@+id/tv_header_title"
52 + android:layout_width="wrap_content"
53 + android:layout_height="wrap_content"
54 + android:includeFontPadding="false"
55 + android:textColor="@color/custom_black6"
56 + android:textSize="28sp" />
57 + </LinearLayout>
58 +
59 + <RelativeLayout
60 + android:id="@+id/header_layout2"
61 + android:layout_width="match_parent"
62 + android:layout_height="wrap_content"
63 + android:background="@color/white"
64 + android:gravity="center_vertical"
65 + android:layout_marginTop="12dp"
66 + android:paddingHorizontal="16dp">
67 +
68 + <LinearLayout
69 + android:id="@+id/ll_search_filter_button"
70 + android:layout_width="wrap_content"
71 + android:layout_height="wrap_content"
72 + android:background="@drawable/shape_rectangle_rounded_grey4"
73 + android:gravity="center"
74 + android:layout_alignParentStart="true"
75 + android:paddingHorizontal="20dp"
76 + android:paddingVertical="12dp">
77 +
78 + <TextView
79 + android:id="@+id/tv_search_title"
80 + android:layout_width="wrap_content"
81 + android:layout_height="wrap_content"
82 + android:gravity="center"
83 + android:includeFontPadding="false"
84 + android:text="@string/demo_search_title"
85 + android:textColor="@color/custom_black6"
86 + android:textSize="14sp" />
87 +
88 + <View
89 + android:layout_width="12dp"
90 + android:layout_height="match_parent" />
91 +
92 + <ImageView
93 + android:layout_width="16dp"
94 + android:layout_height="16dp"
95 + android:src="@drawable/demo_filter" />
96 + </LinearLayout>
97 +
98 + <ImageView
99 + android:id="@+id/profile_icon"
100 + android:layout_width="46dp"
101 + android:layout_height="46dp"
102 + android:layout_alignParentEnd="true"
103 + android:background="@drawable/shape_rectangle_rounded_grey"
104 + android:padding="14dp"
105 + android:src="@drawable/demo_location_black" />
106 + </RelativeLayout>
107 +
108 + <RelativeLayout
109 + android:id="@+id/my_coupons_section"
110 + android:layout_width="match_parent"
111 + android:layout_height="wrap_content"
112 + android:layout_marginTop="24dp"
113 + android:layout_marginBottom="48dp"
114 + android:background="@color/white"
115 + android:paddingBottom="16dp">
116 +
117 + <androidx.recyclerview.widget.RecyclerView
118 + android:id="@+id/rv_couponsets"
119 + android:layout_width="match_parent"
120 + android:layout_height="wrap_content"
121 + android:clipToPadding="false"
122 + android:nestedScrollingEnabled="false"
123 + android:paddingHorizontal="16dp" />
124 + </RelativeLayout>
125 + </LinearLayout>
126 + </androidx.core.widget.NestedScrollView>
127 +</RelativeLayout>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
10 android:id="@+id/iv_offer_image" 10 android:id="@+id/iv_offer_image"
11 android:layout_width="match_parent" 11 android:layout_width="match_parent"
12 android:layout_height="130dp" 12 android:layout_height="130dp"
13 + android:background="@drawable/shape_rectangle_rounded_grey5"
13 android:scaleType="centerCrop" /> 14 android:scaleType="centerCrop" />
14 15
15 <TextView 16 <TextView
...@@ -43,10 +44,10 @@ ...@@ -43,10 +44,10 @@
43 android:id="@+id/tv_title" 44 android:id="@+id/tv_title"
44 android:layout_width="0dp" 45 android:layout_width="0dp"
45 android:layout_height="wrap_content" 46 android:layout_height="wrap_content"
47 + android:includeFontPadding="false"
46 android:maxLines="1" 48 android:maxLines="1"
47 android:textColor="@color/custom_black2" 49 android:textColor="@color/custom_black2"
48 android:textSize="15sp" 50 android:textSize="15sp"
49 - android:includeFontPadding="false"
50 app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70" 51 app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
51 app:layout_constraintStart_toStartOf="parent" 52 app:layout_constraintStart_toStartOf="parent"
52 app:layout_constraintTop_toTopOf="parent" 53 app:layout_constraintTop_toTopOf="parent"
...@@ -57,8 +58,8 @@ ...@@ -57,8 +58,8 @@
57 android:layout_width="0dp" 58 android:layout_width="0dp"
58 android:layout_height="wrap_content" 59 android:layout_height="wrap_content"
59 android:layout_marginTop="2dp" 60 android:layout_marginTop="2dp"
60 - android:maxLines="2"
61 android:includeFontPadding="false" 61 android:includeFontPadding="false"
62 + android:maxLines="2"
62 android:textColor="@color/custom_black3" 63 android:textColor="@color/custom_black3"
63 android:textSize="13sp" 64 android:textSize="13sp"
64 app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70" 65 app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
...@@ -73,12 +74,12 @@ ...@@ -73,12 +74,12 @@
73 android:layout_alignParentStart="true" 74 android:layout_alignParentStart="true"
74 android:layout_centerVertical="true" 75 android:layout_centerVertical="true"
75 android:layout_marginTop="12dp" 76 android:layout_marginTop="12dp"
76 - android:maxLines="1"
77 android:includeFontPadding="false" 77 android:includeFontPadding="false"
78 + android:maxLines="1"
78 android:textColor="@color/custom_grey4" 79 android:textColor="@color/custom_grey4"
79 android:textSize="12sp" 80 android:textSize="12sp"
80 - app:layout_constraintStart_toStartOf="parent"
81 app:layout_constraintBottom_toBottomOf="parent" 81 app:layout_constraintBottom_toBottomOf="parent"
82 + app:layout_constraintStart_toStartOf="parent"
82 tools:text="έως 30-09" /> 83 tools:text="έως 30-09" />
83 84
84 <ImageView 85 <ImageView
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 + xmlns:app="http://schemas.android.com/apk/res-auto"
4 + xmlns:tools="http://schemas.android.com/tools"
5 + android:layout_width="match_parent"
6 + android:layout_height="230dp"
7 + android:background="@drawable/demo_shape_white_border_grey">
8 +
9 + <ImageView
10 + android:id="@+id/iv_offer_image"
11 + android:layout_width="match_parent"
12 + android:layout_height="130dp"
13 + android:background="@drawable/shape_rectangle_rounded_grey5"
14 + android:scaleType="centerCrop" />
15 +
16 + <TextView
17 + android:id="@+id/tv_price"
18 + android:layout_width="54dp"
19 + android:layout_height="54dp"
20 + android:layout_alignParentEnd="true"
21 + android:layout_margin="8dp"
22 + android:background="@drawable/demo_shape_grey"
23 + android:gravity="center"
24 + android:includeFontPadding="false"
25 + android:textColor="@android:color/white"
26 + android:textSize="16sp"
27 + tools:text="17,95€" />
28 +
29 + <androidx.constraintlayout.widget.ConstraintLayout
30 + android:layout_width="match_parent"
31 + android:layout_height="match_parent"
32 + android:layout_below="@id/iv_offer_image"
33 + android:orientation="vertical"
34 + android:padding="12dp">
35 +
36 + <androidx.constraintlayout.widget.Guideline
37 + android:id="@+id/gl_vertical_70"
38 + android:layout_width="wrap_content"
39 + android:layout_height="wrap_content"
40 + android:orientation="vertical"
41 + app:layout_constraintGuide_percent="0.7" />
42 +
43 + <TextView
44 + android:id="@+id/tv_title"
45 + android:layout_width="0dp"
46 + android:layout_height="wrap_content"
47 + android:includeFontPadding="false"
48 + android:maxLines="1"
49 + android:textColor="@color/custom_black2"
50 + android:textSize="15sp"
51 + app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
52 + app:layout_constraintStart_toStartOf="parent"
53 + app:layout_constraintTop_toTopOf="parent"
54 + tools:text="Móvo 17,95" />
55 +
56 + <TextView
57 + android:id="@+id/tv_description"
58 + android:layout_width="0dp"
59 + android:layout_height="wrap_content"
60 + android:layout_marginTop="2dp"
61 + android:includeFontPadding="false"
62 + android:maxLines="2"
63 + android:textColor="@color/custom_black3"
64 + android:textSize="13sp"
65 + app:layout_constraintEnd_toStartOf="@+id/gl_vertical_70"
66 + app:layout_constraintStart_toStartOf="parent"
67 + app:layout_constraintTop_toBottomOf="@+id/tv_title"
68 + tools:text="2 πίτσες &amp; Coca-COLA 1,5lt" />
69 +
70 + <TextView
71 + android:id="@+id/tv_validity"
72 + android:layout_width="wrap_content"
73 + android:layout_height="wrap_content"
74 + android:layout_alignParentStart="true"
75 + android:layout_centerVertical="true"
76 + android:layout_marginTop="12dp"
77 + android:includeFontPadding="false"
78 + android:maxLines="1"
79 + android:textColor="@color/custom_grey4"
80 + android:textSize="12sp"
81 + app:layout_constraintBottom_toBottomOf="parent"
82 + app:layout_constraintStart_toStartOf="parent"
83 + tools:text="έως 30-09" />
84 +
85 + <ImageView
86 + android:id="@+id/iv_logo"
87 + android:layout_width="60dp"
88 + android:layout_height="60dp"
89 + android:layout_alignParentEnd="true"
90 + android:layout_centerVertical="true"
91 + android:scaleType="centerInside"
92 + app:layout_constraintEnd_toEndOf="parent"
93 + app:layout_constraintTop_toTopOf="parent"
94 + tools:src="@drawable/demo_avis" />
95 + </androidx.constraintlayout.widget.ConstraintLayout>
96 +</RelativeLayout>
...@@ -42,4 +42,5 @@ ...@@ -42,4 +42,5 @@
42 <color name="custom_gold">#573300</color> 42 <color name="custom_gold">#573300</color>
43 <color name="custom_grey9">#ADB3B8</color> 43 <color name="custom_grey9">#ADB3B8</color>
44 <color name="custom_grey10">#ECEDEF</color> 44 <color name="custom_grey10">#ECEDEF</color>
45 + <color name="custom_grey11">#E7E7E7</color>
45 </resources> 46 </resources>
......