GithubHelp home page GithubHelp logo

frogermcs / likeanimation Goto Github PK

View Code? Open in Web Editor NEW
1.7K 46.0 251.0 90 KB

Android like button with delightful star animation inspired by Twitter's heart. See blog post for description.

Home Page: http://frogermcs.github.io/twitters-like-animation-in-android-alternative/

License: Apache License 2.0

Java 100.00%

likeanimation's Introduction

likeanimation's People

Contributors

ashok-varma avatar fleker avatar frogermcs avatar stdrc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

likeanimation's Issues

Animation does not display correctly if the size of LikeButtonView is less than 200dp

If you change the size of the LikeButtonView to 48dp then you can see how the animation does not display correctly. I guess you will need to build all of the other views based on the size of the LikeButtonView in order to correctly animate in smaller areas. To reproduce this issue, just change the size of the LikeButtonView inside activity_main of your sample app.

butterknife?

What are these two?
import butterknife.Bind;
import butterknife.ButterKnife;
I see this error in eclipse: The import butterknife cannot be resolved.

API

Is this only supported on >API21 ?

java.lang.NullPointerException

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewPropertyAnimator android.widget.ImageView.animate()' on a null object reference at com.frogermcs.io.likeanimation.LikeButtonView.onTouchEvent(LikeButtonView.java:138)

Which is this line:
ivStar.animate().scaleX(0.7f).scaleY(0.7f).setDuration(150).setInterpolator(DECCELERATE_INTERPOLATOR);

I did change some sizes in width and height:

<com.frogermcs.io.likeanimation.DotsView
    android:id="@+id/vDotsView"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:layout_gravity="center"/>

<com.frogermcs.io.likeanimation.CircleView
    android:id="@+id/vCircle"
    android:layout_width="12dp"
    android:layout_height="12dp"
    android:layout_gravity="center"/>

<ImageView
    android:id="@+id/ivStar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    app:srcCompat="@drawable/ic_star_rate_off"/>

and in

    <com.frogermcs.io.likeanimation.LikeButtonView
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_marginEnd="10dp"
        android:layout_alignRight="@+id/container_view"
        android:layout_centerVertical="true"/>

Any idea on what is wrong,
i didnt change anything else

Gradle link

I believe that adding a gradle version of this library would be very beneficial to developers who want to include this project in their apps.

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.