Skip to content

Commit

Permalink
animation fixed (thanks fabrantes), images now animate back & forth
Browse files Browse the repository at this point in the history
  • Loading branch information
luisfcorreia committed Apr 30, 2011
1 parent c0d2e8c commit d72696a
Show file tree
Hide file tree
Showing 29 changed files with 37 additions and 31 deletions.
Binary file modified bin/classes.dex
Binary file not shown.
Binary file modified bin/fisga.apk
Binary file not shown.
Binary file added bin/net/loide/games/fisga/Entrymenu$1.class
Binary file not shown.
Binary file modified bin/net/loide/games/fisga/Entrymenu.class
Binary file not shown.
Binary file modified bin/resources.ap_
Binary file not shown.
40 changes: 21 additions & 19 deletions res/drawable/background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,26 @@
<item android:drawable="@drawable/file28" android:duration="50" />
<item android:drawable="@drawable/file29" android:duration="50" />
<item android:drawable="@drawable/file30" android:duration="50" />
<item android:drawable="@drawable/file31" android:duration="50" />
<item android:drawable="@drawable/file32" android:duration="50" />
<item android:drawable="@drawable/file33" android:duration="50" />
<item android:drawable="@drawable/file34" android:duration="50" />
<item android:drawable="@drawable/file35" android:duration="50" />
<item android:drawable="@drawable/file36" android:duration="50" />
<item android:drawable="@drawable/file37" android:duration="50" />
<item android:drawable="@drawable/file38" android:duration="50" />
<item android:drawable="@drawable/file39" android:duration="50" />
<item android:drawable="@drawable/file40" android:duration="50" />
<item android:drawable="@drawable/file41" android:duration="50" />
<item android:drawable="@drawable/file42" android:duration="50" />
<item android:drawable="@drawable/file43" android:duration="50" />
<item android:drawable="@drawable/file44" android:duration="50" />
<item android:drawable="@drawable/file45" android:duration="50" />
<item android:drawable="@drawable/file46" android:duration="50" />
<item android:drawable="@drawable/file47" android:duration="50" />
<item android:drawable="@drawable/file48" android:duration="50" />
<item android:drawable="@drawable/file49" android:duration="50" />
<item android:drawable="@drawable/file30" android:duration="50" />
<item android:drawable="@drawable/file29" android:duration="50" />
<item android:drawable="@drawable/file28" android:duration="50" />
<item android:drawable="@drawable/file27" android:duration="50" />
<item android:drawable="@drawable/file26" android:duration="50" />
<item android:drawable="@drawable/file25" android:duration="50" />
<item android:drawable="@drawable/file24" android:duration="50" />
<item android:drawable="@drawable/file23" android:duration="50" />
<item android:drawable="@drawable/file22" android:duration="50" />
<item android:drawable="@drawable/file21" android:duration="50" />
<item android:drawable="@drawable/file20" android:duration="50" />
<item android:drawable="@drawable/file19" android:duration="50" />
<item android:drawable="@drawable/file18" android:duration="50" />
<item android:drawable="@drawable/file17" android:duration="50" />
<item android:drawable="@drawable/file16" android:duration="50" />
<item android:drawable="@drawable/file15" android:duration="50" />
<item android:drawable="@drawable/file14" android:duration="50" />
<item android:drawable="@drawable/file13" android:duration="50" />
<item android:drawable="@drawable/file12" android:duration="50" />
<item android:drawable="@drawable/file11" android:duration="50" />
<item android:drawable="@drawable/file10" android:duration="50" />
</animation-list>

Binary file modified res/drawable/file10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file27.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable/file30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion res/layout/entrymenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
android:id="@+id/fundo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="centerInside" />
android:scaleType="centerInside"
android:background="@drawable/background"
/>

<Button
android:id="@+id/startgameBtn"
Expand Down
24 changes: 13 additions & 11 deletions src/net/loide/games/fisga/Entrymenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
Expand All @@ -19,16 +21,7 @@ public void onCreate(Bundle savedInstanceState) {
// requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.entrymenu);

// Load the ImageView that will host the animation and
// set its background to our AnimationDrawable XML resource.
ImageView img = (ImageView)findViewById(R.id.fundo);
img.setBackgroundResource(R.drawable.background);

// Get the background, which has been compiled to an AnimationDrawable object.
AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();

// Start the animation (looped playback by default).
frameAnimation.start();
h.sendEmptyMessageDelayed(0, 500);

Button button1 = (Button) findViewById(R.id.startgameBtn);
Button button2 = (Button) findViewById(R.id.exitBtn);
Expand All @@ -37,7 +30,16 @@ public void onCreate(Bundle savedInstanceState) {
button2.setOnClickListener(this);

}


Handler h = new Handler() {
@Override
public void handleMessage(Message msg) {
ImageView img = (ImageView)findViewById(R.id.fundo);
AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();
frameAnimation.start();
}
};

@Override
public void onClick(View v) {
switch (v.getId()) {
Expand Down

0 comments on commit d72696a

Please sign in to comment.