项目作者: KshitijDroid

项目描述 :
InstaLikeView Library For Android
高级语言: Java
项目地址: git://github.com/KshitijDroid/InstaLikeView.git
创建时间: 2017-03-17T16:30:30Z
项目社区:https://github.com/KshitijDroid/InstaLikeView

开源协议:Apache License 2.0

下载


InstaLikeView

A simple library to add like animation similar to instagram.

Download

Step 1. Add the JitPack repository to your build file

Gradle

Add it in your root build.gradle at the end of repositories:

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }
Maven
  1. <repositories>
  2. <repository>
  3. <id>jitpack.io</id>
  4. <url>https://jitpack.io</url>
  5. </repository>
  6. </repositories>

Step 2. Add the dependency

Gradle
  1. dependencies{
  2. compile 'com.github.Kshitij-Jain:InstaLikeView:1.05'
  3. }
Maven
  1. <dependency>
  2. <groupId>com.github.Kshitij-Jain</groupId>
  3. <artifactId>InstaLikeView</artifactId>
  4. <version>1.05</version>
  5. </dependency>

Usage

Include following code in your layout:

  1. <com.github.kshitij_jain.instalike.InstaLikeView
  2. android:layout_width="match_parent"
  3. android:layout_height="wrap_content"
  4. app:likeColor="@color/colorPrimaryDark"
  5. app:likeSize="128dp"
  6. app:likeSrc="@drawable/img_heart"
  7. android:id="@+id/insta_like_view"></com.github.kshitij_jain.instalike.InstaLikeView>

Include following code in your activity:

  1. InstaLikeView mInstaLikeView = (InstaLikeView) findViewById(R.id.insta_like_view);
  2. // To start animation
  3. mInstaLikeView.start();
Supported xml attributes:
  1. app:likeColor="@color/colorPrimary" // Set Like Color
  2. app:likeSize="@dimen/likeDimension" // Set Like Size (Default 80dp)
  3. app:likeSrc="@drawable/img_burger" // Set Like Drawable
Other supported methods:
  1. mInstaLikeView.start(); // Start Animation
  2. mInstaLikeView.setLikeResource(R.drawable.img_burger); // Set Like Drawable
  3. mInstaLikeView.setLikeDrawable(ContextCompat.getDrawable(this, R.drawable.img_burger)); // Set Like Drawable
  4. mInstaLikeView.setLikeColor(ContextCompat.getColor(this, R.color.colorAccent)); // Set Like Color

License

  1. Copyright 2017 Kshitij Jain
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.