Yannick M
- Forum-Beiträge: 46
06.02.2013, 16:26:26 via Website
06.02.2013 16:26:26 via Website
Wenn ich auf einer der beiden Buttons klicke dreht sich das Bild nach links oder nach rechts. Soweit so gut. Anschliessend geht geht das Bild wieder an den Anfangspunkt zurück. Was muss ich machen, dass das Bild nicht wieder an den Anfangspunkt zurück geht?
Vielen Dank!
Vielen Dank!
1int jetzt=0;
2int drehung=10;
3
4@Override
5 public void onClick(View v) {
6
7 switch(v.getId()) {
8
9 case R.id.buttonlinks:
10 rotate = new RotateAnimation(jetzt, jetzt+drehung);
11 rotate.setDuration(200);
12 blid.startAnimation(rotate);
13 jetzt = jetzt+drehung;
14
15 break;
16 case R.id.buttonrechts:
17 rotate = new RotateAnimation(jetzt, jetzt-drehung);
18 rotate.setDuration(200);
19 bild.startAnimation(rotate);
20 jetzt = jetzt-drehung;
21 break;
22 }
23
24
25
26
27 }
2int drehung=10;
3
4@Override
5 public void onClick(View v) {
6
7 switch(v.getId()) {
8
9 case R.id.buttonlinks:
10 rotate = new RotateAnimation(jetzt, jetzt+drehung);
11 rotate.setDuration(200);
12 blid.startAnimation(rotate);
13 jetzt = jetzt+drehung;
14
15 break;
16 case R.id.buttonrechts:
17 rotate = new RotateAnimation(jetzt, jetzt-drehung);
18 rotate.setDuration(200);
19 bild.startAnimation(rotate);
20 jetzt = jetzt-drehung;
21 break;
22 }
23
24
25
26
27 }