andylamax
06/17/2020, 12:43 PM4.2.0-alpha01
?Artur Matsehor
06/17/2020, 9:29 PMbohregard
06/17/2020, 10:45 PMZach Klippenstein (he/him) [MOD]
06/17/2020, 11:23 PMGuy Bieber
06/18/2020, 3:01 AMElias
06/18/2020, 8:13 AMSanthosh Kumar
06/18/2020, 11:32 AMJavier
06/18/2020, 11:33 AMbohregard
06/18/2020, 1:20 PMsetContent {
AppState.currentScreen = Screen.LoadingScreen
Log.d(TAG, "set content")
MaterialTheme(colors = darkColorPalette()) {
Log.d(TAG, "Material Theme")
Providers(MainActivityAmbient provides this, DiAmbient provides di) {
Log.d(TAG, "Providers")
Crossfade(AppState.currentScreen) {
Log.d(TAG, "Crossfade $AppState")
Log.d(TAG, "Crossfade ${AppState.currentScreen}")
but the crossfade is called twice
If I try to change the currentScreen in the crossfade, I end up in a loop that never ends. How is one supposed to use Crossfade?Merhawifissehaye
06/18/2020, 2:22 PMAdrian Blanco
06/18/2020, 2:34 PMAhmed Elhanafy
06/18/2020, 8:02 PMGuy Bieber
06/18/2020, 10:53 PMAhmed Elhanafy
06/19/2020, 1:37 AMAhmed Elhanafy
06/19/2020, 2:15 AMTristan
06/19/2020, 3:54 AMAhmed Elhanafy
06/19/2020, 1:32 PMflexWrap: wrap
with the Row
composable?rophuine
06/19/2020, 1:47 PMVerticalScroller
) which takes up most of the screen, with a Column
wrapping the VerticalScroller
and a TextField
element below it, but have the whole thing take up the entire view port that isn't covered by the keyboard (e.g. if the keyboard is hidden, it'll take up the whole height - if the keyboard is shown, it'll reduce in height to take up all the available height except what the keyboard is covering).rophuine
06/19/2020, 1:49 PMAnnotatedString.Builder
class was really nice - the API was a perfect match for what I was trying to achieve. pop(index: Int)
was particularly useful and really cut down the code I needed to write for my specific use-case.Ahmed Elhanafy
06/19/2020, 2:24 PMText
composable?Slackbot
06/19/2020, 4:15 PMromainguy
06/19/2020, 7:00 PMenighma
06/20/2020, 6:32 AMMerhawifissehaye
06/20/2020, 8:49 PMallan.conda
06/20/2020, 9:10 PMzalewski.se
06/21/2020, 2:18 PMTextField
to the right side of the screen? I’m trying to use ConstraintLayout
for this, where everything looks as expected with Text
element, but when I changed it to TextField
it looks like the:
right constrainTo parent.right
doesn’t work 🤔
To give you some code:
This is sample with `Text`:
ConstraintLayout(
modifier = Modifier.fillMaxWidth().wrapContentHeight(),
constraintSet = ConstraintSet {
tag("amountTag").apply {
right constrainTo parent.right
right.margin = 16.dp
horizontalBias = 1.0f
centerVertically()
}
}
) {
Text(
modifier = Modifier.tag("amountTag"),
fontSize = 16.sp,
text = rate.value.toString()
)
}
And when I just changed Text
to `TextField`:
TextField(
modifier = Modifier.tag("amountTag"),
value = value,
onValueChange = {
value = it
}
)
Also I tried to add some modifiers to TextField
like: .wrapContentWidth(Alignment.End)
but same result.andylamax
06/21/2020, 2:36 PMsetContent(Recomposer.current()) {}
in fragments? and if we must pass a Recomposer as a parameter, in which scenario would I need to pass another Recomposer? say setContent(Recomposer.new()){}
. If not, why is Recomposer.current()
not a default parameter value in setContent
?henrikhorbovyi
06/22/2020, 3:17 PMImage(
asset = vectorResource(id = R.drawable.ic_android),
modifier = Modifier.size(56.dp),
colorFilter = ColorFilter.tint(Color.Red)
)
Lilly
06/22/2020, 9:10 PMandbapps
06/22/2020, 9:56 PM@Composable
fun TestAnimation() {
val moved = state { false }
val offset = DpPropKey()
val transition = transitionDefinition<Boolean> {
state(true) {
this[offset] = 100.dp
}
state(false) {
this[offset] = 0.dp
}
transition {
offset using tween {
easing = LinearEasing
duration = 1000
}
}
}
Transition(definition = transition, toState = moved.value) { transitionState ->
println("transitionState[offset] = ${transitionState[offset]}")
Box(
modifier = Modifier
.clickable(onClick = { moved.value = !moved.value })
.padding(start = transitionState[offset])
.size(56.dp),
shape = CircleShape,
backgroundColor = Color.Blue
)
}
}
andbapps
06/22/2020, 9:56 PM@Composable
fun TestAnimation() {
val moved = state { false }
val offset = DpPropKey()
val transition = transitionDefinition<Boolean> {
state(true) {
this[offset] = 100.dp
}
state(false) {
this[offset] = 0.dp
}
transition {
offset using tween {
easing = LinearEasing
duration = 1000
}
}
}
Transition(definition = transition, toState = moved.value) { transitionState ->
println("transitionState[offset] = ${transitionState[offset]}")
Box(
modifier = Modifier
.clickable(onClick = { moved.value = !moved.value })
.padding(start = transitionState[offset])
.size(56.dp),
shape = CircleShape,
backgroundColor = Color.Blue
)
}
}
Zach Klippenstein (he/him) [MOD]
06/22/2020, 10:02 PMoffset
key every time TestAnimation
is invoked. Either remember
it or declare as a top-level val.andbapps
06/22/2020, 11:23 PMAndrey Kulikov
06/22/2020, 11:31 PMandbapps
06/23/2020, 12:13 AM