|
| 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 | + |
| 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. |
0 commit comments