All Projects → sparrow007 → Androidlikebutton

sparrow007 / Androidlikebutton

Licence: apache-2.0
This library will help you to create animation like twitter heart and facebook like and smiley animation in simplest way

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Androidlikebutton

Remotecontrolview
一款万能遥控器的交互效果
Stars: ✭ 376 (+370%)
Mutual labels:  customview
Android Customtoast
Easy to use Custom Toast Library for Android
Stars: ✭ 24 (-70%)
Mutual labels:  customview
Circlefloatbar
CircleFloatBar(with animation) 圆形悬浮窗(带动画特效)
Stars: ✭ 63 (-21.25%)
Mutual labels:  customview
Contourview
🦄 利用本库绘制出贝塞尔曲线魔炫背景。Customize view:Draw the magic dazzle background with Bézier.
Stars: ✭ 542 (+577.5%)
Mutual labels:  customview
Codeview Android
Display code with syntax highlighting ✨ in native way.
Stars: ✭ 748 (+835%)
Mutual labels:  customview
Featuredrecyclerview
Ultimate recycler view.
Stars: ✭ 872 (+990%)
Mutual labels:  customview
Progressview
Styleable progress view
Stars: ✭ 323 (+303.75%)
Mutual labels:  customview
Parallaxview
Parallax view for android apps written in Kotlin
Stars: ✭ 70 (-12.5%)
Mutual labels:  customview
Circular Music Progressbar
Beautiful Circular Progress Bar with album art for android
Stars: ✭ 813 (+916.25%)
Mutual labels:  customview
Testleavesloading
Android 自定义 View 之 LeavesLoading
Stars: ✭ 55 (-31.25%)
Mutual labels:  customview
Zloading
[Android] 这是一个自定义Loading View库。暂停更新
Stars: ✭ 552 (+590%)
Mutual labels:  customview
Puzzleview
Android Jigsaw puzzle support,inspired by Instagram's layout.
Stars: ✭ 727 (+808.75%)
Mutual labels:  customview
Fillingbutton
🔥Replace typical onLongClickListener with this library!
Stars: ✭ 31 (-61.25%)
Mutual labels:  customview
Flutter deer
🦌 Flutter 练习项目(包括集成测试、可访问性测试)。内含完整UI设计图,更贴近真实项目的练习。Flutter practice project. Includes a complete UI design and exercises that are closer to real projects.
Stars: ✭ 5,725 (+7056.25%)
Mutual labels:  customview
Recordbutton
Android record button view
Stars: ✭ 65 (-18.75%)
Mutual labels:  customview
Bifacialview
Stars: ✭ 355 (+343.75%)
Mutual labels:  customview
Multisearchview
Yet another built-in animated search view for Android.
Stars: ✭ 837 (+946.25%)
Mutual labels:  customview
Ticketview
An Android library to implement TicketView in android with normal, rounded and scallop corners
Stars: ✭ 1,180 (+1375%)
Mutual labels:  customview
Stickerview
[No more support] A view which can add sticker and zoom,drag,delete it
Stars: ✭ 1,155 (+1343.75%)
Mutual labels:  customview
Legacytableview
simple light weight android library for displaying tabulated data
Stars: ✭ 39 (-51.25%)
Mutual labels:  customview

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].