Guy Bieber
06/03/2020, 10:29 PM//by default
edittext.setTransformationMethod(new PasswordTransformationMethod());
//You can make it custom
edittext.setTransformationMethod(new AsterPasswordTransformationMethod());
Guy Bieber
06/04/2020, 3:15 AMElena Boiko
06/04/2020, 7:44 AMallan.conda
06/04/2020, 12:19 PMmanueldidonna
06/04/2020, 3:03 PMhenrikhorbovyi
06/04/2020, 5:02 PMtitle
(and others too) property appears and it is implemented but when I call it shows an error highlight?pavi2410
06/04/2020, 6:33 PMAlertDialog
? I want to implement an Exit Dialog but it is neither closing when onCloseRequest
is called nor when confirmButton
is clicked
@Composable
private fun ExitDialog() {
val (show, setShow) = state { true }
if (show) {
AlertDialog(
text = {
Text("Do you want to really quit???")
},
confirmButton = {
Button(modifier = Modifier.padding(16.dp), onClick = { setShow(false) }) {
Text(text = "OK")
}
},
onCloseRequest = { setShow(false) }
)
} else {
return
}
}
henrikhorbovyi
06/04/2020, 11:54 PMcoolchandrakumar
06/05/2020, 7:41 AM@Composable
fun inflateAndroidView() {
Column(modifier = Modifier.fillMaxWidth().wrapContentSize(), horizontalGravity = Alignment.Start) {
Text(text = "AndroidView-Compose", modifier = Modifier.padding(all = 16.dp))
AndroidView(view = TextView(ContextAmbient.current).apply {
text = "InsideTextView Android Widget"
})
AndroidView(view = WebView(ContextAmbient.current).apply {
loadData("InsideWebView Android Widget", "text/html", "UTF-8")
})
}
}
Looking to achieve the same in developementdagomni
06/05/2020, 11:10 AMKazemihabib1996
06/05/2020, 3:10 PMBottomNavigation
in Scaffold
is the bottomAppbar
slot is for both BottomAppBar
and BottomNavigation
? if so, is the name of bottomAppbar
parameter will change in future?carbaj0
06/05/2020, 5:24 PMCard(
modifier = Modifier.clickable(onClick = { someaction() }).ripple()
)
onclick isn't working, it shows the ripple but not perform the actionhenrikhorbovyi
06/05/2020, 5:32 PMhenrikhorbovyi
06/06/2020, 6:52 AM@Model
object AppNavigator {
var currentScreen: Screen = Screen.Home()
}
/**
* Temporary solution pending navigation support.
*/
fun navigateTo(destination: Screen) {
AppNavigator.currentScreen = destination
}
But now I'm using dev12, and we know that @Model
is deprecated. How do you guys would fix it?
I've tryied:
object AppNavigator {
var currentScreen: MutableState<Screen> = state { Screen.Home() }
}
But it does not work, states must be called inside composablesMikael Alfredsson
06/06/2020, 5:07 PMsetSaturation
but I can’t find any similar function for Composable Images? (I’m very new to Compose so I can easily have missed something)henrikhorbovyi
06/06/2020, 11:24 PMCenter
composable?
example
Center {
Text("I'm in the center now")
}
Diego Marulanda
06/07/2020, 3:45 AMHorizontalScroller
scroll to a specific point? I mean, I have several images in a HorizontalScroller
and I need that when the user performs the scroll this movement continues so that the image that is seeing at that moment it is centered, for example, if the user stops scrolling in the middle of the first and the second image, the scroll completes the movement until only one of the 2 images is seenZach Klippenstein (he/him) [MOD]
06/07/2020, 7:05 PMTash
06/07/2020, 7:27 PMOnBackPressedDispatcher
, but wondering if there's a better way...Vinay Gaba
06/07/2020, 11:47 PMtestTag
Modifier on a Text composable that’s a part of the AdapterList. I’m getting this error
java.lang.IllegalStateException: merge function called on unmergeable property TestTag. Existing value: Composable1, new value: Composable2. You may need to add a semantic boundary.
at androidx.ui.semantics.SemanticsPropertyKey.merge(SemanticsProperties.kt:95)
Do I need to use this differently when used inside an AdapterList?Vinay Gaba
06/08/2020, 12:29 AMAndroidComposeTestRule
to start a custom activity to test it. The individuals tests work fine but they fail when running them together. This is because I’m not doing anything in the @Before
method to clean and restart the activity. That causes the state to be shared between the test cases. I know in Espresso I’ve used a custom test rule for avoiding this. Can I get any direction on whether something like that already exists in compose?kenkyee
06/08/2020, 1:33 AMhenrikhorbovyi
06/08/2020, 4:57 AM@Composable
function?Manuel Wrage
06/08/2020, 8:28 AMhenrikhorbovyi
06/08/2020, 2:52 PMInjectable {
val myDependency: MyDependecy by inject()
HomeScreen(myDependency)
}
pavi2410
06/08/2020, 5:04 PMKlaas Kabini
06/08/2020, 5:27 PMKlaas Kabini
06/08/2020, 5:31 PMMarc Reichelt
06/08/2020, 9:50 PMZach Klippenstein (he/him) [MOD]
06/08/2020, 9:52 PMlaunchInComposition
launches the coroutine on commit, and cancels it on dispose, but it’s not clear if there’s any case in which a coroutine could be launched again in the same point in the composition, after being cancelled. Or whether onDispose
is called if the composition fails before onCommit
gets invoked.Zach Klippenstein (he/him) [MOD]
06/08/2020, 9:52 PMlaunchInComposition
launches the coroutine on commit, and cancels it on dispose, but it’s not clear if there’s any case in which a coroutine could be launched again in the same point in the composition, after being cancelled. Or whether onDispose
is called if the composition fails before onCommit
gets invoked.onCommit
will only be called once for a given point in the composition, then as long as onDispose
is called on composition failure it seems like rolling back would be fairly trivial. I feel like I’m missing some piece of the puzzle here. Maybe onCommit
can be called multiple times?
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1591565761398100?thread_ts=1591558024.394400&cid=CJLTWPH7SAdam Powell
06/08/2020, 11:21 PMonDispose
is not called on composition failure, it is called to dispose the result of a previous successful compositionlaunchInComposition
is a sort of task that exists at its position in the composable function; just like a UI element it runs when it becomes present and is cancelled if it leaves the composition before finishing. It does not run again unless you provide it with comparison values that change from one recomposition to another, in which case it will cancel the currently running task block before launching the new one.Task
or similar to reinforce this noun-entity behavior of presence in the composition (and joked about calling it AsyncTask
in particular)Chuck Jazdzewski [G]
06/08/2020, 11:59 PMonCommit
's lambda is only called once the composition succeeds that contains the onCommit
. onDispose
is only called if onCommit
is called and only after composition succeeds that removes the onCommit
from the composition. Calling the onCommit
and onDispose
lambdas is the last step of composition after it has committed to using the results of composition.
The quote from Adam above was regarding side-effects in an @Composable
function outside of onCommit
. For example, if you launched a coroutine directly using the main dispatcher in the @Composable
function, this might start a job that is unnecessary and need to be cancelled. However, we currently do not have an API to inform a @Composable
function that its results were discarded. We, therefore, recommend all effects be contained in an onCommit
or similar effect such as launchInComposition
which uses onCommit
internally (well, actually, it uses CompositionLifecycleObserver
which is what onCommit
uses too, but that is an implementation detail).Vinay Gaba
06/09/2020, 12:06 AMval count by state {0}
onCommit {
count = count + 1
}
Tash
06/09/2020, 12:11 AMonPreCommit
comes into play here, as I see it is used in some internal Compose components.Zach Klippenstein (he/him) [MOD]
06/09/2020, 2:55 AMonPreCommit
fits into all of this, and a little curious in what scenario, without multi-threading, a composition could fail, but that’s not as interesting as knowing how compose behaves when it happens, so thanks again.