dimsuz
11/12/2021, 11:13 AMPlotColors
being recreated on each composable function call here? I can't put this in "remember", because MyTheme.colors.someColor
is a Composable
getter:
fun MyComposable() {
val colors = PlotColors(
positiveColor = MyTheme.colors.indicatorContentGreen,
negativeColor = MyTheme.colors.indicatorBackgroundRed,
)
}
John Aoussou
11/12/2021, 11:38 AMval items = viewModel.readAllData.observeAsState()
val TAG = "check"
val item1 = items.value?.get(0)?.original
Log.i(TAG,item1.toString())
However, if I try to show the text in a Text element like so
Column{
Text(text = item1!!)
}
it tells me the List is empty ¯\_(ツ)_/¯Ademir Queiroga
11/12/2021, 11:47 AMFilippo Vigani
11/12/2021, 12:48 PMLazyColumn
.
See thread for code.
I kind of got it working, however when the bitmap is first loaded (i.e. it doesn't come from the cache), it won't display in the list until I scroll (i.e. after a redraw). I want to make use of the features of LazyColumn
and only load the PDF pages when they become visible.
Is there any better way to achieve this?Marcin Wisniowski
11/12/2021, 2:36 PMModifer
conditionally? Like previousModifier().apply{ if(hasPadding) padding(4.dp) }
, except that doesn't work. (I know why it doesn't work, but I don't know a nice method that works)Nacho Ruiz Martin
11/12/2021, 2:44 PMAndroidView
to wrap up the traditional view components.
I’m using the update
lambda to make the needed adjustments in the view whenever the state changes. Is there a way to only set the properties that changed for real? If I just set everything that comes as parameter of the composable, they are all reset each time one of them changes. For example, if the text on a TextView changes, the TextAppearance is set again.
Thanks! 🙇rsktash
11/12/2021, 4:44 PMMarcin Wisniowski
11/12/2021, 4:46 PMRow
with two single line `Text`s. The first one has dynamic text, the second one short static text. How can I make TextOverflow.Ellipsis
work on the first Text
? I want the second Text
to always show fully, and ellipsize the first one if needed. But it doesn't work - the first text pushes the second one offscreen before it starts to ellipsize.Lucca Beurmann
11/12/2021, 4:51 PMvoben
11/12/2021, 8:39 PMLucca Beurmann
11/12/2021, 8:42 PM_shtomar
11/12/2021, 11:29 PMpavankumar
11/13/2021, 5:22 AMLaunchedEffect(Unit) {
launch {
while (true) {
delay(2000)
if (!lazyListState.isScrollInProgress) {
systemUiController.isNavigationBarVisible = false
}
}
}
}
Slackbot
11/13/2021, 5:40 AMPhilip Blandford
11/13/2021, 12:00 PM@Composable
fun PopupTest() {
val show = remember{ mutableStateOf(false)}
val ctr = remember{ mutableStateOf(0)}
Box(
Modifier
.fillMaxSize()
.clickable { ctr.value += 1 }) {
Button({show.value = !show.value}, Modifier.align(Alignment.TopCenter).offset(y = 20.dp)) {
Text("Show Popup")
}
if (show.value) {
Popup(alignment = Alignment.Center,
onDismissRequest = {show.value = false}){
Text("I am the popup", Modifier.border(1.dp, Color.Black))
}
}
Text("Ctr ${ctr.value}",
Modifier
.align(Alignment.BottomCenter)
.offset(y = -20.dp))
}
}
Paul Woitaschek
11/13/2021, 5:53 PMMohamed Ahmed ALi
11/14/2021, 6:49 PMPaul
11/14/2021, 9:43 PMMike Speed
11/15/2021, 11:07 AMaccompanist.pager.HorizontalPager
and for some reason my textviews are always square when the string is longer than one line… any ideas why?
HorizontalPager(
count = 2,
state = pagerState,
verticalAlignment = <http://Alignment.Top|Alignment.Top>
) { i ->
when (i) {
0 -> Text(
"A string A string A string A string A string A string A string",
modifier = Modifier.wrapContentHeight(), //makes no difference
)
1 -> SomethingElse()
}
}
I also tried wrapping in a Row with wrapContentHeight but it didn’t make a difference.Matti MK
11/15/2021, 11:12 AMAmrJyniat
11/15/2021, 1:43 PMNiko
11/15/2021, 1:55 PM@Preview
composables ATMBradleycorn
11/15/2021, 5:20 PMLaunchedEffect
along with LocalLifecycleOwner
in a “Screen” composable to start a long-running/intensive coroutine in my ViewModel only when the containing Activity/Fragment is RESUMED
. More info and code in the 🧵
I’m curious if this is a proper/best solution for my use case or if there are better ways to do this?mcpiroman
11/15/2021, 5:37 PMHachemi Hamadi
11/15/2021, 8:25 PMminifyEnabled true
the app crashes on startup. I couldn't figure out what's causing it.thelumiereguy
11/15/2021, 8:55 PMColton Idle
11/15/2021, 9:20 PMBox(
modifier = Modifier
.border(1.dp, Color.Red)
.fillMaxWidth()
.height(72.dp)
.clickable { Log.e("LOG", "CLICK") }
) { Text(text = "MY TEXT") }
Clament John
11/16/2021, 5:09 AMgif▾
Nurseyit Tursunkulov
11/16/2021, 7:01 AMPaul Woitaschek
11/16/2021, 7:56 AMPaul Woitaschek
11/16/2021, 7:56 AMEjimax
11/16/2021, 8:56 AMA failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Paul Woitaschek
11/16/2021, 8:57 AMEjimax
11/16/2021, 8:58 AMPaul Woitaschek
11/16/2021, 8:59 AMEjimax
11/16/2021, 9:00 AMCsaba Kozák
11/16/2021, 9:38 AMPaul Woitaschek
11/16/2021, 9:39 AM