Piotr
01/08/2021, 1:31 PMLuke
01/08/2021, 10:02 PMComposableNaming
warning context window resolution? When I do it, the function name is capitalized properly, but it's usages are unchanged, causing compilation error. Shouldn't it do a proper function rename including references?Bradleycorn
01/09/2021, 4:42 PMWebView
(in an AndroidView
) causing other Composables around the AndroidView
to not get rendered? Defect filed here https://issuetracker.google.com/issues/174233728 , but I'm curious if anyone has run into this and found a workaround (also, if you want to star that issue while you're there, that'd be great 🙂 )dagomni
01/13/2021, 7:38 PMSimon Sickle
01/14/2021, 9:41 PMval contentView = ComposeView(context = context).apply {
setContent {
... composable ...
}
createComposition() // since no window is bound
}
val generator = IconGenerator(context).apply {
setContentView(contentView)
}
val bitmap = generator.makeIcon()
If you debug the bitmap, you get a tiny (wrong size) drawing of the box’s shape, but not the entire rendered version of the shape.
The generator is simple, and basically calls
composeView.measure()
composeView.layout()
composeView.draw(canvas)
canvas.toBitmap()
Does anyone have ideas of what might cause compose view to skip rendering? Or where to look to more deeply understand how compose is working behind the scenes?aiidziis
01/15/2021, 11:21 AMAndroidView
support on lower level API like 24 planned before hitting beta?melatonina
01/15/2021, 8:49 PMAlexjlockwood
01/16/2021, 4:36 AMvipulasri
01/18/2021, 2:08 AMPiotr
01/18/2021, 2:14 PMVitor Prado
01/18/2021, 9:35 PMcontentAlpha
) but I want to describe 2 colors for diff emphasis not alpha.. how to achieve it?Mia Clapham
01/18/2021, 10:07 PMKyant
01/19/2021, 12:05 AMlinkTo().
For example, a card will be animated to the center of the screen by pressing a button.Rick Regan
01/19/2021, 2:10 PMsteps
parameter is not defined in the way I would expect. If I want a discrete slider to range from 0 to 12 in increments of 1, I would expect to specify steps = 12; however, I must specify steps = 11. Similarly, increments of 2 requires steps = 5 (not 6); increments of 3 requires steps = 3 (not 4); increments of 4 requires steps = 2 (not 3). The formula appears to be steps = (end - start)/increment - 1 when I would expect steps = (end - start)/increment.
What is the rationale for the way it is defined?
@Composable
fun DiscreteSliderTest() {
Column {
val sliderValue = remember { mutableStateOf(5f) }
Slider(
value = sliderValue.value,
onValueChange = { sliderValue.value = it },
modifier = Modifier.width(400.dp) .fillMaxWidth(),
valueRange = 0f..12f,
steps = 3,
)
Text(
text = sliderValue.value.toString(),
)
}
}
By the way, in the code example, the slider starts out with value 5, even though it is between quantized values 3 and 6 (if you move the slider you will never get it back to 5). That does not seem to be the desired behavior.Daniel
01/20/2021, 6:57 AMAhmet Delibaş
01/20/2021, 7:15 AMfun bindPreview(
lifecycleOwner: LifecycleOwner,
previewView: PreviewView,
cameraProvider: ProcessCameraProvider,
currentCam: Int,
) {
val metrics = DisplayMetrics().also { previewView.display.getRealMetrics(it) }
val screenAspectRatio = aspectRatio(metrics.widthPixels, metrics.heightPixels)
val rotation = previewView.display.rotation
val builder = Preview.Builder()
.setTargetAspectRatio(screenAspectRatio)
.setTargetRotation(rotation)
val preview: Preview = builder
.build().also {
it.setSurfaceProvider(previewView.surfaceProvider)
}
val lensFacing = CameraSelector.LENS_FACING_FRONT
val cameraSelector: CameraSelector = CameraSelector.Builder().requireLensFacing(lensFacing).build()
val beautyPreviewExtender = BeautyPreviewExtender.create(builder)
if(beautyPreviewExtender.isExtensionAvailable(cameraSelector)) {
beautyPreviewExtender.enableExtension(cameraSelector)
}
try {
cameraProvider.unbindAll()
val camera = cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector, preview)
} catch (exception: Exception) {
Log.e(TAG, "Use case binding failed.", exception)
}
}
bindPreview is called by "AndroidView" in a Composable method. Camera works perfect, but beauty mode is not working. Does anybody know about it ?Adam Powell
01/20/2021, 8:28 PMFudge
01/21/2021, 12:32 PMKshitij Patil
01/21/2021, 12:48 PMalpha09
and the insets are getting applied on the second time. Are there any more details you want me to share? I’ve tried to use ViewWindowInsetObserver
but nothing changed. Any help would be much appreciated !Nat Strangerweather
01/22/2021, 2:02 PM@Composable
fun LongPressButton() {
val onLongPress = { _: Offset -> println("YAY!") }
Button(
modifier = Modifier.longPressGestureFilter ( onLongPress ),
onClick = { /* Do something! */ }, colors = ButtonDefaults.buttonColors(
backgroundColor = Color.Red
)
) {
Text("Button")
}
}
julioromano
01/22/2021, 4:56 PMLong
). It should look as simple as possible (no frills). Currently I’m trying with `BasicTextField`: is there anything else I may give a shot at?Yashar
01/23/2021, 2:26 AMCarson Holzheimer
01/23/2021, 5:18 AMKshitij Patil
01/23/2021, 1:50 PMTextField
pre-focused when a Composable is rendered, is this not recommended as per the best practices?Mehdi Haghgoo
01/23/2021, 7:43 PMDenis
01/23/2021, 7:54 PMModifier.onKeyEvent
(it doesn't seem to work in my code)? Or is the Activity.dispatchKeyEvent
method a way to go?Lilly
01/24/2021, 3:59 AMaherbel
01/24/2021, 10:33 PMjim
01/27/2021, 4:47 AMjim
01/27/2021, 4:55 AM