You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Notes** : This guide is still in process, I will work on it as soon as possible. So, keep checking later if you see this note.
32
+
33
+
34
+
35
+
In your *layout.xml* file, add the view
28
36
29
37
```xml
30
38
<id.ss564.lib.slidingbutton.SlidingButton
31
-
android:id="@+id/slidingButton"
32
-
android:layout_width="match_parent"
33
-
android:layout_height="wrap_content"
34
-
/>
39
+
android:id="@+id/slidingButton"
40
+
android:layout_width="match_parent"
41
+
android:layout_height="wrap_content"/>
35
42
```
36
43
44
+
Yeah... just add like code above. It's pretty simple :smile:
45
+
46
+
You can use `SlidingButton.OnStatusChangeListener` to find out if the button is shifted or not. Just add a little bit code like below on your `java` or `kotlin` file, for example on **MainActivity**
//access view using synthetic, do your own style to access the view :)
81
+
slidingButton.setOnStatusChangeListener { active ->
82
+
//or using `object : SlidingButton.OnStatusChangeListener` instead of lambda
83
+
84
+
//do what you wanna to do
85
+
}
86
+
}
87
+
}
88
+
```
89
+
90
+
It's pretty simple right? :smile:
91
+
92
+
93
+
94
+
If you wanna customizing, please attention to the following attributes:
95
+
96
+
-`app:sliding_text`
97
+
98
+
Use to set text to the view, value of this attribute is *string* that can be **hardcode**, **reference**,or **null**
99
+
100
+
-`app:sliding_text_color`
101
+
102
+
Use to set text color, value of this attribute can be **hardcode** or **reference**. Absolutely you can reference it to *ColorStateList*:smile:
103
+
104
+
-`app:sliding_text_size`
105
+
106
+
Use to set text size, value of this attribute is *dimension* that can be **hardcode** or **reference**
107
+
108
+
-`app:sliding_text_fontFamily`
109
+
110
+
Use to set font family by name, value of this attribute is *string* that can be **hardcode**, or **reference**
111
+
112
+
-`app:sliding_text_textStyle`
113
+
114
+
Use to set text style, value of this attribute `normal`, `italic`,`bold`, or `bold|italic`
115
+
116
+
-`app:sliding_text_background`
117
+
118
+
Use to set text background, value of this attribute can be **color**, **drawable**, or **null**. Absolutely you can reference it to *ColorStateList* or *StateListDrawable*:smile:
0 commit comments