testCommit

This commit is contained in:
=
2017-11-22 16:00:56 +01:00
parent 9a2353b01c
commit 3324056634
13 changed files with 279 additions and 117 deletions

View File

@ -1,6 +1,7 @@
package de.frajul.endlessroll.views;
import android.graphics.Typeface;
import android.view.KeyEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
@ -39,6 +40,7 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
topBar = new TopBar(gameActivity, Screen.ScreenType.GAME,
layout.findViewById(R.id.goal_message_topbar));
topBar.setShopsEnabled(true);
TextView title = (TextView) layout.findViewById(R.id.goal_message_title);
title.setTypeface(typeface);
restart = new GoalMessageLevelButton(gameActivity, this,
@ -50,7 +52,7 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
toMenu.setOnClickListener(this);
}
public void fadeIn(LevelPack levelPack, Level level) {
public void fadeInWithDelay(LevelPack levelPack, final Level level) {
this.levelPack = levelPack;
topBar.update();
restart.init(R.string.goal_message_restart_format_d, level);
@ -60,7 +62,12 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
nextLevel
.init(R.string.goal_message_next_level_format_d, levelPack.getNextLevel(level));
layout.startAnimation(fadeIn);
layout.postDelayed(new Runnable() {
@Override
public void run() {
layout.startAnimation(fadeIn);
}
}, 500);
}
private void hide() {
@ -71,8 +78,8 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
@Override
public void onClick(View v) {
if (v.equals(toMenu)) {
hide();
game.toLevelsScreen();
hide();
}
}
@ -81,4 +88,9 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
hide();
gameActivity.startGame(levelPack, goalMessageLevelButton.getLevel());
}
public void onKeyBack(){
game.toLevelsScreen();
hide();
}
}