Skip to content

Commit 4be3eaa

Browse files
Merge pull request #29 from SimformSolutionsPvtLtd/develop
Develop
2 parents 0418449 + deca061 commit 4be3eaa

File tree

1 file changed

+75
-67
lines changed

1 file changed

+75
-67
lines changed

README.md

Lines changed: 75 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
# SSJetPackComposeProgressButton
2-
### _SSJetPackComposeProgressButton is an elegant button with a different loading animations._
2+
### _SSJetPackComposeProgressButton is an elegant button with a different loading animations which makes your app attractive._
33

44
[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)][git-repo-url] [![](https://jitpack.io/v/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton.svg)](https://jitpack.io/#SimformSolutionsPvtLtd/SSJetPackComposeProgressButton) [![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.5.10-blue.svg)](https://kotlinlang.org) [![Platform](https://img.shields.io/badge/Platform-Android-green.svg?style=flat)](https://www.android.com/) [![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=21)
55

6+
# Jetpack Compose
7+
Jetpack Compose is Android’s modern toolkit for building native UI. It simplifies and accelerates UI development on Android. Quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs.
8+
9+
## How to get started
10+
Please get **Android Studio Arctic Fox 2020.3.1 Canary 4** or above [from here](https://developer.android.com/studio/preview/) and use **JDK 11** to build this project.
11+
612
## Features
713
- Android’s modern toolkit - Jetpack Compose support.
814
- Newly designed loading animation make your app attractive.
915
- Blinking icon button for your hot-feature.
1016
- Button with text, right and left icon.
1117
- Different types of state makes it easy to manage button. (Idle, Loading, Success, Failure)
1218
- Fully customized button (Corner radius, background, colors, animation speed etc.)
19+
- Customize button loading animation with your logo and special animation effect.
1320

1421
# 🎬 Preview
1522

1623
| On Success | On Failure |
1724
|--|--|
1825
| ![](https://github.com/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton/blob/main/gif/success.gif) | ![](https://github.com/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton/blob/main/gif/failure.gif) |
1926

27+
# 🎬 Customized loading animation
28+
29+
| On Success | On Failure |
30+
|--|--|
31+
| ![](https://github.com/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton/blob/main/gif/custom_success.gif) | ![](https://github.com/SimformSolutionsPvtLtd/SSJetPackComposeProgressButton/blob/main/gif/custom_fail.gif) |
32+
2033
## Installation
2134
1. Add it in your root build.gradle at the end of repositories:
2235

@@ -33,41 +46,83 @@
3346

3447
```groovy
3548
dependencies {
36-
implementation 'com.github.SimformSolutionsPvtLtd:SSJetPackComposeProgressButton:1.0.4'
49+
implementation 'com.github.SimformSolutionsPvtLtd:SSJetPackComposeProgressButton:1.0.5'
3750
}
3851
```
3952

4053
## Usage
41-
* Just use SSLoadingButton where you want button.
54+
* Just use SSJetPackComposeProgressButton where you want button.
55+
56+
```kotlin
57+
var submitButtonState by remember { mutableStateOf(SSButtonState.IDLE) }
58+
SSJetPackComposeProgressButton(
59+
type = SSButtonType.CLOCK,
60+
width = 300.dp,
61+
height = 50.dp,
62+
onClick = {
63+
//Perform action on click of button and make it's state to LOADING
64+
submitButtonState = SSButtonState.LOADING
65+
},
66+
assetColor = Color.Red,
67+
buttonState = submitButtonState
68+
)
69+
```
70+
```kotlin
71+
// On Success change submitButtonState to success state
72+
submitButtonState = SSButtonState.SUCCESS
73+
```
74+
```kotlin
75+
// On Failure change submitButtonState to failure state
76+
submitButtonState = SSButtonState.FAILIURE
77+
```
78+
79+
## Customization
80+
* You can customize loading icon and animation effect according to your requirement.You can apply multiple animation effect from rotation, zoom-in-out and color changer too.
4281

4382
```kotlin
44-
var submitButtonState by remember { mutableStateOf(SSButtonState.IDLE) }
45-
SSJetPackComposeProgressButton(
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
83+
var submitButtonState by remember { mutableStateOf(SSButtonState.IDLE) }
84+
SSJetPackComposeProgressButton(
85+
type = SSButtonType.CUSTOM,
86+
width = 300.dp,
87+
height = 50.dp,
88+
onClick = {
89+
//Perform action on click of button and make it's state to LOADING
90+
submitButtonState = SSButtonState.LOADING
91+
},
92+
assetColor = Color.Red,
93+
buttonState = submitButtonState,
94+
successIconPainter = painterResource(id = R.drawable.custom_success),
95+
failureIconPainter = painterResource(id = R.drawable.custom_fail),
96+
colors = ButtonDefaults.buttonColors(backgroundColor = Color.White),
97+
padding = PaddingValues(six.dp),
98+
text = stringResource(id = R.string.simform),
99+
textModifier = Modifier.padding(ten.dp),
100+
fontWeight = FontWeight.Bold,
101+
leftImagePainter = painterResource(id = R.drawable.simform_logo),
102+
buttonBorderStroke = BorderStroke(two.dp, colorResource(id = R.color.pink)),
103+
customLoadingIconPainter = painterResource(id = R.drawable.simform_logo),
104+
customLoadingEffect = SSCustomLoadingEffect(
105+
rotation = false,
106+
zoomInOut = true,
107+
colorChanger = false
55108
)
109+
)
56110
```
57111
```kotlin
58-
// On Success change submitButtonState to success state
59-
submitButtonState = SSButtonState.SUCCESS
112+
// On Success change submitButtonState to success state
113+
submitButtonState = SSButtonState.SUCCESS
60114
```
61115
```kotlin
62-
// On Failure change submitButtonState to failure state
63-
submitButtonState = SSButtonState.FAILIURE
116+
// On Failure change submitButtonState to failure state
117+
submitButtonState = SSButtonState.FAILIURE
64118
```
119+
65120
### All Attributes
66121
------------------------
67122

68123
| Attribute | Description | Default |
69124
| --- | --- | --- |
70-
| `type` | Choose type of animation from:[CIRCLE, WHEEL, ZOOM_IN_OUT_CIRCLE, CLOCK, SPIRAL] | None |
125+
| `type` | Choose type of animation from:[CIRCLE, WHEEL, ZOOM_IN_OUT_CIRCLE, CLOCK, SPIRAL, CUSTOM] | None |
71126
| `width` | Width to be applied to the button. | None |
72127
| `height` | Height to be applied to the button. | None |
73128
| `onClick` | Will be called when the user clicks the button. | None |
@@ -97,58 +152,11 @@
97152
| `customLoadingEffect` | Custom loading animation type like roation, zoom in out etc. | `SSCustomLoadingEffect( rotation = false, zoomInOut = false, colorChanger = false)` |
98153
| `customLoadingPadding` | Spacing between button border and loading icon. | `0` |
99154

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) |
146-
147155

148156
## Find this library useful? ❤️
149157
Support it by joining __[stargazers]__ for this repository.⭐
150158

151-
## 🤝 How to Contribute
159+
## How to Contribute🤝
152160

153161
Whether you're helping us fix bugs, improve the docs, or a feature request, we'd love to have you! 💪
154162
Check out our __[Contributing Guide]__ for ideas on contributing.

0 commit comments

Comments
 (0)