@@ -98,6 +98,7 @@ import com.android.developers.androidify.theme.components.SecondaryOutlinedButto
9898import com.android.developers.androidify.theme.sharedBoundsRevealWithShapeMorph
9999import com.android.developers.androidify.theme.sharedBoundsWithDefaults
100100import com.android.developers.androidify.util.dashedRoundedRectBorder
101+ import com.android.developers.androidify.util.isHorizontalWindow
101102import com.android.developers.androidify.creation.R as CreationR
102103
103104@Composable
@@ -169,6 +170,27 @@ private fun UploadEmptyState(
169170 onCameraPressed : () -> Unit ,
170171 onChooseImagePress : () -> Unit ,
171172 modifier : Modifier = Modifier ,
173+ ) {
174+ if (isHorizontalWindow()) {
175+ HorizontallyAlignedUploadEmptyState (
176+ onCameraPressed = onCameraPressed,
177+ onChooseImagePress = onChooseImagePress,
178+ modifier = modifier,
179+ )
180+ } else {
181+ VerticallyAlignedUploadEmptyState (
182+ onCameraPressed = onCameraPressed,
183+ onChooseImagePress = onChooseImagePress,
184+ modifier = modifier,
185+ )
186+ }
187+ }
188+
189+ @Composable
190+ private fun VerticallyAlignedUploadEmptyState (
191+ onCameraPressed : () -> Unit ,
192+ onChooseImagePress : () -> Unit ,
193+ modifier : Modifier = Modifier ,
172194) {
173195 Column (
174196 modifier = modifier
@@ -206,6 +228,45 @@ private fun UploadEmptyState(
206228 }
207229}
208230
231+ @Composable
232+ private fun HorizontallyAlignedUploadEmptyState (
233+ onCameraPressed : () -> Unit ,
234+ onChooseImagePress : () -> Unit ,
235+ modifier : Modifier = Modifier ,
236+ ) {
237+ Row (
238+ modifier = modifier
239+ .padding(16 .dp),
240+ horizontalArrangement = Arrangement .SpaceEvenly ,
241+ verticalAlignment = Alignment .CenterVertically ,
242+ ) {
243+ TakePhotoButton (onCameraPressed)
244+ Text (
245+ stringResource(CreationR .string.photo_picker_title),
246+ fontSize = 28 .sp,
247+ textAlign = TextAlign .Center ,
248+ lineHeight = 40 .sp,
249+ minLines = 2 ,
250+ maxLines = 2 ,
251+ )
252+ SecondaryOutlinedButton (
253+ onClick = {
254+ onChooseImagePress()
255+ },
256+ leadingIcon = {
257+ Image (
258+ painterResource(CreationR .drawable.choose_picture_image),
259+ contentDescription = null ,
260+ modifier = Modifier
261+ .padding(end = 8 .dp)
262+ .size(24 .dp),
263+ )
264+ },
265+ buttonText = stringResource(CreationR .string.photo_picker_choose_photo_label),
266+ )
267+ }
268+ }
269+
209270@Composable
210271private fun TakePhotoButton (onCameraPressed : () -> Unit ) {
211272 val interactionSource = remember { MutableInteractionSource () }
0 commit comments