Ink
11/22/2021, 12:30 PMBasicTextField()
Is it possible to center black indicator?zoha131
11/22/2021, 1:40 PMMarko Novakovic
11/22/2021, 4:04 PMDon't keep activities
is turned on and am using Navigation Component
when I navigate to dialog composable that is registered inside NavGraph
with dialog() {}
it’s not on top after I leave app and come back
how can I make it be on top after process death?
is there a way for Navigation Component
to do that or I need to keep track of that and navigate to dialog
destination after app is restored?Bradleycorn
11/22/2021, 4:29 PMonAllNodes*
finders, can I make assumptions about the order of nodes that are in the result? Example code in the 🧵Marko Novakovic
11/22/2021, 4:50 PM@Composable
private fun MyInputField(
modifier: Modifier = Modifier,
text: String,
onTextChanged: (String) -> Unit,
) {
val focusRequester = remember { FocusRequester() }
LaunchedEffect(Unit) {
focusRequester.requestFocus()
}
OutlinedTextField(
modifier = modifier.focusRequester(focusRequester),
label = { Text(text = "some text") },
value = text,
onValueChange = onTextChanged,
)
}
sometimes keyboard is show and sometimes it is not
what that depends on?Bassam A.
11/22/2021, 6:12 PMkrzysztof
11/22/2021, 6:58 PMColton Idle
11/22/2021, 8:29 PMRafs
11/22/2021, 9:52 PMMutableState
variable, including when the contents are the same? I've Tried creating my own SnapshotMutationPolicy
but the merge
method never gets called.Arpit Shukla
11/23/2021, 4:16 AMdata class Category (
val title: String,
val items: List<String>
)
And I want to display a list of Category
using a LazyColumn. I tried this:
LazyColumn {
items(list) { category ->
Text(text = category.title)
category.items.forEach { item ->
Text(text = item)
}
}
}
But I want to replace the inner loop with something lazy. I can't nest another LazyColumn. Using this@LazyColumn.items(category.items)
doesn't give the desired UI. How to implement this case?rudolf.hladik
11/23/2021, 8:07 AMstickyHeader
😞 in LazyColumn
when I use Paging
is it a bug or am I doing something wrong? Code in 🧵Mayank Saini
11/23/2021, 9:22 AMJérémy CROS
11/23/2021, 9:27 AMAbstractComposeView
to display a composable in an existing XML view but I’m not getting any preview for the XML layout... Anything I’m missing there? Thanks! 🙂Napa Ram
11/23/2021, 9:45 AMAmrJyniat
11/23/2021, 12:28 PMIcons.Default.ArrowBack
icon to change its direction automatically when layout direction changed?georgiy.shur
11/23/2021, 3:42 PMScaffold
wrap content? I’m trying to put my Scaffold
into the bottom sheet, but it always makes it fill the whole screen even if the content is smaller.Archie
11/23/2021, 5:25 PMLucca Beurmann
11/23/2021, 10:27 PMshahroz
11/24/2021, 1:11 AM1.1.0-beta03
and it kinda broke stuff for me. I am using Android View
and inside that, I create my compose
views.
My compose views are not catching click listeners very often now.
I see commits in the release related to it, specifically Better handling of child AndroidViews with click handlers but I am not sure, if this is a bug or do i need to make any new changes to work with this release? the click listener worked fine with previous version.Md. Nazmun Sadat Khan
11/24/2021, 3:50 AMAlex C
11/24/2021, 4:33 AM@Composable
fun TestClickView(
offerList: List<String>,
onClose: () -> Unit,
onSelected: (String) -> Unit
) {
Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Image(painterResource(id = R.drawable.ic_close), null, modifier = Modifier.clickable {
Timber.i("on close clicked")
onClose()
})
Spacer(modifier = Modifier.height(16.dp))
Text("text 1")
Text("text 2")
LazyColumn(
modifier = Modifier
.padding(20.dp, 0.dp)
.fillMaxWidth()
) {
items(offerList) {
Text(text = it, modifier = Modifier.clickable(role = Role.Button) {
Timber.i("on item clicked value $it")
onSelected(it)
})
Spacer(modifier = Modifier.height(16.dp))
}
}
}
}
The image is clickable, and the items inside the LazyColumn is clickable,
Normally it works
But I find if I click other places before I click the Image or the items inside the LazyColumn, the click event is not triggered, any ideas?Tim Malseed
11/24/2021, 6:42 AM@Composable
fun RootScreen(navController: NavHostController, viewModel: RootViewModel) {
LaunchedEffect("navigation") {
viewModel.authenticationState
.map { it.toDestination() }
.onEach {
navController.navigate(it.route)
}
.launchIn(this)
}
RootScreen(navController)
}
The test:
@Test
fun testNavigateToHome() {
userManager._authenticationState.value = UserAuthenticationState.Authenticated(
User(null, null),
UserEmployeeState.Pending
)
assert(navController.currentDestination?.route == NavigationDestination.Root.Home.route)
composeTestRule
.onNodeWithTestDescription("Home Screen")
.assertIsDisplayed()
}
Yann Badoual
11/24/2021, 8:46 AM@Immutable
, is it still required to add the annotation to every class implementing this interface? (would make sense that it is).
Any behavior difference between interface/superclass ?
(Does it depend on the type declared in the composable signature, or the actual type at runtime?)Jast Lai
11/24/2021, 8:47 AMclass MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Greeting("Text")
}
lifecycleScope.launch {
delay(1000)
repeat(100) {
delay(10)
animationPoint.value = animationPoint.value + 1
}
}
}
}
var animationPoint = mutableStateOf(0)
@Composable
fun Greeting(aText: String) {
Surface(
modifier = Modifier.offset(
x = animationPoint.value.dp
)
) {
Column {
repeat(40) {
Text("Text")
}
}
}
}
this will make those Texts from left to right. It seem smooth and without any question.
But if I change like this Text content to parameter.
@Composable
fun Greeting(aText: String) {
Surface(
modifier = Modifier.offset(
x = animationPoint.value.dp
)
) {
Column {
repeat(40) {
Text(aText)
}
}
}
}
It will feel lag and obviously has drop some frame.
I wonder what difference between those two method ?
And If I don't wanna drop frame, How should I do ?AmrJyniat
11/24/2021, 9:19 AMAlertDialog
when the layout direction change to RTL, so the title, text and buttons align to the wrong alignment in that case, is it bug or am I missed anything? code in 🧵Zoltan Demant
11/24/2021, 9:56 AM@Immutable/@Stable
is inferred (e.g. for strings); is there a list with these types somewhere?Can
11/24/2021, 10:09 AMTin Tran
11/24/2021, 10:31 AMiamthevoid
11/24/2021, 10:38 AMenabled
colors) but pass touches through?Neil
11/24/2021, 10:40 AMhttps://d30v2pzvrfyzpo.cloudfront.net/uk/images/restaurants/106512.gif▾