Skip to content

Commit 53ab16f

Browse files
authored
Merge pull request #9 from hamzaazman/feature/design
Refactor UI components and update color themes for improved design co…
2 parents db003cb + 296453d commit 53ab16f

File tree

13 files changed

+337
-97
lines changed

13 files changed

+337
-97
lines changed

app/src/main/java/com/hamzaazman/birthdayreminder/ui/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MainActivity : AppCompatActivity() {
3333
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
3434
insets
3535
}
36-
checkForUpdates()
36+
//checkForUpdates()
3737
}
3838

3939
private fun checkForUpdates() {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
2+
3+
<path android:fillColor="@android:color/white" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
4+
5+
</vector>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
2+
<item android:drawable="@drawable/shape_circle_avatar_bg" />
3+
<item android:drawable="@drawable/baseline_person_24"
4+
android:gravity="center"
5+
android:width="64dp"
6+
android:height="64dp"
7+
android:tint="?attr/colorOnSurfaceVariant" /> </layer-list>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
2+
3+
<path android:fillColor="@android:color/white" android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/>
4+
5+
<path android:fillColor="@android:color/white" android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/>
6+
7+
</vector>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:shape="oval">
3+
<solid android:color="?attr/avatarBackgroundColor" /> </shape>
Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
34
xmlns:tools="http://schemas.android.com/tools"
4-
style="@style/Widget.Material3.CardView.Elevated"
55
android:layout_width="match_parent"
6-
android:theme="@style/Widget.Material3.CardView.Outlined"
76
android:layout_height="wrap_content"
87
android:layout_marginHorizontal="4dp"
9-
android:layout_marginVertical="6dp">
8+
android:layout_marginVertical="6dp"
9+
app:cardBackgroundColor="?attr/colorSurface"
10+
app:cardElevation="2dp"
11+
app:rippleColor="?attr/colorPrimaryContainer"
12+
app:strokeWidth="0dp">
1013

1114
<LinearLayout
1215
android:layout_width="match_parent"
1316
android:layout_height="wrap_content"
1417
android:gravity="center_vertical"
1518
android:orientation="horizontal"
16-
android:padding="14dp">
19+
android:padding="16dp">
1720

1821
<ImageView
1922
android:id="@+id/imageProfile"
20-
android:layout_width="36dp"
21-
android:layout_height="36dp"
22-
android:layout_marginEnd="10dp"
23-
android:src="@android:drawable/ic_menu_my_calendar" />
23+
android:layout_width="40dp"
24+
android:layout_height="40dp"
25+
android:layout_marginEnd="16dp"
26+
android:contentDescription="Profil İkonu"
27+
android:src="@drawable/person_24"
28+
app:tint="?attr/colorOnSurfaceVariant" />
2429

2530
<LinearLayout
2631
android:layout_width="0dp"
@@ -33,23 +38,25 @@
3338
android:layout_width="wrap_content"
3439
android:layout_height="wrap_content"
3540
android:textAppearance="@style/TextAppearance.Material3.TitleMedium"
41+
android:textColor="?attr/colorOnSurface"
3642
tools:text="Ayşe Yılmaz" />
3743

3844
<TextView
3945
android:id="@+id/textBirthDate"
4046
android:layout_width="wrap_content"
4147
android:layout_height="wrap_content"
42-
android:textAppearance="@style/TextAppearance.Material3.BodySmall"
43-
48+
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
49+
android:textColor="?attr/colorOnSurfaceVariant"
4450
tools:text="02.05.1995" />
4551
</LinearLayout>
4652

4753
<TextView
4854
android:id="@+id/textDayLeft"
4955
android:layout_width="wrap_content"
5056
android:layout_height="wrap_content"
51-
android:text="12g"
52-
android:textColor="#888888"
53-
android:textSize="13sp" />
57+
android:textColor="?attr/colorOnSurfaceVariant"
58+
android:textSize="14sp"
59+
android:textStyle="normal"
60+
tools:text="12 gün" />
5461
</LinearLayout>
55-
</com.google.android.material.card.MaterialCardView>
62+
</com.google.android.material.card.MaterialCardView>

app/src/main/res/layout/fragment_add.xml

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,31 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
6-
android:layout_height="match_parent">
6+
android:layout_height="match_parent"
7+
android:background="?android:colorBackground">
78

89
<LinearLayout
910
android:layout_width="match_parent"
1011
android:layout_height="wrap_content"
1112
android:orientation="vertical">
1213

13-
<!-- Toolbar -->
1414
<com.google.android.material.appbar.MaterialToolbar
1515
android:id="@+id/toolbar"
1616
android:layout_width="match_parent"
1717
android:layout_height="?attr/actionBarSize"
18-
app:navigationIcon="?attr/homeAsUpIndicator"
19-
app:title="Kişi Ekle" />
18+
android:background="?attr/colorSurface"
19+
app:navigationIcon="?homeAsUpIndicator"
20+
app:navigationIconTint="?attr/colorOnSurface"
21+
app:title="Kişi Ekle"
22+
app:titleTextColor="?attr/colorOnSurface" />
2023

21-
<!-- Content -->
2224
<LinearLayout
2325
android:layout_width="match_parent"
2426
android:layout_height="wrap_content"
2527
android:gravity="center_horizontal"
2628
android:orientation="vertical"
2729
android:padding="24dp">
2830

29-
<!-- Profile Image Placeholder -->
3031
<com.google.android.material.imageview.ShapeableImageView
3132
android:id="@+id/profileImageView"
3233
android:layout_width="120dp"
@@ -39,12 +40,12 @@
3940
android:padding="4dp"
4041
android:scaleType="centerCrop"
4142
android:src="@drawable/avatar"
43+
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.CornerSize50Percent"
4244
app:strokeColor="?attr/colorOutline"
43-
app:strokeWidth="2dp"
44-
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.CornerSize50Percent" />
45+
app:strokeWidth="2dp" />
4546

46-
<!-- Name input -->
4747
<com.google.android.material.textfield.TextInputLayout
48+
style="@style/Widget.Material3.TextInputLayout.FilledBox"
4849
android:layout_width="match_parent"
4950
android:layout_height="wrap_content"
5051
android:layout_marginBottom="16dp"
@@ -54,16 +55,19 @@
5455
android:id="@+id/nameInput"
5556
android:layout_width="match_parent"
5657
android:layout_height="wrap_content"
57-
android:inputType="textCapWords" />
58+
android:inputType="textCapWords"
59+
android:textColor="?attr/colorOnSurface"
60+
android:textColorHint="?attr/colorOnSurfaceVariant" />
5861
</com.google.android.material.textfield.TextInputLayout>
5962

60-
<!-- Birth Date input -->
6163
<com.google.android.material.textfield.TextInputLayout
64+
style="@style/Widget.Material3.TextInputLayout.FilledBox"
6265
android:layout_width="match_parent"
6366
android:layout_height="wrap_content"
6467
android:layout_marginBottom="16dp"
6568
android:hint="Doğum Tarihi"
66-
app:startIconDrawable="@drawable/calendar_24">
69+
app:startIconDrawable="@drawable/calendar_24"
70+
app:startIconTint="?attr/colorOnSurfaceVariant">
6771

6872
<com.google.android.material.textfield.TextInputEditText
6973
android:id="@+id/birthDateInput"
@@ -74,23 +78,26 @@
7478
tools:text="07.05.1998" />
7579
</com.google.android.material.textfield.TextInputLayout>
7680

77-
<!-- Phone Number input -->
7881
<com.google.android.material.textfield.TextInputLayout
82+
style="@style/Widget.Material3.TextInputLayout.FilledBox"
7983
android:layout_width="match_parent"
8084
android:layout_height="wrap_content"
8185
android:layout_marginBottom="16dp"
8286
android:hint="Telefon Numarası"
83-
app:startIconDrawable="@drawable/phone_24">
87+
app:startIconDrawable="@drawable/phone_24"
88+
app:startIconTint="?attr/colorOnSurfaceVariant">
8489

8590
<com.google.android.material.textfield.TextInputEditText
8691
android:id="@+id/phoneInput"
8792
android:layout_width="match_parent"
8893
android:layout_height="wrap_content"
89-
android:inputType="phone" />
94+
android:inputType="phone"
95+
android:textColor="?attr/colorOnSurface"
96+
android:textColorHint="?attr/colorOnSurfaceVariant" />
9097
</com.google.android.material.textfield.TextInputLayout>
9198

92-
<!-- Note input -->
9399
<com.google.android.material.textfield.TextInputLayout
100+
style="@style/Widget.Material3.TextInputLayout.FilledBox"
94101
android:layout_width="match_parent"
95102
android:layout_height="wrap_content"
96103
android:layout_marginBottom="24dp"
@@ -102,15 +109,19 @@
102109
android:layout_height="wrap_content"
103110
android:inputType="textMultiLine"
104111
android:maxLines="4"
105-
android:minLines="2" />
112+
android:minLines="2"
113+
android:textColor="?attr/colorOnSurface"
114+
android:textColorHint="?attr/colorOnSurfaceVariant" />
106115
</com.google.android.material.textfield.TextInputLayout>
107116

108-
<!-- Save button -->
109117
<com.google.android.material.button.MaterialButton
110118
android:id="@+id/saveButton"
111119
android:layout_width="match_parent"
112120
android:layout_height="wrap_content"
113-
android:text="Kaydet" />
121+
android:paddingVertical="12dp"
122+
android:text="Kaydet"
123+
android:textSize="18sp"
124+
app:cornerRadius="8dp" />
114125
</LinearLayout>
115126
</LinearLayout>
116-
</ScrollView>
127+
</ScrollView>

app/src/main/res/layout/fragment_edit.xml

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,50 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
6-
android:layout_height="match_parent">
6+
android:layout_height="match_parent"
7+
android:background="?android:colorBackground">
78

89
<LinearLayout
910
android:layout_width="match_parent"
1011
android:layout_height="wrap_content"
1112
android:orientation="vertical">
1213

13-
<!-- Toolbar -->
1414
<com.google.android.material.appbar.MaterialToolbar
1515
android:id="@+id/toolbar"
1616
android:layout_width="match_parent"
1717
android:layout_height="?attr/actionBarSize"
18-
app:navigationIcon="?attr/homeAsUpIndicator"
19-
app:title="Kişi Ekle" />
18+
android:background="?attr/colorSurface"
19+
app:navigationIcon="?homeAsUpIndicator"
20+
app:navigationIconTint="?attr/colorOnSurface"
21+
app:title="Kişiyi Düzenle"
22+
app:titleTextColor="?attr/colorOnSurface" />
2023

21-
<!-- Content -->
2224
<LinearLayout
2325
android:layout_width="match_parent"
2426
android:layout_height="wrap_content"
2527
android:gravity="center_horizontal"
2628
android:orientation="vertical"
2729
android:padding="24dp">
2830

29-
<!-- Profile Image Placeholder -->
3031
<com.google.android.material.imageview.ShapeableImageView
3132
android:id="@+id/profileImageView"
3233
android:layout_width="120dp"
3334
android:layout_height="120dp"
3435
android:layout_marginBottom="24dp"
3536
android:background="?attr/selectableItemBackgroundBorderless"
3637
android:clickable="true"
37-
android:contentDescription="Profil Fotoğrafı"
3838
android:focusable="true"
3939
android:padding="4dp"
40-
android:scaleType="centerCrop"
41-
android:src="@drawable/avatar"
40+
android:scaleType="centerInside"
41+
android:src="@drawable/baseline_person_24"
42+
app:backgroundTint="?attr/colorSurfaceVariant"
43+
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.CornerSize50Percent"
4244
app:strokeColor="?attr/colorOutline"
4345
app:strokeWidth="2dp"
44-
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.App.CornerSize50Percent" />
46+
app:tint="?attr/colorOnSurfaceVariant" />
4547

46-
<!-- Name input -->
4748
<com.google.android.material.textfield.TextInputLayout
49+
style="@style/Widget.Material3.TextInputLayout.FilledBox"
4850
android:layout_width="match_parent"
4951
android:layout_height="wrap_content"
5052
android:layout_marginBottom="16dp"
@@ -54,43 +56,51 @@
5456
android:id="@+id/nameInput"
5557
android:layout_width="match_parent"
5658
android:layout_height="wrap_content"
57-
android:inputType="textCapWords" />
59+
android:inputType="textCapWords"
60+
android:textColor="?attr/colorOnSurface"
61+
android:textColorHint="?attr/colorOnSurfaceVariant" />
5862
</com.google.android.material.textfield.TextInputLayout>
5963

60-
<!-- Birth Date input -->
6164
<com.google.android.material.textfield.TextInputLayout
65+
style="@style/Widget.Material3.TextInputLayout.FilledBox"
6266
android:layout_width="match_parent"
6367
android:layout_height="wrap_content"
6468
android:layout_marginBottom="16dp"
6569
android:hint="Doğum Tarihi"
66-
app:startIconDrawable="@drawable/calendar_24">
70+
app:startIconDrawable="@drawable/calendar_24"
71+
app:startIconTint="?attr/colorOnSurfaceVariant">
6772

6873
<com.google.android.material.textfield.TextInputEditText
6974
android:id="@+id/birthDateInput"
7075
android:layout_width="match_parent"
7176
android:layout_height="wrap_content"
7277
android:focusable="false"
7378
android:inputType="none"
79+
android:textColor="?attr/colorOnSurface"
80+
android:textColorHint="?attr/colorOnSurfaceVariant"
7481
tools:text="07.05.1998" />
7582
</com.google.android.material.textfield.TextInputLayout>
7683

77-
<!-- Phone Number input -->
7884
<com.google.android.material.textfield.TextInputLayout
85+
style="@style/Widget.Material3.TextInputLayout.FilledBox"
7986
android:layout_width="match_parent"
8087
android:layout_height="wrap_content"
8188
android:layout_marginBottom="16dp"
8289
android:hint="Telefon Numarası"
83-
app:startIconDrawable="@drawable/phone_24">
90+
app:startIconDrawable="@drawable/phone_24"
91+
app:startIconTint="?attr/colorOnSurfaceVariant">
8492

8593
<com.google.android.material.textfield.TextInputEditText
8694
android:id="@+id/phoneInput"
8795
android:layout_width="match_parent"
8896
android:layout_height="wrap_content"
89-
android:inputType="phone" />
97+
android:inputType="phone"
98+
android:textColor="?attr/colorOnSurface"
99+
android:textColorHint="?attr/colorOnSurfaceVariant" />
90100
</com.google.android.material.textfield.TextInputLayout>
91101

92-
<!-- Note input -->
93102
<com.google.android.material.textfield.TextInputLayout
103+
style="@style/Widget.Material3.TextInputLayout.FilledBox"
94104
android:layout_width="match_parent"
95105
android:layout_height="wrap_content"
96106
android:layout_marginBottom="24dp"
@@ -102,15 +112,19 @@
102112
android:layout_height="wrap_content"
103113
android:inputType="textMultiLine"
104114
android:maxLines="4"
105-
android:minLines="2" />
115+
android:minLines="2"
116+
android:textColor="?attr/colorOnSurface"
117+
android:textColorHint="?attr/colorOnSurfaceVariant" />
106118
</com.google.android.material.textfield.TextInputLayout>
107119

108-
<!-- Save button -->
109120
<com.google.android.material.button.MaterialButton
110121
android:id="@+id/saveButton"
111122
android:layout_width="match_parent"
112123
android:layout_height="wrap_content"
113-
android:text="Kaydet" />
124+
android:paddingVertical="12dp"
125+
android:text="Kaydet"
126+
android:textSize="18sp"
127+
app:cornerRadius="8dp" />
114128
</LinearLayout>
115129
</LinearLayout>
116-
</ScrollView>
130+
</ScrollView>

0 commit comments

Comments
 (0)