Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.

Commit a44e3a6

Browse files
committed
Update profile screen
- Add header text to profile details - Make whole page scrollable
1 parent 9d208fc commit a44e3a6

2 files changed

Lines changed: 184 additions & 170 deletions

File tree

Lines changed: 183 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -1,188 +1,201 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7-
android:focusable="true"
8-
android:focusableInTouchMode="true"
9-
app:layout_constraintBottom_toBottomOf="parent"
10-
app:layout_constraintLeft_toLeftOf="parent"
11-
app:layout_constraintRight_toRightOf="parent"
127
tools:context="com.marknkamau.justjava.ui.profile.ProfileActivity">
138

14-
<androidx.cardview.widget.CardView
15-
android:id="@+id/cardProfile"
9+
<androidx.constraintlayout.widget.ConstraintLayout
1610
android:layout_width="match_parent"
1711
android:layout_height="wrap_content"
18-
android:layout_margin="8dp"
19-
android:layout_marginStart="8dp"
20-
android:layout_marginTop="8dp"
21-
android:layout_marginEnd="8dp"
22-
app:layout_constraintEnd_toEndOf="parent"
23-
app:layout_constraintStart_toStartOf="parent"
24-
app:layout_constraintTop_toTopOf="parent">
25-
26-
<LinearLayout
12+
android:focusable="true"
13+
android:focusableInTouchMode="true"
14+
app:layout_constraintBottom_toBottomOf="parent"
15+
app:layout_constraintLeft_toLeftOf="parent"
16+
app:layout_constraintRight_toRightOf="parent">
17+
18+
<androidx.cardview.widget.CardView
19+
android:id="@+id/cardProfile"
2720
android:layout_width="match_parent"
28-
android:layout_height="match_parent"
21+
android:layout_height="wrap_content"
2922
android:layout_margin="8dp"
30-
android:orientation="vertical">
31-
32-
<com.google.android.material.textfield.TextInputLayout
33-
android:id="@+id/tilName"
34-
style="@style/AppTheme.InputField"
23+
android:layout_marginStart="8dp"
24+
android:layout_marginTop="8dp"
25+
android:layout_marginEnd="8dp"
26+
app:layout_constraintEnd_toEndOf="parent"
27+
app:layout_constraintStart_toStartOf="parent"
28+
app:layout_constraintTop_toTopOf="parent">
29+
30+
<LinearLayout
3531
android:layout_width="match_parent"
36-
android:layout_height="wrap_content"
37-
android:hint="@string/name"
38-
app:layout_constraintHorizontal_bias="0.0"
39-
app:layout_constraintLeft_toLeftOf="parent"
40-
app:layout_constraintRight_toRightOf="parent"
41-
app:layout_constraintTop_toTopOf="parent">
42-
43-
<com.google.android.material.textfield.TextInputEditText
44-
android:id="@+id/etName"
32+
android:layout_height="match_parent"
33+
android:layout_margin="8dp"
34+
android:orientation="vertical">
35+
36+
<TextView
37+
android:id="@+id/textView21"
4538
android:layout_width="match_parent"
46-
android:layout_height="match_parent"
47-
android:ems="10"
48-
android:inputType="textPersonName"
49-
android:textSize="14sp"
50-
tools:ignore="Autofill" />
51-
</com.google.android.material.textfield.TextInputLayout>
52-
53-
<com.google.android.material.textfield.TextInputLayout
54-
android:id="@+id/tilPhone"
55-
style="@style/AppTheme.InputField"
56-
android:layout_width="match_parent"
57-
android:layout_height="wrap_content"
58-
android:hint="@string/phone_number"
59-
app:layout_constraintLeft_toLeftOf="parent"
60-
app:layout_constraintRight_toRightOf="parent"
61-
app:layout_constraintTop_toBottomOf="@+id/tilName">
62-
63-
<com.google.android.material.textfield.TextInputEditText
64-
android:id="@+id/etPhone"
39+
android:layout_height="wrap_content"
40+
android:text="@string/profile_details" />
41+
42+
<com.google.android.material.textfield.TextInputLayout
43+
android:id="@+id/tilName"
44+
style="@style/AppTheme.InputField"
6545
android:layout_width="match_parent"
66-
android:layout_height="match_parent"
67-
android:ems="10"
68-
android:inputType="phone"
69-
android:textSize="14sp"
70-
tools:ignore="Autofill" />
71-
</com.google.android.material.textfield.TextInputLayout>
72-
73-
<com.google.android.material.textfield.TextInputLayout
74-
android:id="@+id/tilAddress"
75-
style="@style/AppTheme.InputField"
76-
android:layout_width="match_parent"
77-
android:layout_height="wrap_content"
78-
android:hint="@string/delivery_address"
79-
app:layout_constraintLeft_toLeftOf="parent"
80-
app:layout_constraintRight_toRightOf="parent"
81-
app:layout_constraintTop_toBottomOf="@+id/tilPhone">
82-
83-
<com.google.android.material.textfield.TextInputEditText
84-
android:id="@+id/etDeliveryAddress"
46+
android:layout_height="wrap_content"
47+
android:layout_marginTop="8dp"
48+
android:hint="@string/name"
49+
app:layout_constraintHorizontal_bias="0.0"
50+
app:layout_constraintLeft_toLeftOf="parent"
51+
app:layout_constraintRight_toRightOf="parent"
52+
app:layout_constraintTop_toTopOf="parent">
53+
54+
<com.google.android.material.textfield.TextInputEditText
55+
android:id="@+id/etName"
56+
android:layout_width="match_parent"
57+
android:layout_height="match_parent"
58+
android:ems="10"
59+
android:inputType="textPersonName"
60+
android:textSize="14sp"
61+
tools:ignore="Autofill" />
62+
</com.google.android.material.textfield.TextInputLayout>
63+
64+
<com.google.android.material.textfield.TextInputLayout
65+
android:id="@+id/tilPhone"
66+
style="@style/AppTheme.InputField"
8567
android:layout_width="match_parent"
86-
android:layout_height="match_parent"
87-
android:ems="10"
88-
android:inputType="textMultiLine"
89-
android:textSize="14sp"
90-
tools:ignore="Autofill" />
91-
</com.google.android.material.textfield.TextInputLayout>
92-
93-
<ProgressBar
94-
android:id="@+id/pbUpdatingProject"
95-
style="?android:attr/progressBarStyleHorizontal"
96-
android:layout_width="match_parent"
97-
android:layout_height="wrap_content"
98-
android:layout_marginLeft="8dp"
99-
android:layout_marginTop="0dp"
100-
android:layout_marginRight="8dp"
101-
android:indeterminate="true"
102-
android:visibility="gone"
103-
app:layout_constraintHorizontal_bias="0.0"
104-
app:layout_constraintLeft_toLeftOf="parent"
105-
app:layout_constraintRight_toRightOf="parent"
106-
app:layout_constraintTop_toBottomOf="@+id/tilAddress" />
107-
108-
<com.google.android.material.button.MaterialButton
109-
android:id="@+id/btnUpdateProfile"
110-
style="@style/AppTheme.PrimaryButton"
111-
android:layout_width="match_parent"
112-
android:layout_height="56dp"
113-
android:layout_marginLeft="8dp"
114-
android:layout_marginTop="8dp"
115-
android:layout_marginEnd="8dp"
116-
android:layout_marginRight="8dp"
117-
android:paddingStart="16dp"
118-
android:paddingEnd="16dp"
119-
android:text="@string/update_profile"
120-
app:layout_constraintLeft_toLeftOf="parent"
121-
app:layout_constraintRight_toRightOf="parent"
122-
app:layout_constraintTop_toBottomOf="@+id/cardProfile" />
123-
</LinearLayout>
124-
</androidx.cardview.widget.CardView>
125-
126-
<androidx.cardview.widget.CardView
127-
android:id="@+id/cardPreviousOrders"
128-
android:layout_width="match_parent"
129-
android:layout_height="0dp"
130-
android:layout_marginStart="8dp"
131-
android:layout_marginTop="8dp"
132-
android:layout_marginEnd="8dp"
133-
android:layout_marginBottom="8dp"
134-
app:layout_constraintBottom_toBottomOf="parent"
135-
app:layout_constraintEnd_toEndOf="parent"
136-
app:layout_constraintStart_toStartOf="parent"
137-
app:layout_constraintTop_toBottomOf="@+id/cardProfile">
138-
139-
<LinearLayout
68+
android:layout_height="wrap_content"
69+
android:layout_marginTop="4dp"
70+
android:hint="@string/phone_number"
71+
app:layout_constraintLeft_toLeftOf="parent"
72+
app:layout_constraintRight_toRightOf="parent"
73+
app:layout_constraintTop_toBottomOf="@+id/tilName">
74+
75+
<com.google.android.material.textfield.TextInputEditText
76+
android:id="@+id/etPhone"
77+
android:layout_width="match_parent"
78+
android:layout_height="match_parent"
79+
android:ems="10"
80+
android:inputType="phone"
81+
android:textSize="14sp"
82+
tools:ignore="Autofill" />
83+
</com.google.android.material.textfield.TextInputLayout>
84+
85+
<com.google.android.material.textfield.TextInputLayout
86+
android:id="@+id/tilAddress"
87+
style="@style/AppTheme.InputField"
88+
android:layout_width="match_parent"
89+
android:layout_height="wrap_content"
90+
android:layout_marginTop="4dp"
91+
android:hint="@string/delivery_address"
92+
app:layout_constraintLeft_toLeftOf="parent"
93+
app:layout_constraintRight_toRightOf="parent"
94+
app:layout_constraintTop_toBottomOf="@+id/tilPhone">
95+
96+
<com.google.android.material.textfield.TextInputEditText
97+
android:id="@+id/etDeliveryAddress"
98+
android:layout_width="match_parent"
99+
android:layout_height="match_parent"
100+
android:ems="10"
101+
android:inputType="textMultiLine"
102+
android:textSize="14sp"
103+
tools:ignore="Autofill" />
104+
</com.google.android.material.textfield.TextInputLayout>
105+
106+
<ProgressBar
107+
android:id="@+id/pbUpdatingProject"
108+
style="?android:attr/progressBarStyleHorizontal"
109+
android:layout_width="match_parent"
110+
android:layout_height="wrap_content"
111+
android:layout_marginLeft="8dp"
112+
android:layout_marginTop="0dp"
113+
android:layout_marginRight="8dp"
114+
android:indeterminate="true"
115+
android:visibility="gone"
116+
app:layout_constraintHorizontal_bias="0.0"
117+
app:layout_constraintLeft_toLeftOf="parent"
118+
app:layout_constraintRight_toRightOf="parent"
119+
app:layout_constraintTop_toBottomOf="@+id/tilAddress" />
120+
121+
<com.google.android.material.button.MaterialButton
122+
android:id="@+id/btnUpdateProfile"
123+
style="@style/AppTheme.PrimaryButton"
124+
android:layout_width="match_parent"
125+
android:layout_height="56dp"
126+
android:layout_marginLeft="8dp"
127+
android:layout_marginTop="8dp"
128+
android:layout_marginEnd="8dp"
129+
android:layout_marginRight="8dp"
130+
android:paddingStart="16dp"
131+
android:paddingEnd="16dp"
132+
android:text="@string/update_profile"
133+
app:layout_constraintLeft_toLeftOf="parent"
134+
app:layout_constraintRight_toRightOf="parent"
135+
app:layout_constraintTop_toBottomOf="@+id/cardProfile" />
136+
</LinearLayout>
137+
</androidx.cardview.widget.CardView>
138+
139+
<androidx.cardview.widget.CardView
140+
android:id="@+id/cardPreviousOrders"
140141
android:layout_width="match_parent"
141-
android:layout_height="match_parent"
142-
android:orientation="vertical">
143-
144-
<TextView
145-
android:id="@+id/textView11"
146-
style="@style/secondary_text"
147-
android:layout_width="match_parent"
148-
android:layout_height="wrap_content"
149-
android:layout_marginStart="8dp"
150-
android:layout_marginTop="8dp"
151-
android:text="@string/previous_orders"
152-
android:textAllCaps="false" />
153-
154-
<TextView
155-
android:id="@+id/tvNoOrders"
142+
android:layout_height="wrap_content"
143+
android:layout_marginStart="8dp"
144+
android:layout_marginTop="8dp"
145+
android:layout_marginEnd="8dp"
146+
android:layout_marginBottom="8dp"
147+
app:layout_constraintBottom_toBottomOf="parent"
148+
app:layout_constraintEnd_toEndOf="parent"
149+
app:layout_constraintStart_toStartOf="parent"
150+
app:layout_constraintTop_toBottomOf="@+id/cardProfile">
151+
152+
<LinearLayout
156153
android:layout_width="match_parent"
157-
android:layout_height="wrap_content"
158-
android:layout_marginLeft="8dp"
159-
android:layout_marginTop="8dp"
160-
android:layout_marginRight="8dp"
161-
android:layout_marginBottom="8dp"
162-
android:text="@string/you_do_not_have_any_previous_orders"
163-
android:visibility="gone" />
164-
165-
<ProgressBar
166-
android:id="@+id/pbLoadingOrders"
167-
style="?android:attr/progressBarStyle"
168-
android:layout_width="wrap_content"
169-
android:layout_height="wrap_content"
170-
android:layout_gravity="center_horizontal"
171-
android:layout_marginLeft="8dp"
172-
android:layout_marginTop="8dp"
173-
android:layout_marginRight="8dp"
174-
android:layout_marginBottom="8dp"
175-
android:indeterminate="true"
176-
android:visibility="visible" />
177-
178-
<androidx.recyclerview.widget.RecyclerView
179-
android:id="@+id/rvPreviousOrders"
180-
android:layout_width="match_parent"
181-
android:layout_height="wrap_content"
182-
android:nestedScrollingEnabled="false"
183-
tools:listitem="@layout/item_previous_order" />
184-
</LinearLayout>
185-
</androidx.cardview.widget.CardView>
186-
187-
</androidx.constraintlayout.widget.ConstraintLayout>
154+
android:layout_height="match_parent"
155+
android:orientation="vertical">
188156

157+
<TextView
158+
android:id="@+id/textView11"
159+
style="@style/secondary_text"
160+
android:layout_width="match_parent"
161+
android:layout_height="wrap_content"
162+
android:layout_marginStart="8dp"
163+
android:layout_marginTop="8dp"
164+
android:text="@string/previous_orders"
165+
android:textAllCaps="false" />
166+
167+
<TextView
168+
android:id="@+id/tvNoOrders"
169+
android:layout_width="match_parent"
170+
android:layout_height="wrap_content"
171+
android:layout_marginLeft="8dp"
172+
android:layout_marginTop="8dp"
173+
android:layout_marginRight="8dp"
174+
android:layout_marginBottom="8dp"
175+
android:text="@string/you_do_not_have_any_previous_orders"
176+
android:visibility="gone" />
177+
178+
<ProgressBar
179+
android:id="@+id/pbLoadingOrders"
180+
style="?android:attr/progressBarStyle"
181+
android:layout_width="wrap_content"
182+
android:layout_height="wrap_content"
183+
android:layout_gravity="center_horizontal"
184+
android:layout_marginLeft="8dp"
185+
android:layout_marginTop="8dp"
186+
android:layout_marginRight="8dp"
187+
android:layout_marginBottom="8dp"
188+
android:indeterminate="true"
189+
android:visibility="visible" />
190+
191+
<androidx.recyclerview.widget.RecyclerView
192+
android:id="@+id/rvPreviousOrders"
193+
android:layout_width="match_parent"
194+
android:layout_height="wrap_content"
195+
android:nestedScrollingEnabled="false"
196+
tools:listitem="@layout/item_previous_order" />
197+
</LinearLayout>
198+
</androidx.cardview.widget.CardView>
199+
200+
</androidx.constraintlayout.widget.ConstraintLayout>
201+
</ScrollView>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
<string name="order_date">Order date</string>
9292
<string name="additional_comments">Additional comments</string>
9393
<string name="total_price">Total price</string>
94+
<string name="profile_details">Profile details</string>
9495

9596
<plurals name="order_info">
9697
<item quantity="one">%1$d item for Ksh. %2$d</item>

0 commit comments

Comments
 (0)