Поддержка анимации переходов для фоновых изображений
This commit is contained in:
parent
9ac6c371ef
commit
656af4ae39
@ -4,7 +4,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/black" >
|
||||
|
||||
<ImageView
|
||||
<com.annimon.everlastingsummer.AnimatableImageView
|
||||
android:id="@+id/background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -56,7 +56,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch
|
||||
private String scriptPath;
|
||||
|
||||
private String backgroundName, backgroundType;
|
||||
private ImageView background;
|
||||
private AnimatableImageView background;
|
||||
private FrameLayout container;
|
||||
private TextView textview;
|
||||
private MediaPlayer musicPlayer, soundPlayer;
|
||||
@ -84,7 +84,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch
|
||||
setContentView(R.layout.main);
|
||||
instance = this;
|
||||
|
||||
background = (ImageView) findViewById(R.id.background);
|
||||
background = (AnimatableImageView) findViewById(R.id.background);
|
||||
container = (FrameLayout) findViewById(R.id.container);
|
||||
textview = (TextView) findViewById(R.id.text);
|
||||
|
||||
@ -285,11 +285,11 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch
|
||||
backgroundName = name;
|
||||
text("");
|
||||
spritesClear();
|
||||
if (name.equalsIgnoreCase("black")) background.setImageResource(android.R.color.black);
|
||||
else if (name.equalsIgnoreCase("white")) background.setImageResource(android.R.color.white);
|
||||
if (name.equalsIgnoreCase("black")) background.setImageResource(android.R.color.black, effect);
|
||||
else if (name.equalsIgnoreCase("white")) background.setImageResource(android.R.color.white, effect);
|
||||
else {
|
||||
try {
|
||||
background.setImageBitmap(IOUtil.readBitmap(PathResolver.background(type, name)));
|
||||
background.setImageBitmap(IOUtil.readBitmap(PathResolver.background(type, name)), effect);
|
||||
} catch (Exception ioe) {
|
||||
if (Logger.DEBUG) Logger.log("background: " + type + ", " + name, ioe);
|
||||
background.setImageResource(android.R.color.black);
|
||||
|
Loading…
Reference in New Issue
Block a user