Preliminary Credits screen and 'custom' icon

This commit is contained in:
Ruben 2016-08-25 15:07:43 +01:00
parent 5793fa5d30
commit a10f0ca2bd
12 changed files with 120 additions and 1 deletions

View file

@ -49,6 +49,8 @@
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value="com.rubenvandeven.emotionhero.MenuActivity" /> android:value="com.rubenvandeven.emotionhero.MenuActivity" />
</activity> </activity>
<activity android:name=".CreditsActivity"
android:theme="@style/FullscreenTheme"></activity>
</application> </application>
</manifest> </manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,18 @@
package com.rubenvandeven.emotionhero;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
public class CreditsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
if(getSupportActionBar() != null) {
getSupportActionBar().hide();
}
setContentView(R.layout.activity_credits);
}
}

View file

@ -31,6 +31,7 @@ public class MenuActivity extends AppCompatActivity {
Button startButton = (Button) findViewById(R.id.startButton); Button startButton = (Button) findViewById(R.id.startButton);
Button continueButton = (Button) findViewById(R.id.continueButton); Button continueButton = (Button) findViewById(R.id.continueButton);
Button highscoreButton = (Button) findViewById(R.id.highscoresButton); Button highscoreButton = (Button) findViewById(R.id.highscoresButton);
Button creditsButton = (Button) findViewById(R.id.creditsButton);
final ImageView logoEmotionHero = (ImageView) findViewById(R.id.logoEmotionHero); final ImageView logoEmotionHero = (ImageView) findViewById(R.id.logoEmotionHero);
@ -43,6 +44,7 @@ public class MenuActivity extends AppCompatActivity {
startButton.setAlpha(0f); startButton.setAlpha(0f);
continueButton.setAlpha(0f); continueButton.setAlpha(0f);
highscoreButton.setAlpha(0f); highscoreButton.setAlpha(0f);
creditsButton.setAlpha(0f);
ObjectAnimator fadeInEmotionHero = ObjectAnimator.ofFloat(logoEmotionHero, "alpha", 0f, 1f); ObjectAnimator fadeInEmotionHero = ObjectAnimator.ofFloat(logoEmotionHero, "alpha", 0f, 1f);
fadeInEmotionHero.setDuration(1000); fadeInEmotionHero.setDuration(1000);
@ -55,6 +57,9 @@ public class MenuActivity extends AppCompatActivity {
ObjectAnimator fadeInHighscoreButton = ObjectAnimator.ofFloat(highscoreButton, "alpha", 0f, 1f); ObjectAnimator fadeInHighscoreButton = ObjectAnimator.ofFloat(highscoreButton, "alpha", 0f, 1f);
fadeInHighscoreButton.setDuration(1000); fadeInHighscoreButton.setDuration(1000);
fadeInHighscoreButton.setStartDelay(600); fadeInHighscoreButton.setStartDelay(600);
ObjectAnimator fadeInCreditsButton = ObjectAnimator.ofFloat(creditsButton, "alpha", 0f, 1f);
fadeInCreditsButton.setDuration(1000);
fadeInCreditsButton.setStartDelay(1000);
Animation anim = new AlphaAnimation(0.0f, 1.0f); Animation anim = new AlphaAnimation(0.0f, 1.0f);
@ -67,7 +72,8 @@ public class MenuActivity extends AppCompatActivity {
AnimatorSet buttonAnimatorSet = new AnimatorSet(); AnimatorSet buttonAnimatorSet = new AnimatorSet();
buttonAnimatorSet.playTogether(fadeInstartButton, buttonAnimatorSet.playTogether(fadeInstartButton,
fadeInContinueButton, fadeInContinueButton,
fadeInHighscoreButton); fadeInHighscoreButton,
fadeInCreditsButton);
buttonAnimatorSet.start(); buttonAnimatorSet.start();
@ -98,6 +104,14 @@ public class MenuActivity extends AppCompatActivity {
} }
}); });
creditsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MenuActivity.this, CreditsActivity.class);
startActivity(intent);
}
});
} }

View file

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_credits"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.rubenvandeven.emotionhero.CreditsActivity">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/emotionhero_logo"
android:id="@+id/logoEmotionHero"
android:cropToPadding="false"
android:adjustViewBounds="true"
android:layout_marginTop="58dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:contentDescription="@string/app_name" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_below="@+id/logoEmotionHero"
android:layout_marginTop="@dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:text="Emotion Hero is a project by Ruben van de Ven.\n
\n\nThis project is produced as part of the Summer Sessions Network for Talent Development in a co-production of Arquivo 237 and V2_ Institute for the Unstable Media.\n
\n\nEmotional intelligence powered by Affectiva."
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/v2_logo"
android:id="@+id/logoV2"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/arquivo237_logo"
android:id="@+id/logoArquivo"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/affectiva_logo"
android:id="@+id/logoAffectiva"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
/>
</LinearLayout>
</ScrollView>
</RelativeLayout>

View file

@ -17,6 +17,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@+id/logoEmotionHero" android:layout_below="@+id/logoEmotionHero"
android:layout_above="@+id/creditsButton"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="19dp"> android:layout_marginTop="19dp">
@ -54,4 +55,12 @@
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:contentDescription="@string/app_name" /> android:contentDescription="@string/app_name" />
<Button
android:text="@string/credits"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/creditsButton"
android:layout_alignParentBottom="true"
android:fontFamily="sans-serif" />
</RelativeLayout> </RelativeLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -9,6 +9,7 @@
<string name="start">Start</string> <string name="start">Start</string>
<string name="continueBtn">Continue</string> <string name="continueBtn">Continue</string>
<string name="highscores">Highscores</string> <string name="highscores">Highscores</string>
<string name="credits">Credits</string>
<string name="title_activity_highscore">HighscoreActivity</string> <string name="title_activity_highscore">HighscoreActivity</string>
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
<string name="section_format">Hello World from section: %1$d</string> <string name="section_format">Hello World from section: %1$d</string>