|
4 | 4 |
|
5 | 5 | [](https://github.com/ahmmedrejowan/CuteButton/issues) [](https://github.com/ahmmedrejowan/CuteButton/network) [](https://github.com/ahmmedrejowan/CuteButton/stargazers) [](https://github.com/ahmmedrejowan/CuteButton/graphs/contributors)
|
6 | 6 |
|
7 |
| -<br/> |
8 |
| - |
9 | 7 | 
|
10 | 8 |
|
11 |
| -**A material design Toast Library for Android** |
12 |
| -A Material Design Custom Button Library for Android |
| 9 | +**A Material Design Custom Button Library for Android** |
13 | 10 |
|
14 |
| -<br/> |
| 11 | +## Purpose |
| 12 | +**CuteButton** is a `Custom Material Design Android Library` which could be an alternative for Deault `Button` Library. |
| 13 | +It has everything as the Default Button library, but with a lots customizations. |
15 | 14 |
|
16 | 15 | ## What's New
|
17 |
| -Check on Releases Tab for changes. |
18 |
| -<br/> |
19 |
| - |
20 |
| -## Purpose |
21 |
| -CuteButton is a Custom Material Design Android Library which could be an alternative for Deault Button Library. |
22 |
| -It has everything as the Default Button library, but with a lot customizations. |
23 |
| -<br/> |
| 16 | +This is the Initial Relase. Changes will be added later. Check on `Releases Tab` for Info. |
24 | 17 |
|
25 | 18 | ## Features
|
| 19 | +CuteButton comes with tons of new features and options: |
| 20 | +- Background Color - Normal, Focused, Disabled |
| 21 | +- Border - Color, Width, Radius |
| 22 | +- Icon - Drawable Icon, Icon Size, Icon Padding, Icon Position |
| 23 | +- Text - Normal Color, Disabled Color |
| 24 | +- Ripple Effect on Clicks |
| 25 | + and also all the features of normal `Button` like padding, margin etc. |
26 | 26 |
|
27 |
| -<br/> |
| 27 | +## Screenshot |
| 28 | +Here are some buttons created with `CuteButton` |
| 29 | + |
| 30 | +<img src="https://github.com/ahmmedrejowan/CuteButton/blob/master/demo/1622416945510.jpg" width="500px" alt="CuteButton"/> |
28 | 31 |
|
29 | 32 | ## Prerequisites
|
30 | 33 |
|
| 34 | +Add this in your root `build.gradle` file (**not** your module `build.gradle` file): |
| 35 | + |
| 36 | +```gradle |
| 37 | +allprojects { |
| 38 | + repositories { |
| 39 | + ... |
| 40 | + maven { url "https://jitpack.io" } |
| 41 | + } |
| 42 | +} |
| 43 | +``` |
31 | 44 | <br/>
|
32 | 45 |
|
| 46 | +## Dependencies |
| 47 | + |
| 48 | +Add this to your module's `build.gradle` file (make sure the version matches the JitPack badge above): |
| 49 | + |
| 50 | +```gradle |
| 51 | +dependencies { |
| 52 | + ... |
| 53 | + implementation 'com.github.ahmmedrejowan:CuteButton:1.0' |
| 54 | +} |
| 55 | +``` |
| 56 | + |
33 | 57 | ## Usage
|
34 | 58 |
|
35 |
| -<br/> |
| 59 | +#### XML |
| 60 | +Include namespace to the root Layout/View: |
| 61 | + |
| 62 | +``` |
| 63 | +
|
| 64 | +xmlns:app="http://schemas.android.com/apk/res-auto" |
| 65 | +
|
| 66 | +``` |
| 67 | + |
| 68 | +CuteButton |
| 69 | +``` |
| 70 | +
|
| 71 | +<com.rejowan.cutebutton.CuteButton |
| 72 | + android:id="@+id/cuteButton" |
| 73 | + android:layout_width="190dp" |
| 74 | + android:layout_height="55dp" |
| 75 | + android:layout_margin="5dp" |
| 76 | + app:cb_bgColor="#0097A7" |
| 77 | + app:cb_bgColorFocus="#006064" |
| 78 | + app:cb_borderRadius="40dp" |
| 79 | + app:cb_icon="@drawable/ic_arrow" |
| 80 | + app:cb_iconPadding="5dp" |
| 81 | + app:cb_iconSize="25dp" |
| 82 | + app:cb_text="Download" |
| 83 | + app:cb_textColor="#fff" |
| 84 | + app:cb_textSize="20sp" /> |
| 85 | +
|
| 86 | +``` |
| 87 | + |
| 88 | +Java |
| 89 | + |
| 90 | +``` |
| 91 | +CuteButton cuteButton = findViewById(R.id.cuteButton); |
| 92 | +cuteButton.setText("Hi, This is Cute Button"); |
| 93 | +cuteButton.setBackgroundColor(Color.BLUE); |
| 94 | +cuteButton.setDisableColor(Color.BLACK); |
| 95 | +cuteButton.setFocusColor(Color.CYAN); |
| 96 | +cuteButton.setTextStyle(CuteButton.TEXT_STYLE_BOLD); |
| 97 | +cuteButton.setBorderWidth(2); |
| 98 | +cuteButton.setBorderWidth(1); |
| 99 | +cuteButton.setRadius(10); |
| 100 | +cuteButton.setIcon(R.drawable.ic_baseline_save_24); |
| 101 | +cuteButton.setIconSize(25); |
| 102 | +cuteButton.setIconPadding(10); |
| 103 | +cuteButton.setIconPosition(CuteButton.POSITION_START); |
| 104 | +
|
| 105 | +``` |
36 | 106 |
|
37 | 107 | ## Contribute
|
38 | 108 |
|
|
0 commit comments