Hallo ich anim XML-Datei habenAnimation, warten in xml meine Lösung von Programm funktioniert nicht
<?xml version="1.0" encoding="utf-8"?>
<scale
android:duration="300"
android:fromXScale="1.0"
android:fromYScale="2.0"
android:toXScale="1.0"
android:toYScale="1.0"
/>
, wenn ich auf den Knopf klicken von unten imagelayout zu kommen. Dauer 300ms
Und ich brauche nach 300 ms 1000 ms hinzufügen nur für das Layout stehen und nach unsichtbar sein ..
versuche ich dieses Problem mit thise Code lösen:
ImageView delpop= (ImageView) findViewById(R.id.deletepop);
delpop.setVisibility(View.VISIBLE);
Animation animdel;
animdel = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.popdelanim);
FrameLayout ppdl= (FrameLayout)findViewById(R.id.popupDelete);
ppdl.setVisibility(View.VISIBLE);
ppdl.startAnimation(animdel);
animdel.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
ImageView delpop= (ImageView) findViewById(R.id.deletepop);
delpop.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animation animation) {
final ImageView delpop= (ImageView) findViewById(R.id.deletepop);
// popupdel.setVisibility(View.GONE);
delpop.setVisibility(View.VISIBLE);
android.os.Handler mHandler = new android.os.Handler();
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
delpop.setAlpha(1f);
delpop.animate().alpha(0).setDuration(300);
if (clicked) {
PomocnaDel(DEL);
}
DEL=-1;
}
}, 1000);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
thise Code ausführen, die aber einziger. Ich nenne diese Methode ↑ für 6 verschiedene Tasten. Arbeit gut für jeden, aber nur einmal. Wenn ich auf den ersten Knopfcode klicke, lauf gut, aber nach dem Klick auf 2. Button funktioniert die Animation nicht.
Wenn ich auf nur einen Knopf klicke alles gut, aber wenn nach dem Klicken auf Knopf auch nicht gut funktioniert.
Bitte Hilfe
Dank
///////////////////////////////// bearbeiten///////////////////////////////////////////////////////////////
Ithing wenn ich Animation zweimal starten startet nicht vom Start (kein Neustart). es ist möglich?