@@ -89,58 +89,7 @@ fun EmptyProfileContent(
8989 .padding(horizontal = 24 .dp)
9090 .padding(top = 8 .dp, bottom = 32 .dp)
9191 ) {
92- Row (Modifier .fillMaxWidth(), verticalAlignment = Alignment .CenterVertically ) {
93- Text (
94- stringResource(R .string.profile_title), style = Style .heading1,
95- color = Color .Black , modifier = Modifier .weight(1f )
96- )
97- Icon (
98- painterResource(R .drawable.profile_notifications),
99- stringResource(R .string.profile_notifications),
100- Modifier .size(32 .dp),
101- tint = Color .Unspecified
102- )
103- Spacer (Modifier .width(8 .dp))
104- Icon (
105- painterResource(R .drawable.profile_settings),
106- stringResource(R .string.profile_settings),
107- Modifier .size(32 .dp),
108- tint = Color .Unspecified
109- )
110- }
111- Spacer (Modifier .height(24 .dp))
112- Row (
113- verticalAlignment = Alignment .CenterVertically ,
114- horizontalArrangement = Arrangement .spacedBy(16 .dp)
115- ) {
116- Image (
117- painterResource(selectedPicture.drawable),
118- stringResource(
119- R .string.selected_profile_picture,
120- stringResource(selectedPicture.label)
121- ),
122- Modifier .size(70 .dp)
123- )
124- Column (Modifier .weight(1f )) {
125- Text (
126- stringResource(R .string.profile_placeholder_name),
127- style = Style .heading2,
128- color = GrayPrimary
129- )
130- Box (
131- Modifier
132- .heightIn(min = 48 .dp)
133- .clickable(role = Role .Button , onClick = onEditProfilePicture),
134- contentAlignment = Alignment .CenterStart
135- ) {
136- Text (
137- stringResource(R .string.edit_profile_picture),
138- style = Style .labelsNormal,
139- color = CrimsonPrimary
140- )
141- }
142- }
143- }
92+ ProfileIdentityHeader (selectedPicture, onEditProfilePicture)
14493 ProfileSectionDivider ()
14594 ProfileSectionHeading (R .string.profile_favorite_sports, R .string.profile_edit, Color .Black )
14695 Spacer (Modifier .height(16 .dp))
@@ -210,7 +159,70 @@ fun EmptyProfileContent(
210159}
211160
212161@Composable
213- private fun ProfileSectionDivider () {
162+ internal fun ProfileIdentityHeader (
163+ selectedPicture : ProfilePicture ,
164+ onEditProfilePicture : () -> Unit ,
165+ compact : Boolean = false,
166+ displayName : String = stringResource(R .string.profile_placeholder_name)
167+ ) {
168+ Column {
169+ Row (Modifier .fillMaxWidth(), verticalAlignment = Alignment .CenterVertically ) {
170+ Text (
171+ stringResource(R .string.profile_title), style = Style .heading1,
172+ color = Color .Black , modifier = Modifier .weight(1f )
173+ )
174+ Icon (
175+ painterResource(R .drawable.profile_notifications),
176+ stringResource(R .string.profile_notifications),
177+ Modifier .size(32 .dp),
178+ tint = Color .Unspecified
179+ )
180+ Spacer (Modifier .width(8 .dp))
181+ Icon (
182+ painterResource(R .drawable.profile_settings),
183+ stringResource(R .string.profile_settings),
184+ Modifier .size(32 .dp),
185+ tint = Color .Unspecified
186+ )
187+ }
188+ Spacer (Modifier .height(24 .dp))
189+ Row (
190+ verticalAlignment = Alignment .CenterVertically ,
191+ horizontalArrangement = Arrangement .spacedBy(16 .dp)
192+ ) {
193+ Image (
194+ painterResource(selectedPicture.drawable),
195+ stringResource(
196+ R .string.selected_profile_picture,
197+ stringResource(selectedPicture.label)
198+ ),
199+ Modifier .size(70 .dp)
200+ )
201+ Column (Modifier .weight(1f )) {
202+ Text (
203+ displayName,
204+ style = Style .heading2,
205+ color = GrayPrimary
206+ )
207+ Box (
208+ Modifier
209+ .heightIn(min = if (compact) 22 .dp else 48 .dp)
210+ .clickable(role = Role .Button , onClick = onEditProfilePicture),
211+ contentAlignment = Alignment .CenterStart
212+ ) {
213+ Text (
214+ stringResource(R .string.edit_profile_picture),
215+ style = Style .labelsNormal,
216+ color = CrimsonPrimary
217+ )
218+ }
219+ }
220+ }
221+ }
222+ }
223+
224+ @Composable
225+ internal fun ProfileSectionDivider () {
214226 Column {
215227 Spacer (Modifier .height(24 .dp))
216228 HorizontalDivider (color = GrayStroke )
@@ -242,7 +254,7 @@ private fun ProfileSectionHeading(@StringRes title: Int, @StringRes action: Int,
242254
243255// Static navigation artwork: the reference tabs are intentionally non-interactive.
244256@Composable
245- private fun ProfileTabBar () {
257+ internal fun ProfileTabBar () {
246258 Row (
247259 Modifier
248260 .fillMaxWidth()
0 commit comments