Chris Fillmore
04/06/2022, 9:44 PMrememberLauncherForActivityResult
and Compose Navigation?julioromano
04/06/2022, 10:23 PMColor
? (by invert I mean doing 1-x, in other words if luminance is 0.75 inverting it yields a luminance of 0.25).
I’ve tried something like this but with little success:
val xyz = myColor.convert(ColorSpaces.CieXyz)
val invertedLuminance = xyz.copy(green = 1 - xyz.green)
val result = invertedLuminance.convert(ColorSpaces.Srgb)
Tash
04/06/2022, 10:47 PMTobias Gronbach
04/06/2022, 11:28 PMIndu
04/06/2022, 11:37 PMTin Tran
04/07/2022, 2:49 AMAnimatedVisibility
is not experimental anymoreCh8n
04/07/2022, 8:58 AMx
amount of horizontal scroll has happened.nlindberg
04/07/2022, 11:06 AMJoseph Hawkes-Cates
04/07/2022, 2:13 PMdimsuz
04/07/2022, 2:25 PMalignment
value I can do
// alignment = Alignment.Center
val x = alignment.align(myWidth, parentWidth, LayoutDirection.Rtl)
It's a (seemingly) small thing but very nice to not having repeat those boring width/2 - myWidth/2
etc!shivansh mittal
04/07/2022, 7:33 PMtrashcoder
04/07/2022, 8:57 PMSlider
position in a variable like this:
var shutterLevel by remember { mutableStateOf(shutter.shutterLevel) }
And in the onValueChangeFinished
event, I pass it to the API to control the device.
This all works as expected, but... I also listen to events from the server. So whenever the brightness is changed through another app or the shutter level is modified with the wall switch, the Slider
position does not change because it was `remember`ed.
I would be really happy if anyone could help me understand what I am missing here.Vladimir Tagakov
04/07/2022, 11:23 PMKarthi
04/08/2022, 1:14 AMbrabo-hi
04/08/2022, 4:40 AMandroidx.activity:activity-compose
1.6.x
but works with version 1.4.x
ritesh
04/08/2022, 8:12 AMRE
04/08/2022, 9:13 AMMichal Klimczak
04/08/2022, 1:23 PMfun NavController.navToBottomNavItem(route: String, startFromStackRoot: Boolean = false) = navigate(route) {
//how to use [startFromStackRoot]?
popUpTo(DashboardScreenDestination.route) {
saveState = true
}
launchSingleTop = true
restoreState = true
}
The scenario in our app is, there's a botom menu and there's a Dashboard stack (app starts on that) and a Shop stack. The code above makes sure that when user navigates between different bottom bar items, he isn't starting from the root of the stack, but ends up where he left. So far so good.
But there's one scenario, where I want to go from Dashboard directly to the root of the Shop stack, without restoring it's state. E.g. using the startFromStackRoot
param.mmaillot
04/08/2022, 2:09 PMmeu
grow up, it will be limited by the blue cell and I want it will be able to grow outside its cell)Robert Menke
04/08/2022, 6:23 PMste
04/08/2022, 8:13 PMdarkmoon_uk
04/09/2022, 5:03 AMAndroid75
04/09/2022, 10:01 AMCaused by: java.lang.InstantiationException: java.lang.Class<com.xxx.screen.section.SViewModel> has no zero argument constructor
Android75
04/09/2022, 2:35 PMactions: @Composable RowScope.() -> Unit = {},
i’d like to have different action… how can create composable function like this
actions = {
IconButton(onClick = { }) {
Icon(imageVector = Icons.Default.Share, contentDescription = "", tint = BlueDentPad)
}
Icon(
Icons.Filled.ColorLens,tint = BlueDentPad,
contentDescription = "Localized description"
)
}
Alexander Black
04/09/2022, 6:25 PMcomposable(LeafScreen.Account.route,
enterTransition ={
slideIntoContainer(AnimatedContentScope.SlideDirection.Right, tween(5_000))
},
exitTransition = {
slideOutOfContainer(AnimatedContentScope.SlideDirection.Left, tween(5_000))
}
) {....}
composable(LeafScreen.SignIn.route,
enterTransition ={
slideIntoContainer(AnimatedContentScope.SlideDirection.Left, tween(5_000))
},
exitTransition = {
slideOutOfContainer(AnimatedContentScope.SlideDirection.Right, tween(5_000))
}
) {....}
I’m doing this navigation from a BottomSheetScaffold… I wonder if that has something to do with it?
I’m using accompanist-navigation-animation:0.24.3-alpha
i’m also using androidx.navigation:navigation-compose:2.4.2willyrs
04/09/2022, 9:08 PMsetContent {
MyTheme {
Surface(color = MaterialTheme.colors.background) {
Column(Modifier.fillMaxHeight()) {
ListComposable(getList())
}
}
}
}
The ListComposable:
@Composable
fun ListComposable(list: List<Info>, modifier: Modifier = Modifier) {
LazyColumn(modifier) {
items(items = groupedList, itemContent = { item ->
Text(item.value) // CRASH HERE
})
}
}
I don't understand what's happening.. If I pass an empty list, it works. When it's non empty it crashes. The Info is a simple data class with just a valueAndroid75
04/10/2022, 1:43 AMval sampleVideo = "<http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4>"
val context = LocalContext.current
val player = SimpleExoPlayer.Builder(context).build()
val playerView = PlayerView(context)
val mediaItem = MediaItem.fromUri(sampleVideo)
val playWhenReady by rememberSaveable {
mutableStateOf(true)
}
player.setMediaItem(mediaItem)
playerView.player = player
LaunchedEffect(player) {
player.prepare()
player.playWhenReady = playWhenReady
}
AndroidView(factory = {
playerView
})
ignus
04/10/2022, 7:14 AMPeng Wang
04/10/2022, 12:07 PMhttps://developer.android.com/reference/kotlin/androidx/compose/runtime/Immutablethe doc of
@Immutable
said that “data classes that only contain val properties that do not have custom getters can safely be marked as Immutable if the types of properties are either primitive types or also Immutable”
I thought the data class with val properties should have been treated as Stable (or Immutable) by Compiler , isn’t it ? if I don’t annotate Person
with `@Immutable`,means the PersonView
can’t skip the unnecessary Recomposition?Norbi
04/10/2022, 4:08 PMNorbi
04/10/2022, 4:08 PMFrancesc
04/10/2022, 5:27 PMAndrew Neal
04/10/2022, 5:59 PMExposedDropdownMenu
? https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material/material/samples/src/main/java/androidx/compose/material/samples/ExposedDropdownMenuSamples.kt