fun updateByVisual()

in GaiaXAndroid/src/main/kotlin/com/alibaba/gaiax/template/GXFlexBox.kt [262:420]


    fun updateByVisual(visual: GXFlexBox) {
        visual.display?.let {
            displayForExtend = it
        }
        visual.positionType?.let {
            positionTypeForExtend = it
        }
        visual.direction?.let {
            directionForExtend = it
        }
        visual.flexDirection?.let {
            flexDirectionForExtend = it
        }
        visual.flexWrap?.let {
            flexWrapForExtend = it
        }
        visual.overflow?.let {
            overflowForExtend = it
        }
        visual.alignItems?.let {
            alignItemsForExtend = it
        }
        visual.alignSelf?.let {
            alignSelfForExtend = it
        }
        visual.alignContent?.let {
            alignContentForExtend = it
        }
        visual.justifyContent?.let {
            justifyContentForExtend = it
        }
        visual.flexGrow?.let {
            flexGrowForExtend = it
        }
        visual.flexShrink?.let {
            flexShrinkForExtend = it
        }
        visual.flexBasis?.let {
            flexBasisForExtend = it
        }
        visual.aspectRatio?.let {
            aspectRatioForExtend = it
        }
        visual.position?.let {
            if (positionForExtend != null) {
                if (it.start != null) {
                    positionForExtend?.start = it.start
                }
                if (it.end != null) {
                    positionForExtend?.end = it.end
                }
                if (it.top != null) {
                    positionForExtend?.top = it.top
                }
                if (it.bottom != null) {
                    positionForExtend?.bottom = it.bottom
                }
            } else {
                positionForExtend = it
            }
            positionForFinal = null
        }
        visual.margin?.let {
            if (marginForExtend != null) {
                if (it.start != null) {
                    marginForExtend?.start = it.start
                }
                if (it.end != null) {
                    marginForExtend?.end = it.end
                }
                if (it.top != null) {
                    marginForExtend?.top = it.top
                }
                if (it.bottom != null) {
                    marginForExtend?.bottom = it.bottom
                }
            } else {
                marginForExtend = it
            }
            marginForFinal = null
        }
        visual.padding?.let {
            if (paddingForExtend != null) {
                if (it.start != null) {
                    paddingForExtend?.start = it.start
                }
                if (it.end != null) {
                    paddingForExtend?.end = it.end
                }
                if (it.top != null) {
                    paddingForExtend?.top = it.top
                }
                if (it.bottom != null) {
                    paddingForExtend?.bottom = it.bottom
                }
            } else {
                paddingForExtend = it
            }
            paddingForFinal = null
        }
        visual.border?.let {
            if (borderForExtend != null) {
                if (it.start != null) {
                    borderForExtend?.start = it.start
                }
                if (it.end != null) {
                    borderForExtend?.end = it.end
                }
                if (it.top != null) {
                    borderForExtend?.top = it.top
                }
                if (it.bottom != null) {
                    borderForExtend?.bottom = it.bottom
                }
            } else {
                borderForExtend = it
            }
            borderForFinal = null
        }
        visual.size?.let {
            if (sizeForExtend != null) {
                if (it.width != null) {
                    sizeForExtend?.width = it.width
                }
                if (it.height != null) {
                    sizeForExtend?.height = it.height
                }
            } else {
                sizeForExtend = it
            }
            sizeForFinal = null
        }
        visual.minSize?.let {
            if (minSizeForExtend != null) {
                if (it.width != null) {
                    minSizeForExtend?.width = it.width
                }
                if (it.height != null) {
                    minSizeForExtend?.height = it.height
                }
            } else {
                minSizeForExtend = it
            }
            minSizeForFinal = null
        }
        visual.maxSize?.let {
            if (maxSizeForExtend != null) {
                if (it.width != null) {
                    maxSizeForExtend?.width = it.width
                }
                if (it.height != null) {
                    maxSizeForExtend?.height = it.height
                }
            } else {
                maxSizeForExtend = it
            }
            maxSizeForFinal = null
        }
    }