Skip to content

Commit

Permalink
Done Jesus comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DevPabloGarcia committed Nov 30, 2023
1 parent b3fb1da commit 095ba70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Button @JvmOverloads constructor(
private var style: ButtonStyle by mutableStateOf(ButtonStyle.PRIMARY)
private var isEnable: Boolean by mutableStateOf(true)
private var onClick: () -> Unit by mutableStateOf({})
private var invalidatePadding: Boolean by mutableStateOf(false)
private var invalidatePaddings: Boolean by mutableStateOf(false)

init {
attrs?.let {
Expand All @@ -44,7 +44,7 @@ class Button @JvmOverloads constructor(
isLoading = styledAttrs.getBoolean(R.styleable.Button_isLoading, false)
style = styledAttrs.getInt(R.styleable.Button_style, 0).toButtonStyle()
isEnable = enabledTypedArray.getBoolean(0, true)
invalidatePadding = styledAttrs.getBoolean(R.styleable.Button_invalidatePadding, false)
invalidatePaddings = styledAttrs.getBoolean(R.styleable.Button_invalidatePaddings, false)
icon = styledAttrs.getResourceId(R.styleable.Button_icon, 0).takeIf { it != 0 }
withChevron = styledAttrs.getBoolean(R.styleable.Button_withChevron, false)
} finally {
Expand Down Expand Up @@ -87,7 +87,7 @@ class Button @JvmOverloads constructor(
enabled = isEnable,
icon = icon,
withChevron = withChevron,
invalidatePaddings = invalidatePadding,
invalidatePaddings = invalidatePaddings,
onClickListener = onClick
)
}
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/res/values/attrs_components.xml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
<declare-styleable name="Button">
<attr name="isLoading" format="boolean" />
<attr name="loadingText" format="string" />
<attr name="invalidatePadding" format="boolean"/>
<attr name="invalidatePaddings" format="boolean"/>
<attr name="style" format="enum">
<enum name="PRIMARY" value="0" />
<enum name="PRIMARY_SMALL" value="1" />
Expand Down

0 comments on commit 095ba70

Please sign in to comment.