|
1 |
| -# MagicButton |
| 1 | +# Magic Button |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +# What is Magic Button? |
| 6 | + |
| 7 | +It's a new button in android that hypnotizes the user and make him give you a lot of money!!! <br/> |
| 8 | +Ok, just kidding, this is not so magic yet... but it's a cute button. <br/> <br/> <br/> |
| 9 | + |
| 10 | + |
| 11 | +<br/> |
| 12 | + |
| 13 | +# Ok it's cute, But how can I use |
| 14 | + |
| 15 | +You just need to add this in your layout. |
| 16 | + |
| 17 | +```xml |
| 18 | +<br.com.bloder.magic.view.MagicButton |
| 19 | + android:id="@+id/magic_button" |
| 20 | + android:layout_width="wrap_content" |
| 21 | + android:layout_height="wrap_content" |
| 22 | + app:magic_button_size="50dp" |
| 23 | + app:button_icon="@drawable/your_icon" |
| 24 | + app:button_icon_width="25dp" |
| 25 | + app:button_icon_height="25dp" |
| 26 | + app:hide_text="Hi Mom!" |
| 27 | + app:icon_button_color="button_icon_color" |
| 28 | + app:expandable_area_color="that_expandable_button_part_color"/> |
| 29 | +``` |
| 30 | + |
| 31 | +# How about click event? |
| 32 | + |
| 33 | +In magic button, the click event will work only in second click and you can set this event with: |
| 34 | + |
| 35 | +```java |
| 36 | +magicButton.setMagicButtonClickListener(new View.OnClickListener() { |
| 37 | + @Override |
| 38 | + public void onClick(View v) { |
| 39 | + yourAction(); |
| 40 | + } |
| 41 | +}); |
| 42 | +``` |
| 43 | + |
| 44 | +# License |
| 45 | + |
| 46 | +``` |
| 47 | +The MIT License (MIT) |
| 48 | +
|
| 49 | +Copyright (c) 2016 Bloder |
| 50 | +
|
| 51 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 52 | +of this software and associated documentation files (the "Software"), to deal |
| 53 | +in the Software without restriction, including without limitation the rights |
| 54 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 55 | +copies of the Software, and to permit persons to whom the Software is |
| 56 | +furnished to do so, subject to the following conditions: |
| 57 | +
|
| 58 | +The above copyright notice and this permission notice shall be included in all |
| 59 | +copies or substantial portions of the Software. |
| 60 | +
|
| 61 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 62 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 63 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 64 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 65 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 66 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 67 | +SOFTWARE. |
| 68 | +``` |
0 commit comments