Skip to content

Commit bb21d35

Browse files
committed
Added readme
1 parent c220472 commit bb21d35

4 files changed

Lines changed: 88 additions & 1 deletion

File tree

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# StripedProcessButton
2+
Library for creating process loading button with stripes
3+
## Download
4+
Add to gradle root:
5+
```
6+
buildscript {
7+
repositories {
8+
jcenter()
9+
}
10+
}
11+
```
12+
Download via Gradle:
13+
```
14+
implementation 'com.github.nikartm:process-button:1.0.1'
15+
```
16+
or Maven:
17+
```
18+
<dependency>
19+
<groupId>com.github.nikartm</groupId>
20+
<artifactId>process-button</artifactId>
21+
<version>1.0.1</version>
22+
<type>pom</type>
23+
</dependency>
24+
```
25+
## Screenshots
26+
![screenshots](https://raw.githubusercontent.com/nikartm/StripedProcessButton/master/screenshots/screenshot.gif)
27+
## How to use?
28+
Adjust the xml view [More examples.](https://github.com/nikartm/StripedProcessButton/blob/master/app/src/main/res/layout/activity_main.xml):
29+
```
30+
<com.github.nikartm.support.StripedProcessButton
31+
android:id="@+id/btn_4"
32+
android:layout_width="match_parent"
33+
android:layout_height="wrap_content"
34+
android:layout_marginBottom="8dp"
35+
android:layout_marginEnd="16dp"
36+
android:layout_marginStart="16dp"
37+
android:layout_marginTop="16dp"
38+
android:clickable="true"
39+
android:focusable="true"
40+
android:text="Start process"
41+
tools:spb_showStripes="true"
42+
app:spb_loadingText="Loading..."
43+
app:spb_stripeGradient="false"
44+
app:spb_stripeWidth="30dp"
45+
app:spb_stripeTilt="35"
46+
app:spb_background="#888888"
47+
app:spb_mainStripColor="#212121"
48+
app:spb_subStripeColor="#ffffff"
49+
app:spb_stripeDuration="120"
50+
android:textColor="#ffffff" />
51+
```
52+
Adjust programmatically:
53+
```
54+
stripedButton.setCornerRadius(50)
55+
.setStripeAlpha(0.7f)
56+
.setStripeRevert(true)
57+
.setStripeGradient(false)
58+
.setTilt(15)
59+
.start();
60+
```
61+
62+
## License
63+
Copyright 2018 Ivan Vodyasov
64+
65+
Licensed under the Apache License, Version 2.0 (the "License");
66+
you may not use this file except in compliance with the License.
67+
You may obtain a copy of the License at
68+
69+
http://www.apache.org/licenses/LICENSE-2.0
70+
71+
Unless required by applicable law or agreed to in writing, software
72+
distributed under the License is distributed on an "AS IS" BASIS,
73+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74+
See the License for the specific language governing permissions and
75+
limitations under the License.

app/src/main/java/com/github/nikartm/stripedprocessbutton/MainActivity.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,22 @@ protected void onCreate(Bundle savedInstanceState) {
2828
stripedButton.setOnClickListener(v -> stripedButton.start());
2929
btnStop.setOnClickListener(v -> stripedButton.stop());
3030

31+
// initStripedButton();
32+
3133
// stripedButton.setStripeWidth(13).setStripeGradient(false);
3234
// stripedButton.start();
3335

3436
btn_2.start();
3537
btn_3.start();
3638
btn_4.start();
3739
}
40+
41+
private void initStripedButton() {
42+
stripedButton.setCornerRadius(50)
43+
.setStripeAlpha(0.7f)
44+
.setStripeRevert(true)
45+
.setStripeGradient(false)
46+
.setTilt(15)
47+
.start();
48+
}
3849
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@
105105
app:spb_stripeGradient="false"
106106
app:spb_stripeWidth="30dp"
107107
app:spb_stripeTilt="35"
108+
app:spb_background="#888888"
109+
app:spb_mainStripColor="#212121"
108110
app:spb_subStripeColor="#ffffff"
109-
app:spb_background="#212121"
110111
app:spb_stripeDuration="120"
111112
android:clickable="true"
112113
android:focusable="true"

screenshots/screenshot .gif

1000 KB
Loading

0 commit comments

Comments
 (0)