elye
11/16/2021, 11:21 AMclass CustomView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0)
: View(context, attrs, defStyleAttr) {
// Some Jetpack Compose drawn item
}
I have also check in https://stackoverflow.com/q/69987040/3286489antonioleiva
11/16/2021, 11:56 AMparent
argument in the setContent
extension?
public fun ComponentActivity.setContent(
parent: CompositionContext? = null,
content: @Composable () -> Unit
) {...}
I've never seen a sample using this argument 🤔Tgo1014
11/16/2021, 1:58 PMgpaligot
11/16/2021, 2:32 PMRick Regan
11/16/2021, 2:55 PMPablo Reyes
11/16/2021, 4:38 PMPiotr Prus
11/16/2021, 4:55 PManimateFloatAsState
to animate height, but I do not know how to reset this on each click on next bar in the chart.Andrei Kovalev
11/16/2021, 5:52 PMobject : NestedScrollConnection {
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
totalScrolled -= available.y
}
if the list reaches the top and I keep scrolling up available.y
will still be positive therefore scrolling back to the initial position will not make totalScrolled
as 0AmrJyniat
11/16/2021, 6:06 PMMehdi Haghgoo
11/16/2021, 8:08 PMMehdi Haghgoo
11/16/2021, 8:11 PMIsaac
11/16/2021, 8:20 PMComposable
screen when the app receives a notification while it’s in the foreground without using a PendingIntent
? Cc: @louiscadjeff
11/17/2021, 4:03 AMandroidx.compose.ui:ui:1.1.0-alpha03
I can view the source code in Android Studio. But if I pull in 1.1.0-alpha04
(or anything past that) I can't, I just get ugly decompiled .class files -- any idea why that is? Was source omitted from later builds? How could I check that?Utkarsh Tiwari
11/17/2021, 4:23 AMAbhinav Sharma
11/17/2021, 6:19 AMAlex
11/17/2021, 9:22 AMby remember { mutableStateOf(selection) }
instead of rememberUpdatedState
? Seems like the latter is the same just more refined?allan.conda
11/17/2021, 10:22 AMNavHost
backstack?
I need the activity to launch from a specific destination, so that user is navigated back to that after exiting the activity.Abhinav Suthar
11/17/2021, 10:24 AMSnapshotStateList<Char>
to a composable function. But any changes to SnapshotStateList's item(s)
doesn’t re-trigger the LaunchedEffect
Any idea why?
Code in thread.Alex
11/17/2021, 11:33 AMbeta-03
is going to be released?Matti MK
11/17/2021, 11:52 AMKoin
as shown below.
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module
actual val myScreenModule = module {
viewModel { MyScreen() }
}
The VM itself extends import androidx.lifecycle.ViewModel
class.
And inside my NavGraphBuilder.addMainGraph
block I instantiate the screen
composable(MyScreen.route) {
MyScreen(
viewModel = get(),
)
}
Not quite sure how to go about things here: is this expected behaviour and I should store VM state inside or is there some other way that I could keep the state?lhwdev
11/17/2021, 1:55 PM@Composable
is defined with the annotation. (I know this can't be adopted as it is a huge breaking change)
Now there are a lot of things using Compose runtime; Compose UI, Glance, Some terminal(I do not remember the name), and can be extended freely.
If both Compose UI and Glance had Text
, it would be a lot confusing. 🧵Anastasia Rozovskaya
11/17/2021, 1:56 PMComposeView
. Could I use this composeView for two types of Composable dialogs which is shown on the screen dynamically depending on backend results? Or should I use one composeView per one type of dialogs?Rizwan Minhas
11/17/2021, 1:57 PMColton Idle
11/17/2021, 8:03 PMAndy Gibel
11/17/2021, 8:09 PMdarkmoon_uk
11/17/2021, 8:33 PM@Composable
is being presented in a @Preview
or not? (Something in Locals?)
I know it shouldn't care; but sometimes in the real world there are practical reasons.
In this case the Coil SVG library is crashing in Previews for some class-loader related reason; I need some flag to suppress registering of the SVG handler in Previews so I can get on with building the rest of the View.Marc-Antoine Fortier
11/17/2021, 8:38 PMe: This version (1.0.5) of the Compose Compiler requires Kotlin version 1.5.31 but you appear to be using Kotlin version 1.6.0 which is not known to be compatible. Please fix your configuration (orIs there an available version of the compose compiler that supports kotlin 1.6.0? Ours is set tobut don't say I didn't warn you!).suppressKotlinVersionCompatibilityCheck
kotlinCompilerExtensionVersion = "1.0.5"
Thanks for your help!Joseph Hawkes-Cates
11/17/2021, 9:49 PMjava.lang.NoClassDefFoundError: Could not initialize class...
whenever I try to create the data class instance within my preview composable function. Has anyone else run into this before?Tash
11/17/2021, 10:08 PMflowWithLifecycle
API. Since new lifecycle APIs are stable in 2.4.0, are there any plans to add similar helpers in Compose artifacts?Colton Idle
11/17/2021, 10:11 PMclass ScreenAState {
val people = mutableStateListOf<PersonUIWrapper>()
}
data class PersonUIWrapper(var selected: Boolean, val person: Person)
then in an onclick of a person in my list I do
TextButton(onClick = {
it.selected = true
})...
but my code doesn't recompose, and therefore doesn't show a checkmark. Is my PersonUIWrapper supposed to use snapshot state internally for it's two fields?