|
| 1 | +# DoorSignView |
| 2 | + |
| 3 | +Create static door signs using [`DoorSignView`](/library/src/main/java/com/mypopsy/doorsignview/DoorSignView.java) or, if you're into fancy things, give a try to [`AnimatedDoorSignView`](/library/src/main/java/com/mypopsy/doorsignview/AnimatedDoorSignView.java) to enable animations based on the device orientation sensor(s). |
| 4 | + **Already in production at [Popsy](https://play.google.com/store/apps/details?id=com.mypopsy.android).** |
| 5 | + |
| 6 | +[DEMO APK](/sample/sample-debug.apk) |
| 7 | + |
| 8 | +<table> |
| 9 | +<tr> |
| 10 | +<td><p align="center"><img src="/assets/sample.png" height="500"/></p></td> |
| 11 | +<td><p align="center"><img src="/assets/sample.gif" height="500"/></p></td> |
| 12 | +</tr> |
| 13 | +</table> |
| 14 | + |
| 15 | +# Usage |
| 16 | +Add an [`AnimatedDoorSignView`](/library/src/main/java/com/mypopsy/doorsignview/AnimatedDoorSignView.java) (or a [`DoorSignView`](/library/src/main/java/com/mypopsy/doorsignview/DoorSignView.java)) to your view hierarchy, be sure that `android:width` is set to `fill_parent` or any fixed value: |
| 17 | + |
| 18 | +```xml |
| 19 | +... |
| 20 | + <com.mypopsy.doorsignview.AnimatedDoorSignView |
| 21 | + android:id="@+id/doorsign" |
| 22 | + android:layout_width="150dp" |
| 23 | + android:layout_height="wrap_content" |
| 24 | + android:layout_gravity="center" |
| 25 | + android:text="Sorry!\nWe're closed!" |
| 26 | + android:textSize="15sp" |
| 27 | + android:textColor="#ffffff" |
| 28 | + app:dsv_signColor="#00adef" |
| 29 | + app:dsv_textFont="fonts/BrannbollFet.ttf" |
| 30 | + app:dsv_stringsWidth="3dp" |
| 31 | + app:dsv_pinRadius="10dp" |
| 32 | + app:dsv_cornerRadius="10dp" |
| 33 | + app:dsv_textSpacingMult="1.2" |
| 34 | + app:dsv_shadowSize="3dp" |
| 35 | + /> |
| 36 | +... |
| 37 | +``` |
| 38 | + |
| 39 | +[`AnimatedDoorSignView`](/library/src/main/java/com/mypopsy/doorsignview/AnimatedDoorSignView.java) use [Rebound](http://facebook.github.io/rebound/) under the hood, you can easily configure friction and tension through xml: |
| 40 | + |
| 41 | +```xml |
| 42 | +... |
| 43 | + <com.mypopsy.doorsignview.AnimatedDoorSignView |
| 44 | + ... |
| 45 | + app:adsv_friction="100" |
| 46 | + app:adsv_tension="4" |
| 47 | + ... |
| 48 | + /> |
| 49 | +... |
| 50 | +``` |
| 51 | + |
| 52 | +See the [all the supported attributes](/library/src/main/res/values/attrs.xml), and don't forget to look at the [sample](/sample). |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +# Install |
| 57 | + |
| 58 | +This repository can be found on JitPack: |
| 59 | + |
| 60 | +https://jitpack.io/#renaudcerrato/DoorSignView |
| 61 | + |
| 62 | +Add it in your root build.gradle at the end of repositories: |
| 63 | + |
| 64 | +```javascript |
| 65 | +allprojects { |
| 66 | + repositories { |
| 67 | + ... |
| 68 | + maven { url "https://jitpack.io" } |
| 69 | + } |
| 70 | + } |
| 71 | +``` |
| 72 | + |
| 73 | +Add the dependency: |
| 74 | +```javascript |
| 75 | +dependencies { |
| 76 | + compile 'com.github.renaudcerrato:DoorSignView:1.0.0' |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | + |
0 commit comments