Panagiotis Triantafyllou

redesign part3

1 +package ly.warp.sdk.views;
2 +
3 +import android.content.Context;
4 +import android.content.res.TypedArray;
5 +import android.graphics.Canvas;
6 +import android.graphics.DashPathEffect;
7 +import android.graphics.Paint;
8 +import android.util.AttributeSet;
9 +import android.view.View;
10 +
11 +import ly.warp.sdk.R;
12 +
13 +/**
14 + * Created by Panagiotis Triantafyllou on 13/Απρ/2023.
15 + * @ https://stackoverflow.com/questions/20583298/creating-horizontal-and-vertical-dotted-lines-in-android
16 + */
17 +
18 +public class DividerView extends View {
19 + static public int ORIENTATION_HORIZONTAL = 0;
20 + static public int ORIENTATION_VERTICAL = 1;
21 + private Paint mPaint;
22 + private int orientation;
23 +
24 + public DividerView(Context context, AttributeSet attrs) {
25 + super(context, attrs);
26 + int dashGap, dashLength, dashThickness;
27 + int color;
28 +
29 + TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.DividerView, 0, 0);
30 +
31 + try {
32 + dashGap = a.getDimensionPixelSize(R.styleable.DividerView_dashGap, 5);
33 + dashLength = a.getDimensionPixelSize(R.styleable.DividerView_dashLength, 5);
34 + dashThickness = a.getDimensionPixelSize(R.styleable.DividerView_dashThickness, 3);
35 + color = a.getColor(R.styleable.DividerView_color, 0xff000000);
36 + orientation = a.getInt(R.styleable.DividerView_orientation, ORIENTATION_HORIZONTAL);
37 + } finally {
38 + a.recycle();
39 + }
40 +
41 + mPaint = new Paint();
42 + mPaint.setAntiAlias(true);
43 + mPaint.setColor(color);
44 + mPaint.setStyle(Paint.Style.STROKE);
45 + mPaint.setStrokeWidth(dashThickness);
46 + mPaint.setPathEffect(new DashPathEffect(new float[]{dashLength, dashGap,}, 0));
47 + }
48 +
49 + public DividerView(Context context) {
50 + this(context, null);
51 + }
52 +
53 + @Override
54 + protected void onDraw(Canvas canvas) {
55 + if (orientation == ORIENTATION_HORIZONTAL) {
56 + float center = getHeight() * .5f;
57 + canvas.drawLine(0, center, getWidth(), center, mPaint);
58 + } else {
59 + float center = getWidth() * .5f;
60 + canvas.drawLine(center, 0, center, getHeight(), mPaint);
61 + }
62 + }
63 +}
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <androidx.constraintlayout.widget.ConstraintLayout 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 + xmlns:custom="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools" 5 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent" 6 android:layout_width="match_parent"
6 android:layout_height="150dp" 7 android:layout_height="150dp"
7 - android:layout_marginVertical="6dp"
8 android:layout_marginHorizontal="4dp" 8 android:layout_marginHorizontal="4dp"
9 + android:layout_marginVertical="6dp"
9 android:background="@drawable/ic_coupon_background_new2"> 10 android:background="@drawable/ic_coupon_background_new2">
10 11
11 <androidx.constraintlayout.widget.Guideline 12 <androidx.constraintlayout.widget.Guideline
...@@ -25,16 +26,21 @@ ...@@ -25,16 +26,21 @@
25 app:layout_constraintTop_toTopOf="parent" 26 app:layout_constraintTop_toTopOf="parent"
26 tools:src="@drawable/ic_gifts_for_you" /> 27 tools:src="@drawable/ic_gifts_for_you" />
27 28
28 - <View 29 + <ly.warp.sdk.views.DividerView
29 android:id="@+id/v_separator" 30 android:id="@+id/v_separator"
30 android:layout_width="1dp" 31 android:layout_width="1dp"
31 - android:layout_height="match_parent" 32 + android:layout_height="0dp"
33 + android:layerType="software"
32 android:layout_marginVertical="16dp" 34 android:layout_marginVertical="16dp"
33 android:layout_marginStart="16dp" 35 android:layout_marginStart="16dp"
34 - android:background="@drawable/shape_dashed_vertical"
35 app:layout_constraintBottom_toBottomOf="parent" 36 app:layout_constraintBottom_toBottomOf="parent"
36 app:layout_constraintStart_toEndOf="@+id/iv_active_coupon" 37 app:layout_constraintStart_toEndOf="@+id/iv_active_coupon"
37 - app:layout_constraintTop_toTopOf="parent" /> 38 + app:layout_constraintTop_toTopOf="parent"
39 + custom:color="@color/cos_gray"
40 + custom:dashGap="10dp"
41 + custom:dashLength="10dp"
42 + custom:dashThickness="1dp"
43 + custom:orientation="vertical" />
38 44
39 <LinearLayout 45 <LinearLayout
40 android:id="@+id/ll_coupon_info" 46 android:id="@+id/ll_coupon_info"
...@@ -49,41 +55,41 @@ ...@@ -49,41 +55,41 @@
49 55
50 <TextView 56 <TextView
51 android:id="@+id/tv_active_coupons_title" 57 android:id="@+id/tv_active_coupons_title"
58 + fontPath="fonts/BTCosmo-Bold.ttf"
52 android:layout_width="wrap_content" 59 android:layout_width="wrap_content"
53 android:layout_height="wrap_content" 60 android:layout_height="wrap_content"
54 android:ellipsize="end" 61 android:ellipsize="end"
55 android:maxLines="1" 62 android:maxLines="1"
56 android:textColor="@color/cos_light_black" 63 android:textColor="@color/cos_light_black"
57 - fontPath="fonts/BTCosmo-Bold.ttf"
58 android:textSize="16sp" 64 android:textSize="16sp"
59 tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" /> 65 tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" />
60 66
61 <TextView 67 <TextView
62 android:id="@+id/tv_active_coupons_value" 68 android:id="@+id/tv_active_coupons_value"
69 + fontPath="fonts/BTCosmo-Bold.ttf"
63 android:layout_width="wrap_content" 70 android:layout_width="wrap_content"
64 android:layout_height="wrap_content" 71 android:layout_height="wrap_content"
65 android:textColor="@color/cos_light_black" 72 android:textColor="@color/cos_light_black"
66 android:textSize="42sp" 73 android:textSize="42sp"
67 - fontPath="fonts/BTCosmo-Bold.ttf"
68 tools:text="10$" /> 74 tools:text="10$" />
69 75
70 <TextView 76 <TextView
71 android:id="@+id/tv_active_coupons_date" 77 android:id="@+id/tv_active_coupons_date"
78 + fontPath="fonts/PeridotPE-Regular.ttf"
72 android:layout_width="wrap_content" 79 android:layout_width="wrap_content"
73 android:layout_height="wrap_content" 80 android:layout_height="wrap_content"
74 android:textColor="@color/cos_gray" 81 android:textColor="@color/cos_gray"
75 - fontPath="fonts/PeridotPE-Regular.ttf"
76 android:textSize="12sp" 82 android:textSize="12sp"
77 tools:text="@string/cos_active_coupon_date" /> 83 tools:text="@string/cos_active_coupon_date" />
78 </LinearLayout> 84 </LinearLayout>
79 85
80 <TextView 86 <TextView
81 android:id="@+id/tv_active_coupons_description" 87 android:id="@+id/tv_active_coupons_description"
88 + fontPath="fonts/PeridotPE-Regular.ttf"
82 android:layout_width="0dp" 89 android:layout_width="0dp"
83 android:layout_height="wrap_content" 90 android:layout_height="wrap_content"
84 android:layout_marginStart="8dp" 91 android:layout_marginStart="8dp"
85 android:layout_marginEnd="32dp" 92 android:layout_marginEnd="32dp"
86 - fontPath="fonts/PeridotPE-Regular.ttf"
87 android:maxLines="4" 93 android:maxLines="4"
88 android:textColor="@color/cos_gray" 94 android:textColor="@color/cos_gray"
89 android:textSize="12sp" 95 android:textSize="12sp"
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
42 android:layout_width="match_parent" 42 android:layout_width="match_parent"
43 android:layout_height="wrap_content" 43 android:layout_height="wrap_content"
44 android:layout_below="@+id/cl_loyalty_analysis_header" 44 android:layout_below="@+id/cl_loyalty_analysis_header"
45 - android:layout_marginBottom="24dp"
46 android:background="@color/white" 45 android:background="@color/white"
47 android:gravity="center_horizontal" 46 android:gravity="center_horizontal"
48 android:paddingHorizontal="12dp" 47 android:paddingHorizontal="12dp"
...@@ -56,11 +55,22 @@ ...@@ -56,11 +55,22 @@
56 android:layout_height="wrap_content" /> 55 android:layout_height="wrap_content" />
57 </LinearLayout> 56 </LinearLayout>
58 57
58 + <androidx.core.widget.NestedScrollView
59 + android:layout_width="match_parent"
60 + android:layout_height="wrap_content"
61 + android:layout_below="@+id/ll_tab_coupon_analysis"
62 + android:overScrollMode="never"
63 + android:scrollbars="none">
64 +
65 + <RelativeLayout
66 + android:layout_width="match_parent"
67 + android:layout_height="wrap_content"
68 + android:paddingVertical="24dp">
69 +
59 <ImageView 70 <ImageView
60 android:id="@+id/iv_gift_circle_logo" 71 android:id="@+id/iv_gift_circle_logo"
61 android:layout_width="120dp" 72 android:layout_width="120dp"
62 android:layout_height="120dp" 73 android:layout_height="120dp"
63 - android:layout_below="@+id/ll_tab_coupon_analysis"
64 android:layout_centerHorizontal="true" 74 android:layout_centerHorizontal="true"
65 android:src="@drawable/ic_gift_circle" /> 75 android:src="@drawable/ic_gift_circle" />
66 76
...@@ -114,17 +124,12 @@ ...@@ -114,17 +124,12 @@
114 android:textColor="@color/cos_light_black" 124 android:textColor="@color/cos_light_black"
115 android:textSize="21sp" /> 125 android:textSize="21sp" />
116 126
117 - <ScrollView
118 - android:layout_width="match_parent"
119 - android:layout_height="wrap_content"
120 - android:layout_below="@+id/tv_expired_title"
121 - android:layout_marginTop="32dp"
122 - android:scrollbars="none"
123 - android:overScrollMode="never">
124 127
125 <LinearLayout 128 <LinearLayout
126 android:layout_width="match_parent" 129 android:layout_width="match_parent"
127 android:layout_height="wrap_content" 130 android:layout_height="wrap_content"
131 + android:layout_below="@+id/tv_expired_title"
132 + android:layout_marginTop="32dp"
128 android:orientation="vertical"> 133 android:orientation="vertical">
129 134
130 <androidx.recyclerview.widget.RecyclerView 135 <androidx.recyclerview.widget.RecyclerView
...@@ -163,7 +168,6 @@ ...@@ -163,7 +168,6 @@
163 android:src="@drawable/ic_down_dark_new" /> 168 android:src="@drawable/ic_down_dark_new" />
164 </LinearLayout> 169 </LinearLayout>
165 </LinearLayout> 170 </LinearLayout>
166 - </ScrollView>
167 </RelativeLayout> 171 </RelativeLayout>
168 172
169 <TextView 173 <TextView
...@@ -184,10 +188,10 @@ ...@@ -184,10 +188,10 @@
184 android:id="@+id/rl_shared_view" 188 android:id="@+id/rl_shared_view"
185 android:layout_width="match_parent" 189 android:layout_width="match_parent"
186 android:layout_height="wrap_content" 190 android:layout_height="wrap_content"
187 - android:background="@drawable/shape_cos_white_border"
188 android:layout_below="@+id/iv_gift_circle_logo" 191 android:layout_below="@+id/iv_gift_circle_logo"
189 - android:layout_marginTop="32dp"
190 android:layout_marginHorizontal="12dp" 192 android:layout_marginHorizontal="12dp"
193 + android:layout_marginTop="32dp"
194 + android:background="@drawable/shape_cos_white_border"
191 android:paddingHorizontal="16dp" 195 android:paddingHorizontal="16dp"
192 android:paddingVertical="16dp" 196 android:paddingVertical="16dp"
193 android:visibility="gone"> 197 android:visibility="gone">
...@@ -201,17 +205,12 @@ ...@@ -201,17 +205,12 @@
201 android:textColor="@color/cos_light_black" 205 android:textColor="@color/cos_light_black"
202 android:textSize="21sp" /> 206 android:textSize="21sp" />
203 207
204 - <ScrollView
205 - android:layout_width="match_parent"
206 - android:layout_height="wrap_content"
207 - android:layout_below="@+id/tv_shared_title"
208 - android:layout_marginTop="24dp"
209 - android:scrollbars="none"
210 - android:overScrollMode="never">
211 208
212 <LinearLayout 209 <LinearLayout
213 android:layout_width="match_parent" 210 android:layout_width="match_parent"
214 android:layout_height="wrap_content" 211 android:layout_height="wrap_content"
212 + android:layout_below="@+id/tv_shared_title"
213 + android:layout_marginTop="24dp"
215 android:orientation="vertical"> 214 android:orientation="vertical">
216 215
217 <androidx.recyclerview.widget.RecyclerView 216 <androidx.recyclerview.widget.RecyclerView
...@@ -245,12 +244,11 @@ ...@@ -245,12 +244,11 @@
245 android:id="@+id/iv_shared_more_arrow" 244 android:id="@+id/iv_shared_more_arrow"
246 android:layout_width="14dp" 245 android:layout_width="14dp"
247 android:layout_height="14dp" 246 android:layout_height="14dp"
248 - android:layout_marginTop="3dp"
249 android:layout_marginStart="6dp" 247 android:layout_marginStart="6dp"
248 + android:layout_marginTop="3dp"
250 android:src="@drawable/ic_down_dark_new" /> 249 android:src="@drawable/ic_down_dark_new" />
251 </LinearLayout> 250 </LinearLayout>
252 </LinearLayout> 251 </LinearLayout>
253 - </ScrollView>
254 252
255 <TextView 253 <TextView
256 android:id="@+id/tv_shared_empty" 254 android:id="@+id/tv_shared_empty"
...@@ -265,4 +263,6 @@ ...@@ -265,4 +263,6 @@
265 android:textSize="16sp" 263 android:textSize="16sp"
266 android:visibility="gone" /> 264 android:visibility="gone" />
267 </RelativeLayout> 265 </RelativeLayout>
266 + </RelativeLayout>
267 + </androidx.core.widget.NestedScrollView>
268 </RelativeLayout> 268 </RelativeLayout>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
82 82
83 <LinearLayout 83 <LinearLayout
84 android:id="@+id/ll_user_badge" 84 android:id="@+id/ll_user_badge"
85 - android:layout_width="180dp" 85 + android:layout_width="wrap_content"
86 android:layout_height="42dp" 86 android:layout_height="42dp"
87 android:background="@drawable/selector_button_green_border" 87 android:background="@drawable/selector_button_green_border"
88 android:gravity="center" 88 android:gravity="center"
...@@ -97,7 +97,8 @@ ...@@ -97,7 +97,8 @@
97 android:includeFontPadding="false" 97 android:includeFontPadding="false"
98 android:textColor="@color/cos_green12" 98 android:textColor="@color/cos_green12"
99 android:textSize="16sp" 99 android:textSize="16sp"
100 - tools:text="@string/cos_profile_type" /> 100 + android:layout_marginHorizontal="20dp"
101 + tools:text="@string/cos_profile_preferences_placeholder" />
101 </LinearLayout> 102 </LinearLayout>
102 103
103 <LinearLayout 104 <LinearLayout
...@@ -179,7 +180,7 @@ ...@@ -179,7 +180,7 @@
179 android:includeFontPadding="false" 180 android:includeFontPadding="false"
180 android:text="@string/cos_deals_win_title_cos" 181 android:text="@string/cos_deals_win_title_cos"
181 android:textColor="@color/cos_light_black" 182 android:textColor="@color/cos_light_black"
182 - android:textSize="16sp" 183 + android:textSize="15sp"
183 app:layout_constraintBottom_toBottomOf="parent" 184 app:layout_constraintBottom_toBottomOf="parent"
184 app:layout_constraintEnd_toEndOf="parent" 185 app:layout_constraintEnd_toEndOf="parent"
185 app:layout_constraintStart_toStartOf="@+id/gl_vertical_16_cos" 186 app:layout_constraintStart_toStartOf="@+id/gl_vertical_16_cos"
...@@ -188,8 +189,8 @@ ...@@ -188,8 +189,8 @@
188 189
189 <ImageView 190 <ImageView
190 android:id="@+id/iv_deals_logo" 191 android:id="@+id/iv_deals_logo"
191 - android:layout_width="80dp" 192 + android:layout_width="76dp"
192 - android:layout_height="80dp" 193 + android:layout_height="76dp"
193 android:layout_marginVertical="4dp" 194 android:layout_marginVertical="4dp"
194 android:src="@drawable/ic_deals_polygon_new" 195 android:src="@drawable/ic_deals_polygon_new"
195 app:layout_constraintBottom_toBottomOf="parent" 196 app:layout_constraintBottom_toBottomOf="parent"
...@@ -258,7 +259,7 @@ ...@@ -258,7 +259,7 @@
258 android:includeFontPadding="false" 259 android:includeFontPadding="false"
259 android:text="@string/cos_deals_win_title" 260 android:text="@string/cos_deals_win_title"
260 android:textColor="@color/cos_light_black" 261 android:textColor="@color/cos_light_black"
261 - android:textSize="16sp" 262 + android:textSize="15sp"
262 app:layout_constraintBottom_toBottomOf="parent" 263 app:layout_constraintBottom_toBottomOf="parent"
263 app:layout_constraintEnd_toEndOf="parent" 264 app:layout_constraintEnd_toEndOf="parent"
264 app:layout_constraintStart_toStartOf="@+id/gl_vertical_16" 265 app:layout_constraintStart_toStartOf="@+id/gl_vertical_16"
...@@ -267,8 +268,8 @@ ...@@ -267,8 +268,8 @@
267 268
268 <ImageView 269 <ImageView
269 android:id="@+id/iv_gifts_logo" 270 android:id="@+id/iv_gifts_logo"
270 - android:layout_width="80dp" 271 + android:layout_width="76dp"
271 - android:layout_height="80dp" 272 + android:layout_height="76dp"
272 android:layout_marginVertical="4dp" 273 android:layout_marginVertical="4dp"
273 android:src="@drawable/ic_gifts_polygon_new" 274 android:src="@drawable/ic_gifts_polygon_new"
274 app:layout_constraintBottom_toBottomOf="parent" 275 app:layout_constraintBottom_toBottomOf="parent"
...@@ -301,7 +302,7 @@ ...@@ -301,7 +302,7 @@
301 302
302 <ImageView 303 <ImageView
303 android:id="@+id/dfy_logo" 304 android:id="@+id/dfy_logo"
304 - android:layout_width="220dp" 305 + android:layout_width="200dp"
305 android:layout_height="30dp" 306 android:layout_height="30dp"
306 android:layout_gravity="start" 307 android:layout_gravity="start"
307 android:layout_marginHorizontal="16dp" 308 android:layout_marginHorizontal="16dp"
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
48 android:layout_weight="0.5" 48 android:layout_weight="0.5"
49 android:maxLines="2" 49 android:maxLines="2"
50 android:textColor="@color/cos_light_black" 50 android:textColor="@color/cos_light_black"
51 - android:textSize="18sp" 51 + android:textSize="16sp"
52 tools:text="Box" /> 52 tools:text="Box" />
53 53
54 <TextView 54 <TextView
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
48 android:layout_weight="0.5" 48 android:layout_weight="0.5"
49 android:maxLines="2" 49 android:maxLines="2"
50 android:textColor="@color/cos_light_black" 50 android:textColor="@color/cos_light_black"
51 - android:textSize="18sp" 51 + android:textSize="16sp"
52 tools:text="Box" /> 52 tools:text="Box" />
53 53
54 <TextView 54 <TextView
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<resources>
3 + <declare-styleable name="DividerView">
4 + <attr name="color" format="color" />
5 + <attr name="dashLength" format="dimension" />
6 + <attr name="dashGap" format="dimension" />
7 + <attr name="dashThickness" format="dimension" />
8 + <attr name="orientation" format="enum">
9 + <enum name="horizontal" value="0" />
10 + <enum name="vertical" value="1" />
11 + </attr>
12 + </declare-styleable>
13 +</resources>
...\ No newline at end of file ...\ No newline at end of file
...@@ -149,6 +149,7 @@ ...@@ -149,6 +149,7 @@
149 <string name="cos_dlg_no_map">Το πρόγραμμα Χάρτες Petal λείπει.</string> 149 <string name="cos_dlg_no_map">Το πρόγραμμα Χάρτες Petal λείπει.</string>
150 <string name="cos_dlg_no_shops_title">Καταστήματα συνεργάτη</string> 150 <string name="cos_dlg_no_shops_title">Καταστήματα συνεργάτη</string>
151 <string name="cos_dlg_no_shops_positive">Δες το eshop</string> 151 <string name="cos_dlg_no_shops_positive">Δες το eshop</string>
152 + <string name="cos_profile_preferences_placeholder">Οι προτιμήσεις μου</string>
152 153
153 <string-array name="coupons_array"> 154 <string-array name="coupons_array">
154 <item>Κουπόνια</item> 155 <item>Κουπόνια</item>
......