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
var submitButtonState by remember { mutableStateOf(SSButtonState.IDLE) }
45
+
SSLoadingButton(
46
+
type = SSButtonType.CLOCK,
47
+
width = 300.dp,
48
+
height = 50.dp,
49
+
onClick = {
50
+
//Perform action on click of button and make it state to LOADING
51
+
submitButtonState = SSButtonState.LOADING
52
+
},
53
+
assetColor = Color.Red,
54
+
buttonState = submitButtonState
55
+
)
56
+
```
57
+
```kotlin
58
+
// On Success change submitButtonState to success state
59
+
submitButtonState = SSButtonState.SUCCESS
60
+
```
61
+
```kotlin
62
+
// On Failure change submitButtonState to failure state
63
+
submitButtonState = SSButtonState.FAILIURE
64
+
```
65
+
### All Attributes
66
+
------------------------
67
+
68
+
| Attribute | Description | Default |
69
+
| --- | --- | --- |
70
+
|`type`| Choose type of animation from:[CIRCLE, WHEEL, ZOOM_IN_OUT_CIRCLE, CLOCK, SPIRAL]| None |
71
+
|`width`| Width to be applied to the button. | None |
72
+
|`height`| Height to be applied to the button. | None |
73
+
|`onClick`| Will be called when the user clicks the button. | None |
74
+
|`assetColor`| Color to be applied to icon and text inside button. | None |
75
+
|`buttonState`| Represent the state of button from IDLE, LOADING, SUCCESS, FAILIURE from SSButtonState. | None |
76
+
|`buttonBorderStroke`| Border to draw around the button. | None |
77
+
|`blinkingIcon`| Icon will be blink with size and color. |`false`|
78
+
|`cornerRadius`| Corner radius to be applied to the button. |`20`|
79
+
|`speedMillis`| Speed of the animation while changing the state. |`1000`|
80
+
|`enabled`| Controls the enabled state of the button. |`true`|
81
+
|`elevation`| It is used to resolve the elevation for this button in different. |`ButtonDefaults.elevation()`|
82
+
|`colors`| Colors that will be used to resolve the background and content color for this button in different states |`ButtonDefaults.buttonColors()`|
83
+
|`padding`| The spacing values to apply internally between the container and the content. |`PaddingValues(0.dp)`|
84
+
|`alphaValue`| The alpha of the drawn area. |`1f`|
85
+
|`leftImagePainter`| Painter to draw inside this left Icon. |`null`|
86
+
|`rightImagePainter`| Painter to draw inside this right Icon. |`null`|
87
+
|`successIconPainter`| Painter to draw inside this success state Icon. |`rememberVectorPainter(image = Icons.Default.Done)`|
88
+
|`failureIconPainter`| Painter to draw inside this failiure state Icon. |`rememberVectorPainter(image = Icons.Outlined.Info)`|
89
+
|`text`| The text to be displayed. |`null`|
90
+
|`textModifier`| To apply to this text layout node. |`Modifier`|
91
+
|`fontSize`| The size of glyphs to use when painting the text. |`TextUnit.Unspecified`|
92
+
|`fontStyle`| The typeface variant to use when drawing the letters (e.g., italic). |`null`|
93
+
|`fontFamily`| The font family to be used when rendering the text. |`null`|
94
+
|`hourHandColor`| Color will be apply to hour hand in clock type animation only. |`Color.Black`|
95
+
96
+
97
+
## Find this library useful? ❤️
98
+
Support it by joining __[stargazers]__ for this repository.⭐
99
+
100
+
## 🤝 How to Contribute
101
+
102
+
Whether you're helping us fix bugs, improve the docs, or a feature request, we'd love to have you! 💪
103
+
Check out our __[Contributing Guide]__ for ideas on contributing.
104
+
105
+
## Bugs and Feedback
106
+
For bugs, feature requests, and discussion please use __[GitHub Issues]__.
107
+
108
+
## License
109
+
```
110
+
Copyright 2021 Simform Solutions
111
+
112
+
Licensed under the Apache License, Version 2.0 (the "License");
113
+
you may not use this file except in compliance with the License.
114
+
You may obtain a copy of the License at
115
+
http://www.apache.org/licenses/LICENSE-2.0
116
+
Unless required by applicable law or agreed to in writing, software
117
+
distributed under the License is distributed on an "AS IS" BASIS,
118
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
+
See the License for the specific language governing permissions and limitations under the License.
120
+
```
121
+
122
+
[//]: #(These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)
0 commit comments