amar_1995
12/23/2019, 12:27 PM+state
and passing into ModelDrawerLayout
as drawerContent.
ERR: stack=java.lang.IllegalStateException: Expected a group start
But when i am not using +state
then there will be no issue.Bryan Lee
12/23/2019, 10:56 PMcodeslubber
12/23/2019, 11:34 PMcodeslubber
12/24/2019, 3:06 AMimplementation("androidx.ui:ui-foundation:0.1.0-dev03")
has to be added to the gradle app file for the image stuff to work..david.bilik
12/24/2019, 8:47 AM@Composable
fun PostCardSimple(post: Post) {
Ripple(bounded = true) {
Clickable(onClick = {
navigateTo(Screen.Article(post.id))
}) {
Row(modifier = Spacing(16.dp)) {
PostImage(modifier = Spacing(right = 16.dp), post = post)
Column(modifier = Flexible(1f)) {
PostTitle(post)
AuthorAndReadTime(post)
}
BookmarkButton(
isBookmarked = isFavorite(postId = post.id),
onBookmark = { toggleBookmark(postId = post.id) }
)
}
}
}
}
and the padding is controled via Spacing
modifier of the Row
. Is it possible that both Ripple
and Clickable
react only for inner elements and ignores padding around them?aoriani
12/24/2019, 9:14 AM@Composable
fun PostCardSimple(post: Post) {
Ripple(bounded = true) {
Clickable(onClick = {
navigateTo(Screen.Article(post.id))
}) {
Container(modifier = ExpandedWidth) {
Row(modifier = Spacing(16.dp)) {
PostImage(modifier = Spacing(right = 16.dp), post = post)
Column(modifier = Flexible(1f)) {
PostTitle(post)
AuthorAndReadTime(post)
}
BookmarkButton(
isBookmarked = isFavorite(postId = post.id),
onBookmark = { toggleBookmark(postId = post.id) }
)
}
}
}
}
}
dimsuz
12/24/2019, 1:28 PMI wonder why Compose continued with "clicks"? Wouldnt "onTap" be more correct in the mobile world? I don't click on anything in my phone 🙂Clickable(onClick =
codeslubber
12/24/2019, 9:57 PMColumn {
Container(width = 180.dp, height = 180.dp){
Clip(shape = RoundedCornerShape(90.dp)) {
DrawImage(image = image)
}
}
Container has width and height. :)Kstabks
12/25/2019, 10:06 AMamar_1995
12/25/2019, 1:10 PMManuel Wrage
12/25/2019, 1:35 PMBryan Lee
12/26/2019, 4:24 PMBryan Lee
12/26/2019, 7:10 PMshikasd
12/27/2019, 12:35 AMplatform/frameworks/support/settings.gradle
.
Do you set it up differently somehow?amar_1995
12/27/2019, 7:38 AMonActive
onCommit
onDispose
.
I read the sample provided by google, yet not able to figure out how to use it in activity lifecycle.
Can anyone explain with proper example how to use dispose with onActive and onCommit.Nikit Bhandari
12/28/2019, 8:24 PMDmitri Sh
12/29/2019, 1:38 AMbkenn
12/29/2019, 4:16 AMGlobalScope.launch(Dispatchers.Main) {
// replace delay with some kind of animation on ui elements
delay(2000)
navigateTo(Screen.Question)
}
aoriani
12/29/2019, 8:37 PMVectorImage
from the JetNews app by setting the Size
modifier of the Container
to the size I want, and passing fit = ScaleFit.FillMinDimension
to the DrawVector
call. Bu that is not working. It seems that the vector is being resized, however it is clipped to its intrinsic or viewport size.Kashif
12/31/2019, 8:02 AMamar_1995
12/31/2019, 10:03 AM@Composable() () -> Unit
and () -> Unit
function signature.
I am using AlertDialog
and in documenation (https://developer.android.com/reference/kotlin/androidx/ui/material/package-summary#alertdialog) the function signature is different then in code.
In documentation it is:
@Composable fun AlertDialog(
onCloseRequest: () -> Unit,
title: () -> Unit = null,
text: () -> Unit,
confirmButton: () -> Unit,
dismissButton: () -> Unit = null,
buttonLayout: AlertDialogButtonLayout = AlertDialogButtonLayout.SideBySide): Unit
In dev3 code it is:
@Composable
fun AlertDialog(
onCloseRequest: () -> Unit,
title: @Composable() (() -> Unit)? = null,
text: @Composable() () -> Unit,
confirmButton: @Composable() () -> Unit,
dismissButton: @Composable() (() -> Unit)? = null,
buttonLayout: AlertDialogButtonLayout = AlertDialogButtonLayout.SideBySide
) : Unit
Ian Warwick
12/31/2019, 11:21 AMRouter
pattern for a single activity approach using compose where you can specify URI routings to compositions - you can do something like this in your single activity
class MainActivity : AppCompatActivity() {
private val router = Router(this) {
schemes("https", "http")
hosts("<http://memset.com|memset.com>", "<http://www.memset.com|www.memset.com>")
"/" composeWith { HomeScreenComposer() }
"/cardeditor" composeWith { CardEditorScreenComposer(model(CardEditorViewModel::class)) }
".*" composeTo { Text("404 Not Found") }
}.startAt("<https://memset.com/>")
}
Then later in your composition you can get at the router using an ambient
val router = +ambient(ActiveRouter)
And navigate to another composition
router.goto("<http://memset.com/anywhere>")
The problem is that if I get at the ambient inside an onClick
listener since the listener is not @Composable() () -> Unit
I get an error composition requires an active composition context
Declaring the ambient ref outside the click listener works fine, before I was passing around router: Router
to functions though learned about Ambient and thought why not try 😆 seems quite cool is it the right way to go for this sort of thing? apologies if the question is not relevant here, full source here:- https://github.com/fluxtah/memsetPedro Veloso
12/31/2019, 4:09 PMBryan Lee
12/31/2019, 9:51 PMBryan Lee
12/31/2019, 11:38 PMKashif
01/01/2020, 8:34 AMIan Warwick
01/02/2020, 9:29 AMZsolt
01/03/2020, 1:22 AMcodeslubber
01/03/2020, 1:50 AMDatePicker
with Compose yet? trying to invoke it as a dialog.. the playground doesn’t have an example.. are examples of doing AlertDialog
of courseamar_1995
01/03/2020, 10:52 AMColumn(
crossAxisSize = LayoutSize.Expand,
mainAxisSize = LayoutSize.Expand) { ... }
Using this, I am trying to show hidden data after onClick occur. But it is not working dev3. In dev3, as onClick occur hidden data overlap with the next Column data.
How to achieve this in dev3