0
I created a Float Buttom
to start an animation, but when I click on it, the animation does not occur. I have already done the debug to check the method that starts the animation and it occurs normally. I believe it may be some XML problem.
the XML of the animation:
<?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+"");
}
});
and that Float Buttom
is in a layout that I call on layout of Main Activity
with include:
<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 na Main Activity
:
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
I understood! but in my case, I would need to darken the whole screen and do not know how to call her to give this start
– Mikhael Araujo
@Mikhaelaraujo It’s one thing to put action on the button, it’s another thing to get the button to perform an action. You need to set this in your question. I suggest you ask a question or edit this by further detailing your problem accordingly.
– viana