natario1
02/16/2021, 12:01 PMvipulasri
02/16/2021, 12:14 PM'Surface(Modifier = ..., Shape = ..., Color = ..., Color = ..., BorderStroke? = ..., Dp = ..., () -> Unit): Unit' is only available since Kotlin 1.4.30 and cannot be used in Kotlin 1.4
P.S:
kotlin_version = '1.4.30'
compose_version = '1.0.0-alpha12'
Yuri Drigin
02/16/2021, 12:32 PMPiotr Prus
02/16/2021, 12:48 PMSurface(color = MaterialTheme.colors.background) {
Box(modifier = Modifier.size(100.dp).background(Color.Yellow)
.pointerInput(Unit) {
detectVerticalDragGestures(
onDragCancel = { Log.d("AAAA", "onDragCancel") },
onDragEnd = { Log.d("AAAA", "onDragEnd") },
onVerticalDrag = { change, dragAmount -> Log.d("AAAA", "Drag change: $dragAmount") }
)
})
}
It is a simple Box. The issue: onDragEnd
and onDragCancel
are never called. The onVerticalDrag
works like a charm. Is there any mistake in my code or should I file a bug? Compose version : alpha12József Szilvási
02/16/2021, 1:07 PMandroid:includeFontPadding="false"
android:lineSpacingExtra="0dp"
Alex Bieliaiev
02/16/2021, 2:09 PM7.0.0-alpha04
to 7.0.0-alpha06
Android Gradle plugin migration I'm getting This version (1.0.0-alpha12) of the Compose Compiler requires Kotlin version 1.4.30 but you appear to be using Kotlin version 1.4.21 which is not known to be compatible.
error. That is sort of expected, since I have a classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
top-level dependency. Prior to the upgrade, however, I could explicitly specify kotlinCompilerVersion
in the ComposeOptions
section. As of now, this property seems to be deprecated. Do I have options other than complete project migration to Kotlin v1.4.30?Ahmet Delibaş
02/16/2021, 3:17 PMNoé Casas
02/16/2021, 3:19 PM2021-02-16 16:08:34.866 9683-9698/... E/System: Uncaught exception thrown by finalizer
2021-02-16 16:08:34.909 9683-9698/... E/System: java.lang.IllegalStateException: Warning: Router objects should be explicitly closed when no longer required otherwise you may leak handles.
at w4.finalize(chromium-TrichromeWebViewGoogle.aab-stable-432415233:4)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:289)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:276)
at java.lang.Daemons$Daemon.run(Daemons.java:137)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.Exception: AutocloseableRouter allocated at:
at w4.<init>(chromium-TrichromeWebViewGoogle.aab-stable-432415233:4)
at vu.<init>(chromium-TrichromeWebViewGoogle.aab-stable-432415233:8)
at org.chromium.content.browser.framehost.RenderFrameHostImpl.<init>(chromium-TrichromeWebViewGoogle.aab-stable-432415233:10)
at org.chromium.content.browser.framehost.RenderFrameHostImpl.create(chromium-TrichromeWebViewGoogle.aab-stable-432415233:1)
at J.N.MZAK3_Tx(Native Method)
...
The way I instantiate webview is :
@Composable
fun WebViewView(html: String, ...) {
AndroidView({ context ->
val webView = WebView(context)
// configure webview
webview
})
}
This have been happening in all compose versions I have tried. I have not found any similar problem in the bug tracker.
Am I doing something wrong? Should I report a bug?Kshitij Patil
02/16/2021, 4:26 PMRick Regan
02/16/2021, 5:47 PMSlider
. As far as I can tell, it's not possible to hoist the discrete slider state and have it control the slider, meaning the local continuous slider state is the actual source of truth (see code in thread -- you of course can't reset the slider from the callback). You need to maintain continuous slider state so that the slider moves smoothly -- instead of jumping -- between discrete values.
Obviously I could fix this by hoisting the continuous state, but then the slider is no longer conceptually discrete at that level; I'd have to move the "discreteness processing" up there. I don't think there's anything to be done about it; I guess I'm just saying that the discrete slider abstraction is "leaky".Yofou
02/16/2021, 5:49 PMKy
02/16/2021, 10:58 PMComponentActivity.setContent
after updating to alpha12?
on alpha11, something like this worked fine
someFrameLayout.setContent(Recomposer.current()) {
CommonMdcTheme {
SomeComposeView(viewModel)
}
}
After updating to alpha 12, it complains about receiver mismatch.
I’ve tried both deprecated method from androidx.compose.ui.platform.setContent
and new method androidx.activity.compose.setContent
Mehdi Haghgoo
02/17/2021, 9:14 AMMehdi Haghgoo
02/17/2021, 1:05 PMKshitij Patil
02/17/2021, 1:09 PMscrollState.smoothScrollBy()
(blocking) is deprecated, what are we supposed to replace it with (suspending) ? I didn’t understand the replacement from deprecated message. Who has smoothScrollBy
method apart from Scrollable?Ilias Zosimadis
02/17/2021, 1:55 PMSurface
? Should I use a custom shape with createOutline
or create a custom surface composable with Canvas
?Marko Novakovic
02/17/2021, 2:28 PMComposable
function as a reference?
posts.map(::PostCard)
for exampleDaniele B
02/17/2021, 2:42 PMD/InputDispatcher: Waiting to send key to Window{1bda786 u0 myapp.MainActivity} because there are unprocessed events that may cause focus to change
I am posting the code in a comment to this message.
Am I setting up the NavHost incorrectly? Is this warning meaningful or should I disregard it?
The app still works well.Kevin Aude
02/17/2021, 2:52 PMMehdi Haghgoo
02/17/2021, 5:08 PMrsktash
02/17/2021, 6:04 PMbohregard
02/17/2021, 7:14 PMitemsIndexed
in LazyColumn
when I clear the item list I have I get a java.lang.IndexOutOfBoundsException: index: 0, size: 0
. Is there a secret way to clear a list?aperfilyev
02/17/2021, 8:26 PMprivate val factory = InvalidatingPagingSourceFactory { FeedSource(pages.value, api) }
val items: Flow<PagingData<FeedItem>> = Pager(PagingConfig(20)) {
factory.invoke()
}.flow
composable
@Composable
fun FeedScreen(factory: ViewModelProvider.Factory, onItemClick: (Long) -> Unit) {
val viewModel = viewModel<MainViewModel>(factory = factory)
val items = viewModel.items.collectAsLazyPagingItems()
LazyColumn(content = {
items(items) { item ->
if (item != null) {
RealRowItem(item = item, onItemClick = onItemClick)
} else {
PlaceholderRowItem()
}
}
})
}
Lilly
02/17/2021, 8:28 PMcompose-router
which is relative outdated. It feels like in the long run there will be only navigation-compose
. I would be fine with switching to navigation-compose, but would like to hear some thoughts and feedbackTash
02/17/2021, 9:18 PMAnimatedFloatModel
s together and then listen for the end of the collective animation?
@Stable
class FooDragState {
val animatedOffsetX = AnimatedFloatModel(initialValue = 0f, clock)
val animatedOffsetY = AnimatedFloatModel(initialValue = 0f, clock)
(animatedOffsetX, animatedOffsetY).animateTo(1f, animationSpec, onEnd = { /** do something **/ })
}
radzio
02/17/2021, 9:27 PMTextField
focus inside scrollable Column
.
I don't know how to scroll Column
to the selected/focused TextField
I've creates stackoverflow question too: https://stackoverflow.com/questions/66249829/jetpack-compose-scroll-to-focused-composable-in-column
Can someone tell me what is the best approach for this?
I don't need/want use LazyColumn (not so many TextFields)rsktash
02/18/2021, 1:13 AMTlaster
02/18/2021, 3:09 AMjava.lang.RuntimeException: Parcel: unable to marshal value androidx.compose.runtime.SnapshotMutableStateImpl
error after alpha 12?Colton Idle
02/18/2021, 4:05 AMMehdi Haghgoo
02/18/2021, 7:44 AMMehdi Haghgoo
02/18/2021, 7:44 AMHalil Ozercan
02/18/2021, 8:07 AMDenis
02/18/2021, 10:01 AMkioba
02/18/2021, 10:30 AMstringResource
Denis
02/18/2021, 10:46 AMEach of my three projects built on Compose do not use the new Compose UI toolkit.
https://jakewharton.com/a-jetpack-compose-by-any-other-name/
jw
02/18/2021, 2:36 PMDenis
02/18/2021, 2:37 PMWhat you do with those objects is up to you and your imaginationYeah... That's exactly what I have problems with 😃
jw
02/18/2021, 2:38 PMinvert: Boolean
and ace the Google interviewDenis
02/18/2021, 2:42 PMjw
02/18/2021, 4:09 PMMehdi Haghgoo
02/18/2021, 6:22 PMjw
02/18/2021, 6:26 PM