hanks-zyh / SmallBang

twitter like animation for any view :heartbeat:
Apache License 2.0
1k stars 158 forks source link

Library not working #16

Closed Deba22 closed 4 years ago

Deba22 commented 5 years ago

I have installed the library from nuget package and used it as below:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             xmlns:app="http://schemas.android.com/apk/res-auto"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:gravity="center_horizontal"
             android:orientation="vertical">
    <xyz.hanks.library.bang.SmallBangView
        android:id="@+id/like_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="156dp"
        app:circle_end_color="#ffbc00"
        app:circle_start_color="#fa9651"
        app:dots_primary_color="#fa9651"
        app:dots_secondary_color="#ffbc00">

        <TextView
            android:id="@+id/textone"
            android:layout_width="50dp"
            android:layout_height="20dp"
            android:layout_gravity="center"
            android:gravity="center"
            android:text="hanks"
            android:textColor="@color/text_selector"
            android:textSize="14sp"/>
    </xyz.hanks.library.bang.SmallBangView>
</FrameLayout>

When I click on the text there is no animation happening.Nothing seems to work. Target Android Version:Android 9.0 Minimum Android Version:Android 5.0 Karamunting.Android.HanksZyh.SmallBang Version:1.2.2 Xamarin.Android.Support.v4 Version:28.0.0.1

Mohamed-Emad126 commented 4 years ago

you should start animation in your activity/Fragment after you write the XML:

final SmallBangView small = findViewById(R.id.like_text); 
  small.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                small.likeAnimation();
                small.setSelected(true);
            }
        });
Deba22 commented 4 years ago

Thanks @Mohamed-Emad126 . It's working now with your suggestion.