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 :
- i know how floatingactionbutton static icon.
i know how create animated button
i not know how mix steps 1) , 2) create floatingactionbutton animated icon on click.
a famous shopping app doing it, not know how.
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
Post a Comment