amar_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 dev3matvei
01/03/2020, 12:20 PMamar_1995
01/03/2020, 12:26 PMval open by +state {false}
Padding(10.dp) {
Clickable({
open = !open
}) {
Column(
// crossAxisSize = LayoutSize.Expand
// modifier = LayoutSize.Expand,
modifier = ExpandedWidth
) {
Row(
// crossAxisSize = LayoutSize.Wrap,
// mainAxisSize = LayoutSize.Expand
arrangement = Arrangement.SpaceEvenly
) {
Column(modifier = Flexible(1f)) {
Text(..)
if(!open)
Text(....)
}
WidthSpacer(width = 10.dp)
Column(
// crossAxisAlignment = CrossAxisAlignment.Center,
// mainAxisAlignment = MainAxisAlignment.Center
arrangement = Arrangement.Center
) {
Container(
width = 20.dp,
height = 20.dp,
alignment = Alignment.BottomCenter
) {
DrawImage(+imageResource(R.drawable.navigate_next), Color.Black)
}
}
}
if(open) {
Padding(padding = 10.dp) {
var value by +state { "Text" }
FlexColumn() {
expanded(1f) {
Column {
FlexRow() {
expanded(1f) {
Text("")
}
inflexible {
Button(
text = "...",
style = OutlinedButtonStyle(
shape = RoundedCornerShape(5.dp),
contentColor = (+MaterialTheme.colors()).primary,
border = Border(
color = Color.Black,
width = 1.dp
)
),
onClick = {
...
}
)
}
}
ShowString(text)
}
}
}
}
}
}
}
}
matvei
01/03/2020, 12:47 PMexpanded {}
DSL with, IIUC, intention to expand to the whole screen, but this won't work, there's a modifier ExpandedHeight/ExpandedWidth for it.
My recommendation will be to use one appraoch and move away from FlexColumn/FlexRow complitely, as well as Padding composables and try again.amar_1995
01/03/2020, 12:49 PMmatvei
01/03/2020, 2:27 PMcodeslubber
01/03/2020, 3:47 PMamar_1995
01/03/2020, 3:52 PMvar open by +state { false }
Padding(10.dp) {
Clickable({
open = !open
}) {
Column(
modifier = ExpandedHeight
) {
Row{
Column(modifier = Flexible(1f)) {
Text(...)
if(!open)
Text(...)
}
WidthSpacer(width = 10.dp)
Container(
width = 20.dp,
height = 20.dp,
alignment = Alignment.BottomCenter
) {
DrawImage(+imageResource(R.drawable.navigate_next), Color.Black)
}
}
if(open) {
Padding(padding = 10.dp) {
var value by +state { "Text" }
Column() {
Row() {
Column(Flexible(1f)) {}
Button(
text = "...",
style = OutlinedButtonStyle(
shape = RoundedCornerShape(5.dp),
contentColor = (+MaterialTheme.colors()).primary,
border = Border(
color = Color.Black,
width = 1.dp
)
),
onClick = {...}
)
}
ShowString(value)
}
}
}
}
}
}
codeslubber
01/03/2020, 4:09 PMmatvei
01/03/2020, 5:06 PMcodeslubber
01/03/2020, 5:09 PMDmitri Sh
01/03/2020, 8:03 PMmatvei
01/06/2020, 11:42 AMFlexible
modifier to children you want to make flexibleDmitri Sh
01/06/2020, 6:31 PMmatvei
01/06/2020, 6:40 PMDmitri Sh
01/06/2020, 7:03 PM