Coder Social home page Coder Social logo

favorlayout's Introduction

#FavorLayout

An Android library implementing praise animation like Periscope.
The animation use ObjectAnimator and the path consists some different Bézier curve.

in emulator:

Add One

addOne

Add More

addMore

Use Custom View

addMore

Features


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

Gradle

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'
}

Usage

<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"/>
Attributes:
  • favorDuration animation duration
  • favorSpeedMode speed mode, linear|accelerate|decelerate|acceleratedecelerate
  • favorIntercurrentHeartNum set maximum number of concurrent
  • favorMaxHeartNum set maximum number of view in screen except the white ImageView and the number TextView
  • favorNodeNum node number in path
  • favorHeartWidth view's width and height
  • favorRangeWidth floating range
  • favorMarginRight view's margin left values
  • favorMarginBottom view's margin bottom values
  • favorTip set the white ImageView and the number TextView to show or hidden with the given values true|false
If you want to use custom view
class YourImageView extends AnimImageView {
    protected void onDraw(Canvas canvas) {
        //custom
    }
}

favorlayout.setViewType(YourImageView.class.getName());

Update

  • 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

favorlayout's People

Contributors

gaoxuan avatar myrao avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.