Found GoalMessage bug (textviews lacked after changing text): remedy = visibility of layout was not set to VISIBLE after animation started
This commit is contained in:
parent
b954e14934
commit
a9be279f12
@ -1,7 +1,6 @@
|
|||||||
package de.frajul.endlessroll.views;
|
package de.frajul.endlessroll.views;
|
||||||
|
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.view.KeyEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
@ -12,7 +11,6 @@ import de.frajul.endlessroll.R;
|
|||||||
import de.frajul.endlessroll.levels.Level;
|
import de.frajul.endlessroll.levels.Level;
|
||||||
import de.frajul.endlessroll.levels.LevelPack;
|
import de.frajul.endlessroll.levels.LevelPack;
|
||||||
import de.frajul.endlessroll.main.GameActivity;
|
import de.frajul.endlessroll.main.GameActivity;
|
||||||
import de.frajul.endlessroll.main.GameLog;
|
|
||||||
import de.frajul.endlessroll.main.game.Game;
|
import de.frajul.endlessroll.main.game.Game;
|
||||||
import de.frajul.endlessroll.main.screens.Screen;
|
import de.frajul.endlessroll.main.screens.Screen;
|
||||||
|
|
||||||
@ -36,6 +34,7 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
|
|||||||
this.game = game;
|
this.game = game;
|
||||||
this.gameActivity = gameActivity;
|
this.gameActivity = gameActivity;
|
||||||
this.layout = layout;
|
this.layout = layout;
|
||||||
|
layout.setVisibility(View.GONE);
|
||||||
Typeface typeface = gameActivity.getTypeface();
|
Typeface typeface = gameActivity.getTypeface();
|
||||||
fadeIn = AnimationUtils.loadAnimation(gameActivity, R.anim.fade_in);
|
fadeIn = AnimationUtils.loadAnimation(gameActivity, R.anim.fade_in);
|
||||||
|
|
||||||
@ -56,36 +55,28 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
|
|||||||
public void fadeInWithDelay(final LevelPack levelPack, final Level level) {
|
public void fadeInWithDelay(final LevelPack levelPack, final Level level) {
|
||||||
this.levelPack = levelPack;
|
this.levelPack = levelPack;
|
||||||
|
|
||||||
GameLog.i("Level: "+level.getId());
|
topBar.update();
|
||||||
|
restart.init(R.string.goal_message_restart_format_d, level);
|
||||||
|
boolean nextLevelVisible = !levelPack.isLastLevel(level);
|
||||||
|
nextLevel.setVisible(nextLevelVisible);
|
||||||
|
if (nextLevelVisible)
|
||||||
|
nextLevel
|
||||||
|
.init(R.string.goal_message_next_level_format_d, levelPack.getNextLevel(level));
|
||||||
|
|
||||||
gameActivity.runOnUiThread(new Runnable() {
|
layout.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
topBar.update();
|
|
||||||
restart.init(R.string.goal_message_restart_format_d, level);
|
|
||||||
boolean nextLevelVisible = !levelPack.isLastLevel(level);
|
|
||||||
nextLevel.setVisible(nextLevelVisible);
|
|
||||||
if (nextLevelVisible)
|
|
||||||
nextLevel
|
|
||||||
.init(R.string.goal_message_next_level_format_d, levelPack.getNextLevel(level));
|
|
||||||
|
|
||||||
layout.startAnimation(fadeIn);
|
layout.startAnimation(fadeIn);
|
||||||
|
layout.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
});
|
}, 500);
|
||||||
|
|
||||||
// layout.postDelayed(new Runnable() {
|
|
||||||
// @Override
|
|
||||||
// public void run() {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }, 500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVisible(){
|
public boolean isVisible() {
|
||||||
return layout.getVisibility() == View.VISIBLE;
|
return layout.getVisibility() == View.VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void prepareToBeShown(){
|
public void prepareToBeShown() {
|
||||||
topBar.update();
|
topBar.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,8 +99,8 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
|
|||||||
gameActivity.startGame(levelPack, goalMessageLevelButton.getLevel());
|
gameActivity.startGame(levelPack, goalMessageLevelButton.getLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onKeyBack(){
|
public void onKeyBack() {
|
||||||
game.toLevelsScreen();
|
game.toLevelsScreen();
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user