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
@Composable | |
fun SlotText( | |
state: TransitionState, | |
modifier: Modifier = Modifier | |
) { | |
val current = state[currentSlotValue].toInt() % 10 | |
val delta = state[currentSlotValue] - state[currentSlotValue].toInt() | |
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
@Composable | |
fun Slot( | |
from: Int, | |
to: Int, | |
.. | |
) { | |
SlotText( | |
state = transition( | |
definition = transitionDefinition { | |
state(0) { this[currentTickerValue] = from.toFloat() } |
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
@Composable | |
fun Slot( | |
from: Int, | |
to: Int, | |
modifier: Modifier = Modifier, | |
) { | |
SlotText( | |
state = transition( | |
definition = transitionDefinition { | |
// [1] |
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 currentSlotValue = FloatPropKey() | |
@Composable | |
fun SlotText( | |
state: TransitionState, | |
modifier: Modifier = Modifier | |
) { | |
// [1] | |
var current = state[currentSlotValue].toInt() | |
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
@Composable | |
fun CircleNeomorph( | |
state: TransitionState, | |
modifier: Modifier = Modifier, | |
) { | |
// [1] | |
val bias = (3 - 2f * state[buttonStateProgress]) * 0.1f | |
Box(modifier = modifier.size(size = 200.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
val items = listOf<Item>(..) | |
@Composable | |
fun Parallax(modifier: Modifier = Modifier) { | |
// [1] | |
val scrollState = rememberScrollState() | |
// [2] | |
ScrollableRow( |
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
@Composable | |
fun ItemCard( | |
item: Item, | |
scrollX: Float, | |
modifier: Modifier = Modifier, | |
) { | |
Card( | |
modifier = modifier.size(width = 320.dp, height = 500.dp) | |
.padding(start = 16.dp, top = 16.dp, bottom = 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
/** | |
* Sets the text color, size, style, hint color, and highlight color | |
* from the specified TextAppearance resource. | |
*/ | |
public void setTitleTextAppearance(Context context, @StyleRes int resId) { | |
mTitleTextAppearance = resId; | |
if (mTitleTextView != null) { | |
mTitleTextView.setTextAppearance(context, resId); | |
} | |
} |