TP-73396 | removing this.then from setWidth and setHeight to ensure n… (#503)
This commit is contained in:
committed by
GitHub
parent
0423b072aa
commit
a6722196e2
@@ -148,32 +148,28 @@ import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
|
||||
fun Modifier.setHeight(height: String?): Modifier =
|
||||
this.then(
|
||||
when (height) {
|
||||
ComposeSize.MATCH_PARENT.name -> fillMaxHeight()
|
||||
ComposeSize.WRAP_CONTENT.name -> wrapContentHeight()
|
||||
ComposeSize.FILL_TO_CONSTRAINTS.name -> this
|
||||
ComposeSize.INTRINSIC_MIN.name -> height(IntrinsicSize.Min)
|
||||
ComposeSize.INTRINSIC_MAX.name -> height(IntrinsicSize.Max)
|
||||
else -> {
|
||||
height?.toIntOrNull()?.let { height(it.dp) } ?: kotlin.run { wrapContentHeight() }
|
||||
}
|
||||
when (height) {
|
||||
ComposeSize.MATCH_PARENT.name -> fillMaxHeight()
|
||||
ComposeSize.WRAP_CONTENT.name -> wrapContentHeight()
|
||||
ComposeSize.FILL_TO_CONSTRAINTS.name -> this
|
||||
ComposeSize.INTRINSIC_MIN.name -> height(IntrinsicSize.Min)
|
||||
ComposeSize.INTRINSIC_MAX.name -> height(IntrinsicSize.Max)
|
||||
else -> {
|
||||
height?.toIntOrNull()?.let { height(it.dp) } ?: kotlin.run { wrapContentHeight() }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun Modifier.setWidth(width: String?): Modifier =
|
||||
this.then(
|
||||
when (width) {
|
||||
ComposeSize.MATCH_PARENT.name -> fillMaxWidth()
|
||||
ComposeSize.WRAP_CONTENT.name -> wrapContentWidth()
|
||||
ComposeSize.FILL_TO_CONSTRAINTS.name -> this
|
||||
ComposeSize.INTRINSIC_MIN.name -> width(IntrinsicSize.Min)
|
||||
ComposeSize.INTRINSIC_MAX.name -> width(IntrinsicSize.Max)
|
||||
else -> {
|
||||
width?.toIntOrNull()?.let { width(it.dp) } ?: kotlin.run { wrapContentWidth() }
|
||||
}
|
||||
when (width) {
|
||||
ComposeSize.MATCH_PARENT.name -> fillMaxWidth()
|
||||
ComposeSize.WRAP_CONTENT.name -> wrapContentWidth()
|
||||
ComposeSize.FILL_TO_CONSTRAINTS.name -> this
|
||||
ComposeSize.INTRINSIC_MIN.name -> width(IntrinsicSize.Min)
|
||||
ComposeSize.INTRINSIC_MAX.name -> width(IntrinsicSize.Max)
|
||||
else -> {
|
||||
width?.toIntOrNull()?.let { width(it.dp) } ?: kotlin.run { wrapContentWidth() }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun Modifier.setVerticalScroll(scrollData: ScrollData?): Modifier = composed {
|
||||
if (scrollData?.enabled == true) {
|
||||
|
||||
Reference in New Issue
Block a user