|
1 | 1 | # EmjioRatingView
|
2 | 2 | Rate library for Android,Using Emoji icon to interactive, with: :) = Positive. :| = Neutral. :( = Negative
|
| 3 | + |
| 4 | +The Android implementation of [Rating Version A](https://dribbble.com/shots/2211556-Rating-Version-A), designed by [Hoang Nguyen](https://dribbble.com/Hoanguyen). |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +## Quick start |
| 10 | + |
| 11 | +1) Add your `layout.xml` |
| 12 | + |
| 13 | + |
| 14 | +```java |
| 15 | +<com.yongchun.emjioratingview.RatingView |
| 16 | + android:id="@+id/rating_view" |
| 17 | + android:layout_width="match_parent" |
| 18 | + android:layout_height="match_parent" |
| 19 | + android:layout_gravity="center" /> |
| 20 | +``` |
| 21 | + |
| 22 | +2) set `OnRateChangeListener` |
| 23 | + |
| 24 | +```java |
| 25 | +RatingView view = (RatingView) findViewById(R.id.rating_view); |
| 26 | +view.setOnRateChangeListener(new RatingView.OnRateChangeListener() { |
| 27 | + @Override |
| 28 | + public void onChanged(float ratio) { |
| 29 | + DecimalFormat df = new DecimalFormat("0.0"); |
| 30 | + score.setText(df.format(ratio*5)); |
| 31 | + } |
| 32 | +}); |
| 33 | +``` |
| 34 | + |
| 35 | +###License |
| 36 | +>The MIT License (MIT) |
| 37 | +
|
| 38 | +>Copyright (c) 2015 Dee |
| 39 | +
|
| 40 | +>Permission is hereby granted, free of charge, to any person obtaining a copy |
| 41 | +of this software and associated documentation files (the "Software"), to deal |
| 42 | +in the Software without restriction, including without limitation the rights |
| 43 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 44 | +copies of the Software, and to permit persons to whom the Software is |
| 45 | +furnished to do so, subject to the following conditions: |
| 46 | + |
| 47 | +>The above copyright notice and this permission notice shall be included in all |
| 48 | +copies or substantial portions of the Software. |
| 49 | + |
0 commit comments