Skip to content

Commit 0418449

Browse files
Merge pull request #27 from SimformSolutionsPvtLtd/develop
Develop
2 parents 7939034 + 6557173 commit 0418449

File tree

16 files changed

+416
-193
lines changed

16 files changed

+416
-193
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,58 @@
9191
| `fontSize` | The size of glyphs to use when painting the text. | `TextUnit.Unspecified` |
9292
| `fontStyle` | The typeface variant to use when drawing the letters (e.g., italic). | `null` |
9393
| `fontFamily` | The font family to be used when rendering the text. | `null` |
94+
| `fontWeight` | The typeface thickness to use when painting the text (e.g., [FontWeight.Bold]). | `null` |
9495
| `hourHandColor` | Color will be apply to hour hand in clock type animation only. | `Color.Black` |
96+
| `customLoadingIconPainter` | painter [Painter] to draw your custom loading icon. | `painterResource(id = R.drawable.simform_logo)` |
97+
| `customLoadingEffect` | Custom loading animation type like roation, zoom in out etc. | `SSCustomLoadingEffect( rotation = false, zoomInOut = false, colorChanger = false)` |
98+
| `customLoadingPadding` | Spacing between button border and loading icon. | `0` |
99+
100+
## Customization
101+
* You can customize loading icon and animation effect according to your requirement.You can apply multiple animation effect from roationm, zoom-in-out and color changer.
102+
103+
```kotlin
104+
var submitButtonState by remember { mutableStateOf(SSButtonState.IDLE) }
105+
SSJetPackComposeProgressButton(
106+
type = SSButtonType.CLOCK,
107+
width = 300.dp,
108+
height = 50.dp,
109+
onClick = {
110+
//Perform action on click of button and make it state to LOADING
111+
submitButtonState = SSButtonState.LOADING
112+
},
113+
assetColor = Color.Red,
114+
buttonState = submitButtonState,
115+
successIconPainter = painterResource(id = R.drawable.custom_success),
116+
failureIconPainter = painterResource(id = R.drawable.custom_fail),
117+
colors = ButtonDefaults.buttonColors(backgroundColor = Color.White),
118+
padding = PaddingValues(six.dp),
119+
text = stringResource(id = R.string.simform),
120+
textModifier = Modifier.padding(ten.dp),
121+
fontWeight = FontWeight.Bold,
122+
leftImagePainter = painterResource(id = R.drawable.simform_logo),
123+
buttonBorderStroke = BorderStroke(two.dp, colorResource(id = R.color.pink)),
124+
customLoadingIconPainter = painterResource(id = R.drawable.simform_logo),
125+
customLoadingEffect = SSCustomLoadingEffect(
126+
rotation = false,
127+
zoomInOut = true,
128+
colorChanger = false
129+
)
130+
)
131+
```
132+
```kotlin
133+
// On Success change submitButtonState to success state
134+
submitButtonState = SSButtonState.SUCCESS
135+
```
136+
```kotlin
137+
// On Failure change submitButtonState to failure state
138+
submitButtonState = SSButtonState.FAILIURE
139+
```
140+
141+
# 🎬 Custom loading animation
142+
143+
| On Success | On Failure |
144+
|--|--|
145+
| ![](https://github.com/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton/blob/main/gif/custom_success.gif) | ![](https://github.com/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton/blob/main/gif/custom_fail.gif) |
95146

96147

97148
## Find this library useful? ❤️

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
applicationId "com.simform.ssjetpackcomposeprogressbutton"
1212
minSdk 21
1313
targetSdk 30
14-
versionCode 1
15-
versionName "1.0.0"
14+
versionCode 2
15+
versionName "1.0.5"
1616

1717
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1818
vectorDrawables {

app/src/main/java/com/simform/ssjetpackcomposeprogressbutton/MainActivity.kt

Lines changed: 284 additions & 184 deletions
Large diffs are not rendered by default.
2.27 KB
Loading
2.29 KB
Loading

app/src/main/res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
<color name="dark_green">#07a34d</color>
1111
<color name="yellow">#ffbb00</color>
1212
<color name="light_blue">#23395D</color>
13+
<color name="pink">#ff1731</color>
1314
</resources>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<string name="with_text">With Text</string>
66
<string name="on_success">On Success</string>
77
<string name="on_failure">On Failure</string>
8+
<string name="simform">SIMFORM</string>
89

910
</resources>

gif/custom_fail.gif

525 KB
Loading

gif/custom_success.gif

498 KB
Loading

ssjetpackcomposeprogressbutton/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ afterEvaluate {
1111
release(MavenPublication) {
1212
from components.release
1313
groupId = 'com.simform.ssloadingbuttonlibrary'
14-
artifactId = 'ssloadingbuttonlibrary'
15-
version = '1.0.0'
14+
artifactId = 'ssjetpackcomposeprogressbutton'
15+
version = '1.0.5'
1616
}
1717
}
1818
}

0 commit comments

Comments
 (0)