Animated logo on title screen
34
AndorsTrail/res/drawable/title_logo_animated.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:oneshot="false">
|
||||
|
||||
<item android:drawable="@drawable/title_logo_animated_00"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_01"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_02"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_03"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_04"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_05"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_06"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_07"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_08"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_09"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_10"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_11"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_12"
|
||||
android:duration="50" />
|
||||
<item android:drawable="@drawable/title_logo_animated_13"
|
||||
android:duration="5000" />
|
||||
|
||||
</animation-list>
|
||||
BIN
AndorsTrail/res/drawable/title_logo_animated_00.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_01.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_02.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_03.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_04.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_05.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_06.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_07.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_08.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_09.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_10.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_11.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_12.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
AndorsTrail/res/drawable/title_logo_animated_13.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
@@ -40,7 +40,7 @@
|
||||
android:layout_marginTop="20sp"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/title_logo" />
|
||||
android:src="@drawable/title_logo_animated" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_logo_placeholder_right"
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
android:layout_marginTop="20sp"
|
||||
android:layout_weight="0.6"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/title_logo" />
|
||||
android:src="@drawable/title_logo_animated" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_logo_placeholder_right"
|
||||
|
||||
@@ -1,115 +1,114 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_MainMenu;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_MainMenu.OnNewGameRequestedListener;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_NewGame;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_NewGame.GameCreationOverListener;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileManager;
|
||||
|
||||
public final class StartScreenActivity extends FragmentActivity implements OnNewGameRequestedListener, GameCreationOverListener {
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
final Resources res = getResources();
|
||||
TileManager tileManager = app.getWorld().tileManager;
|
||||
tileManager.setDensity(res);
|
||||
app.setWindowParameters(this);
|
||||
|
||||
setContentView(R.layout.startscreen);
|
||||
|
||||
if (findViewById(R.id.startscreen_fragment_container) != null) {
|
||||
StartScreenActivity_MainMenu mainMenu = new StartScreenActivity_MainMenu();
|
||||
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.startscreen_fragment_container, mainMenu)
|
||||
.commit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
TextView tv = (TextView) findViewById(R.id.startscreen_version);
|
||||
tv.setText('v' + AndorsTrailApplication.CURRENT_VERSION_DISPLAY);
|
||||
|
||||
TextView development_version = (TextView) findViewById(R.id.startscreen_dev_version);
|
||||
if (AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAMES) {
|
||||
development_version.setText(R.string.startscreen_incompatible_savegames);
|
||||
development_version.setVisibility(View.VISIBLE);
|
||||
} else if (!AndorsTrailApplication.IS_RELEASE_VERSION) {
|
||||
development_version.setText(R.string.startscreen_non_release_version);
|
||||
development_version.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// if (development_version.getVisibility() == View.VISIBLE) {
|
||||
// development_version.setText(development_version.getText() +
|
||||
// "\nMax Heap: " + Runtime.getRuntime().maxMemory() / 1024 +
|
||||
// "\nTile size: " + (int) (32 * res.getDisplayMetrics().density));
|
||||
// }
|
||||
|
||||
app.getWorldSetup().startResourceLoader(res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
|
||||
backPressed();
|
||||
return true;
|
||||
} else {
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
private void backPressed() {
|
||||
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
|
||||
getSupportFragmentManager().popBackStack();
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewGameRequested() {
|
||||
if (findViewById(R.id.startscreen_fragment_container) != null) {
|
||||
StartScreenActivity_NewGame newGameFragment = new StartScreenActivity_NewGame();
|
||||
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.startscreen_fragment_container, newGameFragment)
|
||||
.addToBackStack(null)
|
||||
.commit();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGameCreationCancelled() {
|
||||
backPressed();
|
||||
}
|
||||
|
||||
}
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_MainMenu;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_MainMenu.OnNewGameRequestedListener;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_NewGame;
|
||||
import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_NewGame.GameCreationOverListener;
|
||||
import com.gpl.rpg.AndorsTrail.resource.tiles.TileManager;
|
||||
|
||||
public final class StartScreenActivity extends FragmentActivity implements OnNewGameRequestedListener, GameCreationOverListener {
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
final Resources res = getResources();
|
||||
TileManager tileManager = app.getWorld().tileManager;
|
||||
tileManager.setDensity(res);
|
||||
app.setWindowParameters(this);
|
||||
|
||||
setContentView(R.layout.startscreen);
|
||||
|
||||
if (findViewById(R.id.startscreen_fragment_container) != null) {
|
||||
StartScreenActivity_MainMenu mainMenu = new StartScreenActivity_MainMenu();
|
||||
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.startscreen_fragment_container, mainMenu)
|
||||
.commit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
TextView tv = (TextView) findViewById(R.id.startscreen_version);
|
||||
tv.setText('v' + AndorsTrailApplication.CURRENT_VERSION_DISPLAY);
|
||||
|
||||
TextView development_version = (TextView) findViewById(R.id.startscreen_dev_version);
|
||||
if (AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAMES) {
|
||||
development_version.setText(R.string.startscreen_incompatible_savegames);
|
||||
development_version.setVisibility(View.VISIBLE);
|
||||
} else if (!AndorsTrailApplication.IS_RELEASE_VERSION) {
|
||||
development_version.setText(R.string.startscreen_non_release_version);
|
||||
development_version.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// if (development_version.getVisibility() == View.VISIBLE) {
|
||||
// development_version.setText(development_version.getText() +
|
||||
// "\nMax Heap: " + Runtime.getRuntime().maxMemory() / 1024 +
|
||||
// "\nTile size: " + (int) (32 * res.getDisplayMetrics().density));
|
||||
// }
|
||||
|
||||
app.getWorldSetup().startResourceLoader(res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
|
||||
backPressed();
|
||||
return true;
|
||||
} else {
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
private void backPressed() {
|
||||
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
|
||||
getSupportFragmentManager().popBackStack();
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewGameRequested() {
|
||||
if (findViewById(R.id.startscreen_fragment_container) != null) {
|
||||
StartScreenActivity_NewGame newGameFragment = new StartScreenActivity_NewGame();
|
||||
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.startscreen_fragment_container, newGameFragment)
|
||||
.addToBackStack(null)
|
||||
.commit();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGameCreationCancelled() {
|
||||
backPressed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||