GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sparrow007/AndroidLikeButton: This library will help you to create animation like twitter heart and facebook like and smiley animation in simplest way

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
androidlikebutton
androidlikebutton
 
 
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

AndroidLikeButton

github gif

Platform API License

This library let you create a button with animation like twitter' heart , facebook like button in a simplest way

Gradle

Add the dependency

dependencies {
    ...
    implementation 'com.jackandphantom.android:androidlikebutton:1.2.0'
}

Basic Usage

AndroidLikeButton XML

In order to use AndroidLikeButton copy following xml code in your xml file.

 <com.jackandphantom.androidlikebutton.AndroidLikeButton
                android:layout_width="150dp"
                android:layout_height="150dp"
                android:layout_below="@+id/circular"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="20dp"
                app:like_icon="@drawable/like_star"
                app:unlike_icon="@drawable/unlike_star"
                app:circle_startColor="#fcd229"
                app:circle_endColor="#f4ac1b"
                app:dot_color_1="#f5ce31"
                app:dot_color_2="#ed8128"
                >

Attributes

There are several attribute to configure AndroidLikeButton view, they are following

Like and Unlike image

To set like button and unlike button in your likebutton use :-

 <com.jackandphantom.androidlikebutton.AndroidLikeButton
       app:like="@drawable/like_star"  
        app:unlike_icon="@drawable/unlike_star"                                                  
  />

In Java you have several way to do it

   //Like Button
   androidLikeButton.setLikeIcon(Uri);
   androidLikeButton.setLikeIcon(Bitmap);
   androidLikeButton.setLikeIcon(ResId);
   
   //Unlike button
   
   androidLikeButton.setUnlikeIcon(Uri);
   androidLikeButton.setUnlikeIcon(Bitmap);
   androidLikeButton.setUnlikeIcon(ResId);

Circle

you can see the circle in animation so for changing the color of circle add the below code and you can also decide that circle should be appear or not in your animation.

Default of circle active is true.

 <com.jackandphantom.androidlikebutton.AndroidLikeButton
       app:circle_startColor="#fcd229"
       app:circle_endColor="#f4ac1b"
       app:circle_active="false"                                                  
  />

In Java

   
 androidLikeButton.setCircleColor(int color , int color);
 androidLikeButton.setCircleActive(boolean isActive);

Dot

you can see the Dot in animation so for changing the color of Dot add the below code and you can also decide that Dot should be appear or not in your animation.

Default of circle active is true.

 <com.jackandphantom.androidlikebutton.AndroidLikeButton
      app:dot_color_1="#f5ce31"
      app:dot_color_2="#ed8128"
      app:dot_active="false"                                                 
  />

In Java

   
 androidLikeButton.setDotColor(int color , int color);
 androidLikeButton.setDotActive(boolean isActive);

Like Button

In order to make AndroidLikeButton already liked because default implementation is make unlike image first then animate the view and convert it into like image so if you want to make already like in your implementation so just add below code.

Default value of liked = false.

 <com.jackandphantom.androidlikebutton.AndroidLikeButton
      app:liked="false"                                                 
  />

In Java

androidLikeButton.setCurrentlyLiked(boolean liked);

Like and Unlike Bitmap

If you need bitmap of like and unlike image then you can retrieve it by calling the below code java.

In Java

Bitmap likeBitmap = androidLikeButton.getLikeBitmap();
Bitmap unlikeBitmap = androidLikeButton.getUnlikeBitmap();

LICENCE

Copyright 2018 Ankit kumar

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Special Thanks to frogermcs

About

This library will help you to create animation like twitter heart and facebook like and smiley animation in simplest way

Topics

androidanimationbutton-animationcustomviewfacebook-likelikebuttontwitter-animationui

Resources

Readme
Apache-2.0 license
Activity

Stars

89 stars

Watchers

4 watching

Forks

16 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.