Skip to content

Commit 80fbbe0

Browse files
committed
v2.2 buttonBoarder width support data binding
1 parent 3396dea commit 80fbbe0

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

app/src/main/res/layout/activity_main.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
<data>
77

8+
<variable
9+
name="test"
10+
type="Boolean" />
811
<variable
912
name="main"
1013
type="com.maf.custom.views.customgradientbutton.MainViewModel" />
@@ -100,7 +103,7 @@
100103
android:layout_marginTop="20dp"
101104
app:bottomBoarderColor="#2dF39325"
102105
app:buttonBackground="#1AFFFFFF"
103-
app:buttonBorderWidth="1"
106+
app:buttonBorderWidth="@{test ? 5 : 10}"
104107
app:buttonTextSize="18"
105108
app:disabledButtonBackground="#26B5064D"
106109
app:fontWidth="semiBold"

gradient-button/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ afterEvaluate {
7777

7878
groupId = 'com.maf.custom.views'
7979
artifactId = 'gradient-button'
80-
version = '2.1'
80+
version = '2.2'
8181
}
8282
}
8383
}

gradient-button/src/main/java/com/maf/custom/views/gradient_button/BindingAdapter.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ fun CustomGradientButton.setEndIconLink(url: String) {
2424
this.endIconLink = url
2525
}
2626

27+
@BindingAdapter("buttonBorderWidth")
28+
fun CustomGradientButton.setButtonBorderWidth(width: Int) {
29+
this.borderWidth = width
30+
}
31+

0 commit comments

Comments
 (0)