Fixes in size and make game menu clearer
This commit is contained in:
parent
d10662757f
commit
741f8c83c8
4 changed files with 77 additions and 39 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".GamingActivity"
|
android:name=".GamingActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/FullscreenTheme">
|
android:theme="@style/FullscreenTheme">
|
||||||
|
@ -35,6 +36,8 @@
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".IntroActivity"
|
android:name=".IntroActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/FullscreenTheme">
|
android:theme="@style/FullscreenTheme">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@ -49,6 +52,8 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".HighscoreActivity"
|
android:name=".HighscoreActivity"
|
||||||
android:label="@string/title_activity_highscore"
|
android:label="@string/title_activity_highscore"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:parentActivityName=".ProgressActivity"
|
android:parentActivityName=".ProgressActivity"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<meta-data
|
<meta-data
|
||||||
|
@ -57,25 +62,35 @@
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".CreditsActivity"
|
android:name=".CreditsActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:theme="@style/FullscreenTheme" />
|
android:theme="@style/FullscreenTheme" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ReviewActivity"
|
android:name=".ReviewActivity"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:theme="@style/AppTheme.NoActionBar" />
|
android:theme="@style/AppTheme.NoActionBar" />
|
||||||
<activity android:name=".MirrorMenuActivity" />
|
<activity android:name=".MirrorMenuActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ReviewAchievementsActivity"
|
android:name=".ReviewAchievementsActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:theme="@style/AchievementTheme">
|
android:theme="@style/AchievementTheme">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="com.rubenvandeven.emotionhero.ReviewActivity" />
|
android:value="com.rubenvandeven.emotionhero.ReviewActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".ProgressActivity">
|
<activity android:name=".ProgressActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:configChanges="orientation">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="com.rubenvandeven.emotionhero.MirrorMenuActivity" />
|
android:value="com.rubenvandeven.emotionhero.MirrorMenuActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".EndingActivity"
|
<activity android:name=".EndingActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
|
|
@ -114,52 +114,75 @@ public class ProgressActivity extends AppCompatActivity {
|
||||||
|
|
||||||
lvlLayout.addView(titleText);
|
lvlLayout.addView(titleText);
|
||||||
|
|
||||||
|
TextView playText = new TextView(this);
|
||||||
|
String playString = hasAccess ? "play now!" : "locked";
|
||||||
|
playText.setText(playString);
|
||||||
|
playText.setTextSize(getResources().getDimensionPixelSize(R.dimen.highscore_textsize));
|
||||||
|
playText.setTextColor(getResources().getColor(hasAccess ? R.color.textPrimary : R.color.textSecondary));
|
||||||
|
RelativeLayout.LayoutParams playTextParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
|
playTextParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
|
||||||
|
playTextParams.addRule(RelativeLayout.BELOW, titleText.getId());
|
||||||
|
playText.setLayoutParams(playTextParams);
|
||||||
|
lvlLayout.addView(playText);
|
||||||
|
|
||||||
|
// score
|
||||||
|
if(highscoreGame != null)
|
||||||
|
{
|
||||||
TextView scoreText = new TextView(this);
|
TextView scoreText = new TextView(this);
|
||||||
String scoreString = (highscoreGame != null) ? String.format("%1$.2f", highscoreGame.score + highscoreGame.bonus) : (hasAccess ? "play now!" : "locked");
|
String scoreString = String.format("%1$.2f", highscoreGame.score + highscoreGame.bonus);
|
||||||
scoreText.setText(scoreString);
|
scoreText.setText(scoreString);
|
||||||
scoreText.setTextColor(getResources().getColor(hasAccess ? R.color.textPrimary : R.color.textSecondary));
|
scoreText.setTextColor(getResources().getColor(R.color.textPrimary));
|
||||||
scoreText.setTextSize(getResources().getDimensionPixelSize(R.dimen.highscore_textsize));
|
scoreText.setTextSize(getResources().getDimensionPixelSize(R.dimen.highscore_textsize));
|
||||||
RelativeLayout.LayoutParams scoreTextParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
RelativeLayout.LayoutParams scoreTextParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
scoreTextParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
|
scoreTextParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
|
||||||
scoreTextParams.addRule(RelativeLayout.BELOW, titleText.getId());
|
scoreTextParams.addRule(RelativeLayout.BELOW, titleText.getId());
|
||||||
scoreText.setId(R.id.scoreText);
|
scoreText.setId(R.id.scoreText);
|
||||||
scoreText.setLayoutParams(scoreTextParams);
|
scoreText.setLayoutParams(scoreTextParams);
|
||||||
|
|
||||||
lvlLayout.addView(scoreText);
|
lvlLayout.addView(scoreText);
|
||||||
|
|
||||||
|
View.OnClickListener toHighScoreClick = new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Intent intent;
|
||||||
|
// Clicking score -> highscores
|
||||||
|
intent = new Intent(ProgressActivity.this, HighscoreActivity.class);
|
||||||
|
intent.putExtra(HighscoreActivity.INTENT_EXTRA_LVL_ID, scenario.id);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
scoreText.setOnClickListener(toHighScoreClick);
|
||||||
|
|
||||||
|
// +3 achievements
|
||||||
if(playerAchievementCount > 0) {
|
if(playerAchievementCount > 0) {
|
||||||
TextView achievementText = new TextView(this);
|
TextView achievementText = new TextView(this);
|
||||||
achievementText.setText(String.format("+%1$d achievements", playerAchievementCount));
|
achievementText.setText(String.format("+%1$d achievements", playerAchievementCount));
|
||||||
achievementText.setTextColor(getResources().getColor(R.color.textSecondary));
|
achievementText.setTextColor(getResources().getColor(R.color.textSecondary));
|
||||||
RelativeLayout.LayoutParams achievementTextParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
RelativeLayout.LayoutParams achievementTextParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
achievementTextParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
|
achievementTextParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
|
||||||
achievementTextParams.addRule(RelativeLayout.BELOW, scoreText.getId());
|
achievementTextParams.addRule(RelativeLayout.BELOW, scoreText.getId());
|
||||||
achievementText.setLayoutParams(achievementTextParams);
|
achievementText.setLayoutParams(achievementTextParams);
|
||||||
|
achievementText.setOnClickListener(toHighScoreClick);
|
||||||
|
|
||||||
lvlLayout.addView(achievementText);
|
lvlLayout.addView(achievementText);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(hasAccess) {
|
if(hasAccess) {
|
||||||
lvlLayout.setOnClickListener(new View.OnClickListener() {
|
playText.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent;
|
Intent intent;
|
||||||
// TODO: is this behaviour confusing?
|
|
||||||
if(highscoreGame != null) {
|
|
||||||
// Clicking score -> highscores
|
|
||||||
intent = new Intent(ProgressActivity.this, HighscoreActivity.class);
|
|
||||||
intent.putExtra(HighscoreActivity.INTENT_EXTRA_LVL_ID, scenario.id);
|
|
||||||
} else {
|
|
||||||
// "PLAY NOW!"
|
// "PLAY NOW!"
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
intent = new Intent(ProgressActivity.this, GamingActivity.class);
|
intent = new Intent(ProgressActivity.this, GamingActivity.class);
|
||||||
intent.putExtra(GamingActivity.INTENT_EXTRA_SCENARIO, scenario.id);
|
intent.putExtra(GamingActivity.INTENT_EXTRA_SCENARIO, scenario.id);
|
||||||
}
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
levelsLayout.addView(lvlLayout);
|
levelsLayout.addView(lvlLayout);
|
||||||
|
|
||||||
si++;
|
si++;
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Start"
|
android:text="Play now!"
|
||||||
android:id="@+id/startLvlButton"
|
android:id="@+id/startLvlButton"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="monospace"
|
android:fontFamily="monospace"
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
<dimen name="appbar_padding_top">8dp</dimen>
|
<dimen name="appbar_padding_top">8dp</dimen>
|
||||||
<dimen name="highscore_textsize">8dp</dimen>
|
<dimen name="highscore_textsize">15sp</dimen>
|
||||||
<dimen name="gametitle_textsize">5dp</dimen>
|
<dimen name="gametitle_textsize">12sp</dimen>
|
||||||
<dimen name="scenario_scorevalue">20sp</dimen>
|
<dimen name="scenario_scorevalue">20sp</dimen>
|
||||||
<dimen name="scenario_emolabel">12sp</dimen>
|
<dimen name="scenario_emolabel">12sp</dimen>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue