This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text( | |
text = "Hello", | |
modifier = Modifier | |
.padding(16.dp) | |
.background(Color.LightGray) | |
.clip(CircleShape) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text( | |
text = "Hello", | |
modifier = Modifier | |
.clip(CircleShape) | |
.background(Color.LightGray) | |
.padding(16.dp) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<solid android:color="@color/light_gray"/> | |
<corners android:radius="16dp" /> | |
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val animatedCircleScale by animateFloatAsState( | |
targetValue = circleScale, | |
animationSpec = spring(Spring.DampingRatioHighBouncy) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var circleScale by remember { mutableStateOf(1f) } | |
val animatedCircleScale by animateFloatAsState(targetValue = circleScale) | |
Box( | |
modifier = Modifier | |
.scale(animatedCircleScale) | |
.requiredSize(100.dp) | |
.clip(CircleShape) | |
.background(MaterialTheme.colorScheme.primaryContainer) | |
) | |
Button(onClick = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var circleScale by remember { mutableStateOf(1f) } | |
Box( | |
modifier = Modifier | |
.scale(circleScale) | |
.requiredSize(100.dp) | |
.clip(CircleShape) | |
.background(MaterialTheme.colorScheme.primaryContainer) | |
) | |
Button(onClick = { | |
circleScale = 0.5f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count by remember { mutableStateOf(1) } | |
Text(text = "The count is $count.") | |
Button(onClick = { | |
count = count.inc() | |
}) { | |
Text(text = "Hit") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 1 | |
Text(text = "The count is $count.") | |
Button(onClick = { | |
count = count.inc() | |
}) { | |
Text(text = "Hit") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 1 | |
findViewById<Button>(R.id.incrementButton).setOnClickListener { | |
count = count.inc() | |
findViewById<TextView>(R.id.counterText).text = "The count is $count" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TextView | |
android:id="@+id/counterText" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
tools:text="The count is 100"/> | |
<Button | |
android:id="@+id/incrementButton" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" |
NewerOlder