Skip to content

Commit

Permalink
[#540] Display OdsIconButton XML code implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinea authored and florentmaitre committed Jan 29, 2024
1 parent 86b7ec6 commit b38178c
Showing 1 changed file with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ import com.orange.ods.app.databinding.OdsIconButtonBinding
import com.orange.ods.app.ui.UiFramework
import com.orange.ods.app.ui.components.buttons.InvertedBackgroundColumn
import com.orange.ods.app.ui.components.utilities.clickOnElement
import com.orange.ods.app.ui.utilities.code.CodeBackgroundColumn
import com.orange.ods.app.ui.utilities.code.CodeImplementationColumn
import com.orange.ods.app.ui.utilities.code.FunctionCallCode
import com.orange.ods.app.ui.utilities.code.XmlViewTag
import com.orange.ods.compose.OdsComposable
import com.orange.ods.compose.component.button.OdsIconButton
import com.orange.ods.compose.theme.OdsDisplaySurface
Expand Down Expand Up @@ -67,19 +69,38 @@ fun ButtonsIcon(customizationState: ButtonIconCustomizationState) {
)
}

CodeImplementationColumn(modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin))) {
CodeImplementationColumn(
modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)),
composeContent = {
FunctionCallCode(
name = OdsComposable.OdsIconButton.name,
exhaustiveParameters = false,
parameters = {
classInstance<OdsIconButton.Icon>("icon") {
painter()
contentDescription("")
name = OdsComposable.OdsIconButton.name,
exhaustiveParameters = false,
parameters = {
classInstance<OdsIconButton.Icon>("icon") {
painter()
contentDescription("")
}
if (!isEnabled) enabled(false)
}
if (!isEnabled) enabled(false)
)
},
xmlContent = {
CodeBackgroundColumn {
XmlViewTag(
clazz = com.orange.ods.xml.component.button.OdsIconButton::class.java,
xmlAttributes = {
id("ods_icon_button")
layoutWidth()
layoutHeight()
drawableAppAttr("icon", "icon")
appAttr("iconContentDescription", "Icon description")
if (!isEnabled) disabledAppAttr()
appAttr("odsDisplaySurface", "light")
}
)
}
)
}
}
)
}
}
}
Expand Down

0 comments on commit b38178c

Please sign in to comment.