Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ import com.android.developers.androidify.theme.components.PrimaryButton
@OptIn(ExperimentalMaterial3ExpressiveApi::class, ExperimentalSharedTransitionApi::class)
@Composable
fun ColorSplashTransitionScreen(
modifier: Modifier = Modifier,
enterSpec: AnimationSpec<DpSize> = MaterialTheme.motionScheme.fastSpatialSpec(),
exitSpec: AnimationSpec<DpSize> = MaterialTheme.motionScheme.slowSpatialSpec(),
startPoint: IntOffset = IntOffset(0, 0),
color: Color = Blue,
onTransitionMidpoint: () -> Unit = {},
onTransitionFinished: () -> Unit = {},
modifier: Modifier = Modifier,
) {
val sizeAnimation = remember {
Animatable(DpSize(0.dp, 0.dp), DpSizeToVector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ fun Modifier.skipToLookaheadPlacement(scope: SharedTransitionScope): Modifier =
@Composable
fun AnimatedTextField(
textFieldState: TextFieldState,
targetEndState: String? = null, // when this value is null, no animation will happen
modifier: Modifier = Modifier,
targetEndState: String? = null, // when this value is null, no animation will happen
textStyle: TextStyle = TextStyle.Default,
decorator: TextFieldDecorator? = null,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ internal fun CameraGuide(

@Composable
private fun BoxScope.DecorativeSquiggle(
color: Color = MaterialTheme.colorScheme.primary,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.primary,
alignment: Alignment = Alignment.TopEnd,
) {
val infiniteAnimation = rememberInfiniteTransition()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import com.android.developers.androidify.util.supportsTabletop

@Composable
internal fun CameraLayout(
modifier: Modifier = Modifier,
viewfinder: @Composable (modifier: Modifier) -> Unit,
captureButton: @Composable (modifier: Modifier) -> Unit,
flipCameraButton: @Composable (modifier: Modifier) -> Unit,
Expand All @@ -59,7 +60,6 @@ internal fun CameraLayout(
rearCameraButton: @Composable (modifier: Modifier) -> Unit,
supportsTabletop: Boolean = supportsTabletop(),
isTabletop: Boolean = false,
modifier: Modifier = Modifier,
) {
BoxWithConstraints(
modifier
Expand Down Expand Up @@ -255,13 +255,13 @@ private fun TableTopReadyCameraLayout(
)
}
HorizontalControlsLayout(
modifier = Modifier
.weight(1f)
.padding(bottom = 16.dp),
captureButton,
flipCameraButton,
zoomButton,
rearCameraButton,
modifier = Modifier
.weight(1f)
.padding(bottom = 16.dp),
)
}
}
Expand Down Expand Up @@ -296,11 +296,11 @@ private fun TableTopCameraLayout(
) {
guideText(Modifier.align(Alignment.TopCenter))
HorizontalControlsLayout(
modifier = Modifier.align(Alignment.Center),
captureButton,
flipCameraButton,
zoomButton,
rearCameraButton,
modifier = Modifier.align(Alignment.Center),
)
}
}
Expand Down Expand Up @@ -373,6 +373,7 @@ private fun VerticalCameraLayout(
)
}
HorizontalControlsLayout(
modifier = Modifier,
captureButton,
flipCameraButton,
zoomButton,
Expand All @@ -384,11 +385,11 @@ private fun VerticalCameraLayout(

@Composable
private fun HorizontalControlsLayout(
modifier: Modifier = Modifier,
captureButton: @Composable (modifier: Modifier) -> Unit,
flipCameraButton: (@Composable (modifier: Modifier) -> Unit)?,
zoomButton: (@Composable (modifier: Modifier) -> Unit)?,
rearCameraButton: (@Composable (modifier: Modifier) -> Unit)? = null,
modifier: Modifier = Modifier,
) {
Column(
modifier = modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import com.android.developers.androidify.theme.Primary80
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun RearCameraButton(
modifier: Modifier = Modifier,
isRearCameraEnabled: Boolean = false,
toggleRearCamera: () -> Unit,
modifier: Modifier = Modifier,
) {
val actionLabel = stringResource(R.string.rear_camera_description)
val colors = if (isRearCameraEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ private fun TextPromptGenerationPreview() {
TextFieldState(),
false,
generatedPrompt = "wearing a red sweater",
{},
onPromptGenerationPressed = {},
)
}
}
Expand All @@ -668,7 +668,7 @@ private fun TextPromptGenerationInProgressPreview() {
TextFieldState(),
true,
generatedPrompt = "wearing a red sweater",
{},
onPromptGenerationPressed = {},
)
}
}
Expand All @@ -677,9 +677,9 @@ private fun TextPromptGenerationInProgressPreview() {
fun TextPrompt(
textFieldState: TextFieldState,
promptGenerationInProgress: Boolean,
modifier: Modifier = Modifier,
generatedPrompt: String? = null,
onPromptGenerationPressed: () -> Unit,
modifier: Modifier = Modifier,
) {
Column(modifier) {
Row(verticalAlignment = Alignment.CenterVertically) {
Expand Down