#FavorLayout
An Android library implementing praise animation like Periscope.
The animation use ObjectAnimator and the path consists some different Bézier curve.
in emulator:
A custom view animation looks like the Periscope.
These features of the Custom View can be configured:
- Time of the animation
- Floating range
- Initial position
- Custom shapes
android {
...
buildscript{
repositories {
jcenter()
maven { url = 'https://jitpack.io' }
}
}
allprojects {
repositories {
jcenter()
maven { url = 'https://jitpack.io' }
}
}
}dependencies {
...
compile 'com.github.gaoxuan:FavorLayout:1.1'
}<com.gx.favorlayout_favorlayout.FavorLayout
android:id="@+id/favor"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:favorHeartWidth="40dp"
app:favorNodeNum="5"
app:favorRangeWidth="40dp"/>favorDurationanimation durationfavorSpeedModespeed mode,linear|accelerate|decelerate|acceleratedeceleratefavorIntercurrentHeartNumset maximum number of concurrentfavorMaxHeartNumset maximum number of view in screen except the white ImageView and the number TextViewfavorNodeNumnode number in pathfavorHeartWidthview's width and heightfavorRangeWidthfloating rangefavorMarginRightview's margin left valuesfavorMarginBottomview's margin bottom valuesfavorTipset the white ImageView and the number TextView to show or hidden with the given valuestrue|false
class YourImageView extends AnimImageView {
protected void onDraw(Canvas canvas) {
//custom
}
}
favorlayout.setViewType(YourImageView.class.getName());- You can set false of favorTip in the xml to hide the white ImageView and the number TextView
- These Heart View can also be customized


