Marko Novakovic
06/24/2021, 4:39 PMIntent
, how do I do it in Compose?Sergey Y.
06/24/2021, 8:10 PMaoriani
06/24/2021, 9:44 PMandroid:ems
?YASAN
06/24/2021, 11:26 PMDialog
, the phone's navigation bar buttons are still usable even though they are dimmed & they do not cause the Dialog
to be dismissed automatically even though dismissOnClickOutside
is set to true
.
Is this a bug or I am supposed to enable a specific behavior for it myself?Berkeli Alashov
06/25/2021, 12:17 AM.copy()
in `remember { colors.copy() }`:
@Composable
fun ProvideAppColors(
colors: AppColors,
content: @Composable () -> Unit
) {
val appColors = remember { colors.copy() }.apply { update(colors) }
CompositionLocalProvider(
LocalAppColors provides appColors,
content = content)
}
Without .copy()
, it only works for the first change in state.
Full code: https://gist.github.com/alashow/e67a75d662a13ce5529317bde3e241c2eneim
06/25/2021, 1:04 AMunregisterComposition
is called twice in this screenshot (hope it is clear enough where it can be found. This is 1.0.0-beta09 by the way).Tolriq
06/25/2021, 6:12 AMIoane Sharvadze
06/25/2021, 8:52 AMCan't represent a size of 1168750 in Constraints
Error log when running this code
@Composable
fun Calendar() {
Surface {
Box(
modifier = Modifier
.padding(10.dp)
.size(200.dp)
.horizontalScroll(rememberScrollState())
) {
CalendarBox()
}
}
}
@Composable
fun CalendarBox() {
Box(modifier = Modifier.width(500_000.dp)) {
Text(text = "Event 1", modifier = Modifier.offset(x = 50.dp))
Text(text = "Event 2", modifier = Modifier.offset(x = 499_950.dp))
}
}
@Preview
@Composable
fun CalendarPreview() {
Calendar()
}
Basically, I want to write the widget that is very very wide. (Like calendar).
I had similar code running in View-based-approach
and it worked well.
Now I want to translate that into compose based solution And I'm stuck with this issue.
If this is framework limitation, is there any suggested approach how can I overcome this? 🤔Luis Mierez
06/25/2021, 2:04 PMnatario1
06/25/2021, 3:50 PMnavigationBarsPadding()
modifier to different composables, but then one of them needs to also have the ime padding. And as docs say, calling navigationBarsPadding().imePadding()
is not equal to navigationBarsWithImePadding()
.
Basically asking for an imePadding
which is additive WRT navigationBarsPadding
. Any hints on how to compute it?raenardev
06/25/2021, 4:08 PMProvideWindowInsets
has a certain delay, when used in fragment-based screens, which causes noticeable jumps with status bars.
Are there any updates on that? (also bot closed the issue)
https://github.com/google/accompanist/issues/155Tolriq
06/25/2021, 4:32 PMCicero
06/25/2021, 4:55 PMRyan Simon
06/25/2021, 6:15 PMBrian G
06/25/2021, 8:36 PMBox(Modifier.offset(x=x, y=y)) { Content() }
but update x and y very frequently, while the contents of the box never changes. Right now I see the content get recomposed often, any way to avoid that? Is that in "future optimization" territory?eneim
06/26/2021, 7:37 AMPrashast Rastogi
06/26/2021, 1:09 PMclickable
method in compose view
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
kotlin version : '1.4.32'
compose version : '1.0.0-beta09'
Let me know if anyone has any clue how to resolve this.
cc @Ian LakeColton Idle
06/26/2021, 6:52 PMMohamed Ibrahim
06/26/2021, 8:00 PMgitai
06/26/2021, 10:10 PMSnapshot.takeMutableSnapshot()
, when inside a readObserver
callback, how do you subscribe a composable to reads of the supplied state instance?Tash
06/26/2021, 10:30 PMYasutaka Kawamoto
06/27/2021, 4:10 AMdrawRect
in Canvas?
Canvas(modifier = Modifier.fillMaxSize()) {
list?.forEach { item ->
val bounds = item.bounds // Rect
// I want to click this
drawRect(
color = Color.Blue,
topLeft = Offset(x = bounds.left, y = <http://bounds.top|bounds.top>),
size = Size(bounds.width(), bounds.height()),
)
}
}
Kaustubh Patange
06/27/2021, 6:34 AMremember
the value produced by a @Composable
function that does not have a Unit
return type?rajesh
06/27/2021, 8:57 AMstack
(for overlapping ui) removed from compose 1.0.0-beta09? If so, what should I use instead?ms
06/27/2021, 9:22 AMjava.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:220)
at s8.e.F(:1)
at n8.h.a(:6)
at n8.h.b(:12)
at n8.h.e(Unknown Source:100)
at n8.h$f.j(Unknown Source:11)
at o9.a.w(:2)
at ea.j0.run(Unknown Source:86)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
timrijckaert
06/27/2021, 11:31 AMRow
with some weighted `Text`'s inside, however how can I make the Row
clip the Text
?
Do I need a fixed width - height for the Row
and calculate the TextStyle
fontSize manually or is there a better alternative?
@Composable
fun Eclipse() {
Row(
modifier = Modifier
.height(IntrinsicSize.Min)
.width(IntrinsicSize.Min)
.background(Color.Black)
) {
EclipseIntTile(0, modifier = Modifier.weight(1F))
EclipseIntTile(4, modifier = Modifier.weight(1F))
EclipseIntTile(5, modifier = Modifier.weight(1F))
EclipseIntTile(2, modifier = Modifier.weight(1F))
}
}
@Composable
fun EclipseIntTile(i: Int, modifier: Modifier = Modifier) {
Text("$i", modifier = modifier, style = TextStyle(fontSize = 140.sp, color = Color.White))
}
Any pointers?
ThanksShabinder Singh
06/27/2021, 2:05 PMbrandonmcansh
06/27/2021, 4:52 PMjw
06/27/2021, 4:52 PMMohamed Ibrahim
06/27/2021, 5:24 PMsystemUiController.isNavigationBarVisible = false
systemUiController.isSystemBarsVisible = false
I’m using those functions to make my app full screen, when touching my app navigation bar is appearing again. what I want to achieve is to develop a blocker app so user can’t access system buttons, is that possible?Mohamed Ibrahim
06/27/2021, 5:24 PMsystemUiController.isNavigationBarVisible = false
systemUiController.isSystemBarsVisible = false
I’m using those functions to make my app full screen, when touching my app navigation bar is appearing again. what I want to achieve is to develop a blocker app so user can’t access system buttons, is that possible?Alejo
06/27/2021, 6:47 PMActivity.startLockTask()
? Here the docs https://developer.android.com/work/dpc/dedicated-devices/lock-task-modeColton Idle
06/27/2021, 7:05 PMtad
06/28/2021, 1:31 AMMohamed Ibrahim
07/01/2021, 4:14 PM