Andy Himberger
03/28/2022, 3:46 PMReusableContent(component) {
AndroidView(factory = {
createView(it, component)
}, Modifier.fillMaxSize(), { })
}
I tried some other things like recomposer.invalidate when the component changed, creating different factory function instances that differed slightly, but that didn't change anything... I was really expecting when the args to AndroidView changed, it would create a new view underneath and clean up the old one. Maybe I'm missing somethingCreep Toe
03/29/2022, 7:23 AMSurface(modifier = Modifier.fillMaxSize()) {
Button(onClick = {}) {}
}
Filip Wiesner
03/29/2022, 7:24 AMKshitij Patil
03/29/2022, 10:32 AMColton Idle
03/29/2022, 10:41 AMFilip Wiesner
03/29/2022, 12:39 PM1.2.0-alpha06
the IME is not hidden when focused element exits composition? 🙏 I've been jumping back and forth from alpha05
and 06
and now I am not sure if what I'm seeing is really a bug.mattinger
03/29/2022, 5:23 PMmyanmarking
03/29/2022, 5:41 PMposition = CameraPosition.fromLatLngZoom
, which internally do CameraUpdateFactory.newCameraPosition(value)
but i would like to use CameraUpdateFactory.newLatLngBounds
Chris Johnson
03/29/2022, 7:26 PMLazyVerticalGrid
or LazyHorizontalGrid
in 1.2.0-alpha05. It seems like your content's size is determined by the columns/rows, horizontal/vertical arrangement/alignment, and contentPadding. Is there no way to custom it and say I want every item in my LazyVerticalGrid to be 40x80dp?allan.conda
03/29/2022, 7:57 PMgeorgiy.shur
03/29/2022, 10:30 PMLazyListScope
there is a stickyHeader { }
function. I’d like to achieve the same behavior, but for sticky footer: the item should stick to the bottom until the user scrolls to it, and after the user scrolls further down, the item has to scroll normally together with the content. Is there some smart way to achieve this behavior?Dazai
03/30/2022, 7:13 AMAlexandru Hadăr
03/30/2022, 10:25 AMAnimatedVisibility
, the animation seems a bit staggering/sluggish. After I’ve played a coupled of times with it, it moves smoothly.
I tend to believe this is due to some kind of lazy initialization? Or what could be the case and what could be the solution?
I’m using compose version 1.1.1
🧵Maciej Czekański
03/30/2022, 1:43 PMThe following classes could not be instantiated:
- androidx.compose.ui.tooling.ComposeViewAdapter (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE. If this is an unexpected error you can also try to build the project, then manually refresh the layout. Exception Details java.lang.ClassNotFoundException: androidx.customview.poolingcontainer.R$id
It happened to me after updating compose to 1.2.0-alpha06
. It doesn't work both on Chipmunk and DolphinTrym Nilsen
03/30/2022, 2:00 PMLauren Yew
03/30/2022, 4:27 PM@Composable
interface methods getting AbstractMethodError
issues?
I have a simple interface that I'm using with Hilt to pass Compose Theme components back to a library.
import androidx.compose.material.Colors
import androidx.compose.runtime.Composable
interface DevSettingsMaterialTheme {
@Composable
fun devSettingsLightColors(): Colors?
...
}
class SampleDevSettingsMaterialTheme : DevSettingsMaterialTheme {
@Composable
override fun devSettingsLightColors(): Colors? = null // crashes w AbstractMethod
...
}
The library itself was able to implement the interface no problem, and I have tested with one app and it works fine, but another sample app where I'm using the same library (same gradle plugin version 7.1.0 + kotlin version 1.6.10, Java version 11, compose version 1.1.1), when I run the app and try to use the library feature, I get the error
java.lang.AbstractMethodError: abstract method "androidx.compose.material.Colors com...android.devsettings.di.DevSettingsMaterialTheme.devSettingsLightColors(androidx.compose.runtime.Composer, int)"
.
Any ideas on how I can work around this? Thanks!theapache64
03/30/2022, 5:57 PMlayoutCoordinates.positionInRoot()
. This is only happening in release build.
Fatal Exception: java.lang.IllegalStateException
LayoutCoordinate operations are only valid when isAttached is true
Afzal Najam
03/30/2022, 6:11 PMscrollable
, verticalScroll
, and horizontalScroll
modifiers also have a contentPadding
argument like the Lazy layouts do? Otherwise their children get clipped at the beginning and end if they’re animated to scale even a little bit.Colton Idle
03/30/2022, 6:41 PMinit { myMutableState.collect { refresh() } }
ursus
03/30/2022, 11:15 PMK Merle
03/31/2022, 4:34 AMShivam Dhuria
03/31/2022, 6:05 AMmyanmarking
03/31/2022, 8:54 AMsnapshot(@NonNull GoogleMap.SnapshotReadyCallback callback) ?
Orhan Tozan
03/31/2022, 10:20 AMMikołaj Kąkol
03/31/2022, 11:54 AM/**
* Called when a context menu option for the text view is selected. Currently
* this will be one of {@link android.R.id#selectAll}, {@link android.R.id#cut},
* {@link android.R.id#copy}, {@link android.R.id#paste} or {@link android.R.id#shareText}.
*
* @return true if the context menu item action was performed.
*/
public boolean onTextContextMenuItem(int id) {
Mykola
03/31/2022, 1:36 PMYacov Rosenberg
03/31/2022, 1:41 PMMikael Ohlson
03/31/2022, 2:48 PMrememberAnimatedVectorPainter
with an animated vector drawable from a resource, when the drawable contains a "translateXY" property (as seen in some AOSP classes). As far as I can tell, any animated vector drawable containing the object animator below will cause a crash. Is this a known issue, am I just being silly and doing something dumb, or should I report it?
<objectAnimator xmlns:android="<http://schemas.android.com/apk/res/android>"
xmlns:aapt="<http://schemas.android.com/aapt>"
android:propertyName="translateXY"
android:duration="500"
android:startOffset="0"
android:propertyXName="translateX"
android:propertyYName="translateY"
android:pathData="M 12.138,24C -1.1690000000000005,24 17.919,24 12.138,24">
<aapt:attr name="android:interpolator">
<pathInterpolator android:pathData="M 0.0,0.0 c0.333,0.168 0.667,1 1.0,1.0" />
</aapt:attr>
</objectAnimator>
And it is being referenced like this
@OptIn(ExperimentalAnimationGraphicsApi::class)
@Composable
fun BadgeIconImage() {
val image = AnimatedImageVector.animatedVectorResource(R.drawable.triangle_animated_vector)
var atEnd by remember { mutableStateOf(false) }
Image(
painter = rememberAnimatedVectorPainter(image, atEnd),
contentDescription = "Your content description",
modifier = Modifier.size(64.dp).clickable {
atEnd = !atEnd
}
)
}
where the triangle_animated_vector just uses the above object animator on a simple triangle.
I'm on version 1.1.1 of compose.Pardip
03/31/2022, 2:49 PMandrew
03/31/2022, 3:06 PMpointerInteropFilter
on the knob views in conjunction with pointerInput
on a Canvas
view underneath. Multitouch breaks with a NPE. I have a small sample pasted below the stack trace, and some context explaining why I need to do things this wayandrew
03/31/2022, 3:06 PMpointerInteropFilter
on the knob views in conjunction with pointerInput
on a Canvas
view underneath. Multitouch breaks with a NPE. I have a small sample pasted below the stack trace, and some context explaining why I need to do things this way2022-03-31 11:07:30.166 15447-15447/com.stratisiot.mobile E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.stratisiot.mobile, PID: 15447
java.lang.NullPointerException
at androidx.compose.foundation.gestures.DragGestureDetectorKt.awaitDragOrCancellation-rnUCldI(DragGestureDetector.kt:844)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$awaitDragOrCancellation$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:509)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:404)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:417)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:310)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:179)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:98)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:80)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1223)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1173)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1112)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:498)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
at android.app.Activity.dispatchTouchEvent(Activity.java:4202)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:456)
at android.view.View.dispatchPointerEvent(View.java:14858)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6446)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6247)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5725)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5913)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5970)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
2022-03-31 11:07:30.167 15447-15447/com.stratisiot.mobile E/AndroidRuntime: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8696)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8647)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8616)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8819)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:239)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:8776)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:8905)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1037)
at android.view.Choreographer.doCallbacks(Choreographer.java:845)
at android.view.Choreographer.doFrame(Choreographer.java:772)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
@Composable
fun Reproduction(modifier: Modifier = Modifier) {
BoxWithConstraints(modifier) {
Canvas(Modifier.fillMaxSize().pointerInput(Unit) {
detectDragGestures(
onDrag = { _, dragAmount -> println(dragAmount) }
)
}) {
drawCircle(Color.Red, size.width / 3)
}
Box(Modifier.size(48.dp).background(Color.Yellow).pointerInteropFilter { event ->
when (event.action) {
MotionEvent.ACTION_DOWN -> { println("DOWN") }
}
false
})
}
}
@Composable
@Preview
private fun Reproduction_Preview() {
Reproduction(Modifier.padding(48.dp).aspectRatio(1F))
}
jossiwolf
04/01/2022, 9:37 AMandrew
04/01/2022, 9:30 PMjossiwolf
04/12/2022, 11:28 AMandrew
04/12/2022, 1:30 PM