android - FloatingActionButton with animated icon -


i trying create floatingactionbutton icon : https://github.com/jd-alexander/likebutton

as can see, button animated, not 2 different buttons changed.

here actual basic floatingactionbutton, static icon :

<android.support.design.widget.floatingactionbutton     android:layout_height="wrap_content"     android:layout_width="wrap_content"     app:layout_anchor="@id/appbar"     app:layout_anchorgravity="bottom|right|end"     android:src="@drawable/ic_favorite_border_white_24dp"     android:layout_margin="@dimen/fab_margin"     android:clickable="true"/> 

i not want change icon, make animation when click on it.

here button need, in case not included in floatingactionbutton :

<com.like.likebutton     android:id="@+id/like_button"     android:layout_height="32dp"     android:layout_width="32dp"     app:icon_type="heart"     app:circle_start_color="@color/red"     app:like_drawable="@drawable/ic_favorite_white_24dp"     app:unlike_drawable="@drawable/ic_favorite_border_white_24dp"     app:dots_primary_color="@color/orange"     app:dots_secondary_color="@color/red"     app:circle_end_color="@color/orange"     app:icon_size="24dp"     app:anim_scale_factor="1"/> 

to sum :

  1. i know how floatingactionbutton static icon.
  2. i know how create animated button

  3. i not know how mix steps 1) , 2) create floatingactionbutton animated icon on click.

a famous shopping app doing it, not know how.

enter image description here

i think way achieve not using android.support.design.widget.floatingactionbutton, instead create own fab extends container framelayout (or maybe android.support.v7.widget.cardview), set rounded drawable background it, , add com.like.likebutton child. have define coordinatorlayout.behavior if want use in android.support.design.widget.coordinatorlayout. use android.support.design.widget.floatingactionbutton source of inspiration if needed :p


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -