I created a Float Buttom
to start an animation, but when I click on it, the animation does not occur. I've done the debug to check the method that starts the animation and it happens normally. I think it might be some XML problem.
the animation XML:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_decelerate_interpolator">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="2000" >
</alpha>
</set>
The Listener
of Float Buttom
in Main Activity
:
botaoAjuda.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Animation animation = AnimationUtils.loadAnimation(MainActivity.this,
R.anim.tutorialanim);
animation.start();
Log.d("anim: ",animation+"");
}
});
<android.support.design.widget.FloatingActionButton
android:id="@+id/helpButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:foregroundGravity="bottom"
app:fabSize="normal"
app:layout_anchor="@+id/include"
app:layout_anchorGravity="bottom|right" />
The include in Float Buttom
:
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />