ChadCSong/ShineButton

In fragment don't work the explosion in the icon

Open

#24 opened on Mar 10, 2017

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Java (552 forks)batch import
help wanted

Repository metrics

Stars
 (4,219 stars)
PR merge metrics
 (Avg merge 2693d 13h) (1 merged PR in 30d)

Description

Hi,

I'm trying to implement the library. The icon change the color and do the effect of the moviment, but is not working inside a fragment. If I copy the same code in an activity, it is working fine.

Have the library a problem working in a fragment?

Fragment code: @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState);

    shineButton = (ShineButton) getView().findViewById(R.id.po_image0);
    shineButton.init((HomeActivity)getActivity());

    shineButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
        }
    });

}

XML code: <com.sackcentury.shinebuttonlib.ShineButton android:id="@+id/po_image0" android:layout_width="18dp" android:layout_height="18dp" app:btn_color="@color/colorGrey" app:btn_fill_color="#f26d7d" app:siShape="@raw/ico_social_like" android:layout_marginTop="@dimen/margin_10" android:layout_marginLeft="@dimen/margin_20" android:layout_marginStart="@dimen/margin_20" android:elevation="10dp"/>

Contributor guide