mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Finally fixed clouds' lowest position.
Slower logo animation. Larger logo.
This commit is contained in:
@@ -3,25 +3,25 @@
|
||||
android:oneshot="false">
|
||||
|
||||
<item android:drawable="@drawable/logo_anim_shine_00"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_01"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_02"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_03"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_04"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_05"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_06"
|
||||
android:duration="150" />
|
||||
android:duration="180" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_07"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_08"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_09"
|
||||
android:duration="50" />
|
||||
android:duration="80" />
|
||||
<item android:drawable="@drawable/logo_anim_shine_00"
|
||||
android:duration="5000" />
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
android:id="@+id/title_logo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="20sp"
|
||||
android:layout_marginRight="20sp"
|
||||
android:layout_marginLeft="10sp"
|
||||
android:layout_marginRight="10sp"
|
||||
android:layout_marginTop="20sp"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitCenter"
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
android:id="@+id/title_logo_placeholder_left"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2" >
|
||||
android:layout_weight="0.1" >
|
||||
</TextView>
|
||||
|
||||
<ImageView
|
||||
@@ -85,7 +85,7 @@
|
||||
android:layout_marginLeft="20sp"
|
||||
android:layout_marginRight="20sp"
|
||||
android:layout_marginTop="20sp"
|
||||
android:layout_weight="0.6"
|
||||
android:layout_weight="0.8"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/title_logo_animated" />
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
android:id="@+id/title_logo_placeholder_right"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2" >
|
||||
android:layout_weight="0.1" >
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.gpl.rpg.AndorsTrail.WorldSetup;
|
||||
import com.gpl.rpg.AndorsTrail.WorldSetup.OnResourcesLoadedListener;
|
||||
import com.gpl.rpg.AndorsTrail.WorldSetup.OnSceneLoadedListener;
|
||||
import com.gpl.rpg.AndorsTrail.savegames.Savegames;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
@@ -32,7 +31,6 @@ public final class LoadingActivity extends Activity implements OnResourcesLoaded
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
L.log("ANIM Activity Create");
|
||||
setTheme(ThemeHelper.getBaseTheme());
|
||||
super.onCreate(savedInstanceState);
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(this);
|
||||
@@ -100,17 +98,15 @@ public final class LoadingActivity extends Activity implements OnResourcesLoaded
|
||||
float[] point = new float[]{0f,0.25f * iv.getDrawable().getIntrinsicHeight()};
|
||||
iv.getImageMatrix().mapPoints(point);
|
||||
int imgY = (int) (iv.getTop() + point[1]);
|
||||
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||
float maxY = ((float)imgY) / ((float)screenHeight);
|
||||
|
||||
|
||||
if (clouds_back != null) {
|
||||
clouds_back.setYMax(maxY);
|
||||
clouds_back.setYMax(imgY);
|
||||
}
|
||||
if (clouds_mid != null) {
|
||||
clouds_mid.setYMax(maxY);
|
||||
clouds_mid.setYMax(imgY);
|
||||
}
|
||||
if (clouds_front != null) {
|
||||
clouds_front.setYMax(maxY);
|
||||
clouds_front.setYMax(imgY);
|
||||
}
|
||||
iv.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
return true;
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.gpl.rpg.AndorsTrail.activity.fragment.StartScreenActivity_MainMenu.On
|
||||
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;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView;
|
||||
|
||||
@@ -116,7 +115,8 @@ public final class StartScreenActivity extends FragmentActivity implements OnNew
|
||||
if (currentFragment != null) {
|
||||
if (ui_visible) {
|
||||
|
||||
development_version.setText(development_version.getText()
|
||||
development_version.setText(
|
||||
development_version.getText()
|
||||
// +
|
||||
// "\nMax Heap: " + Runtime.getRuntime().maxMemory() / (1024 * 1024) + "MB"+
|
||||
// "\nUsed Heap: " + Runtime.getRuntime().totalMemory() / (1024 * 1024) + "MB"+
|
||||
@@ -171,24 +171,19 @@ public final class StartScreenActivity extends FragmentActivity implements OnNew
|
||||
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
L.log("ANIM preDraw");
|
||||
float[] point = new float[]{0f,0.25f * iv.getDrawable().getIntrinsicHeight()};
|
||||
iv.getImageMatrix().mapPoints(point);
|
||||
int imgY = (int) (iv.getTop() + point[1]);
|
||||
L.log("ANIM imgY" + imgY);
|
||||
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||
L.log("ANIM screenHeight" + screenHeight);
|
||||
float maxY = ((float)imgY) / ((float)screenHeight);
|
||||
L.log("ANIM maxY" + maxY);
|
||||
|
||||
|
||||
if (clouds_back != null) {
|
||||
clouds_back.setYMax(maxY);
|
||||
clouds_back.setYMax(imgY);
|
||||
}
|
||||
if (clouds_mid != null) {
|
||||
clouds_mid.setYMax(maxY);
|
||||
clouds_mid.setYMax(imgY);
|
||||
}
|
||||
if (clouds_front != null) {
|
||||
clouds_front.setYMax(maxY);
|
||||
clouds_front.setYMax(imgY);
|
||||
}
|
||||
iv.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
return true;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.gpl.rpg.AndorsTrail.view;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -16,7 +15,6 @@ import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
|
||||
public class CloudsAnimatorView extends FrameLayout {
|
||||
|
||||
@@ -41,7 +39,7 @@ public class CloudsAnimatorView extends FrameLayout {
|
||||
private int count = 15;
|
||||
private ViewGroup layer;
|
||||
private int duration = DEFAULT_DURATION;
|
||||
private float yMax = 0.5f;
|
||||
private int yMax = 100;
|
||||
private float scalingRatio = 1.0f;
|
||||
|
||||
private ConcurrentHashMap<ImageView, PausableTranslateAnimation> animations;
|
||||
@@ -94,7 +92,7 @@ public class CloudsAnimatorView extends FrameLayout {
|
||||
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams((int) (iv.getDrawable().getIntrinsicWidth() * scalingRatio), (int) (iv.getDrawable().getIntrinsicHeight() * scalingRatio));//RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
layer.addView(iv, lp);
|
||||
|
||||
final float y = (float) (layer.getHeight() * (Math.random() * (yMax))) - iv.getDrawable().getMinimumHeight();
|
||||
final float y = (float) (Math.random() * yMax) - (int) (iv.getDrawable().getIntrinsicHeight() * scalingRatio);
|
||||
float ratio = (float)Math.random();
|
||||
final float x = (float) (((1-ratio) * (iv.getDrawable().getMinimumWidth() + layer.getWidth())) - iv.getDrawable().getMinimumWidth());
|
||||
final long d = (long)((ratio * duration) / (speedFactor + (Math.random() * SPEED_VARIANCE)));
|
||||
@@ -103,7 +101,7 @@ public class CloudsAnimatorView extends FrameLayout {
|
||||
}
|
||||
|
||||
private void resetCloud(final ImageView iv) {
|
||||
final float y = (float) (layer.getHeight() * (Math.random() * (yMax))) - iv.getDrawable().getMinimumHeight();
|
||||
final float y = (float) (Math.random() * yMax) - (int) (iv.getDrawable().getIntrinsicHeight() * scalingRatio);
|
||||
final float x = -iv.getWidth();
|
||||
final long d = (long)(duration / (speedFactor + (Math.random() * SPEED_VARIANCE)));
|
||||
|
||||
@@ -181,7 +179,7 @@ public class CloudsAnimatorView extends FrameLayout {
|
||||
this.scalingRatio = ratio;
|
||||
}
|
||||
|
||||
public void setYMax(float yMax) {
|
||||
public void setYMax(int yMax) {
|
||||
this.yMax = yMax;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user