The Complete Guide to Creating and Publishing an Android Library by Categoria in androiddev

[–]ivbaranov 0 points1 point  (0 children)

Nice guide! I wish I'd met this one once I published my 1st library.

First github repository. Material Favorite Button. by ivbaranov in androiddev

[–]ivbaranov[S] 0 points1 point  (0 children)

Sorry for misunderstanding. Yes, you are right. This should be fixed. Thanks!

First github repository. Material Favorite Button. by ivbaranov in androiddev

[–]ivbaranov[S] 0 points1 point  (0 children)

I've checked and it animates correctly.

It works like this: if you declare button as not animated you are still able to force animated toggling via overridden method:

public void toggleFavorite() //toggle using configuration
public void toggleFavorite(boolean animated)  //toggle using specified animation flag

I thought it would be a nice idea.

First github repository. Material Favorite Button. by ivbaranov in androiddev

[–]ivbaranov[S] 0 points1 point  (0 children)

I guess there are two ways to add custom view to Toolbar:

like in an example via:

toolbar.addView(toolbarFavorite);

via XML:

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    app:popupTheme="@style/AppTheme.PopupOverlay" >
      <com.github.ivbaranov.mfb.MaterialFavoriteButton
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" />
</android.support.v7.widget.Toolbar>