varunest / SparkButton

Android library to create buttons with Twitter's heart like animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Primary Color Dot in the middle of icon

jonl1096 opened this issue · comments

If the icon has a transparent center, sometimes when you unselect it a dot of color appears in the middle. The color of the dot appears to be what you set as the spark button's primary color.

normal selected:
selected normal

normal unselected:
unselected normal

unselected with dot:
screen shot 2016-08-03 at 2 59 34 pm

This doesn't happen every time a button is selected and unselected, only sometimes, I have no idea why.

Here is the xml:

<com.varunest.sparkbutton.SparkButton
        android:id="@+id/addButton"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="@color/white"
        app:sparkbutton_activeImage="@drawable/ic_add_box_active_24dp"
        app:sparkbutton_inActiveImage="@drawable/ic_add_box_inactive_24dp"
        app:sparkbutton_iconSize="25dp"
        app:sparkbutton_primaryColor="#3498db"
        app:sparkbutton_secondaryColor="#f1c40f"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true" />

Here is the java, I didn't do any logic with the button yet:

SparkButton addButton = (SparkButton) view.findViewById(R.id.addButton);
addButton.setChecked(false);

Here is the icon xml:

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="@color/add_inactive"
        android:pathData="M19,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/>
</vector>
commented

Hi,
This was really a bug. The circular animation was visible even when no animation was playing. Have fixed this issue in v1.0.1. Kindly check and revert so I can close this issue.

Thanks!

Hi sorry for closing and reopening, I updated to 1.0.1 in my gradle file and its still giving me the dot.

@jonl1096 I had fixed this bug in my pull request.

@lfkdsk Do I have to pull a snapshot to get that then?

commented

@nikhilpanju I have released v1.0.2 which includes @ifkdsk's pull request. Simply update version in dependency and you are good to go.