ChadCSong/ShineButton

In fragment don't work the explosion in the icon

Open

#24 创建于 2017年3月10日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Java (4,219 star) (552 fork)batch import
help wanted

描述

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"/>

贡献者指南