Attempts to reduce memory usage of title screen and to improve

consistency over varied screen sizes and DPI (from spica to Full HD PC
through high-end 5" phone). Far from complete...
This commit is contained in:
Zukero
2018-03-13 18:55:12 +01:00
parent 1bb52b1f0e
commit 03d67209cd
17 changed files with 21 additions and 20 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 491 B

View File

@@ -15,8 +15,8 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-200sp"
android:scaleType="centerCrop"
android:layout_marginBottom="-30sp"
android:scaleType="fitEnd"
android:src="@drawable/ts_background"/>
<com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView
@@ -28,8 +28,8 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-200sp"
android:scaleType="centerCrop"
android:layout_marginBottom="-30sp"
android:scaleType="fitEnd"
android:src="@drawable/ts_midground"/>
<com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView
@@ -41,8 +41,8 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-200sp"
android:scaleType="centerCrop"
android:layout_marginBottom="-30sp"
android:scaleType="fitEnd"
android:src="@drawable/ts_foreground"/>
<LinearLayout

View File

@@ -15,8 +15,9 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="-50sp"
android:layout_marginRight="-100sp"
android:scaleType="centerCrop"
android:scaleType="fitEnd"
android:src="@drawable/ts_background"/>
<com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView
@@ -28,8 +29,9 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="-50sp"
android:layout_marginRight="-100sp"
android:scaleType="centerCrop"
android:scaleType="fitEnd"
android:src="@drawable/ts_midground"/>
<com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView
@@ -41,8 +43,9 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="-50sp"
android:layout_marginRight="-100sp"
android:scaleType="centerCrop"
android:scaleType="fitEnd"
android:src="@drawable/ts_foreground"/>
<LinearLayout

View File

@@ -5,7 +5,7 @@
android:layout_centerInParent="true"
android:orientation="vertical"
android:elevation="0dp" >
<!--
<ImageView
android:id="@+id/title_bg_top"
android:layout_width="match_parent"
@@ -13,7 +13,7 @@
android:layout_weight="0.4"
android:scaleType="fitXY"
android:src="@drawable/ts_sky_top" />
<!--
<ImageView
android:id="@+id/title_bg_centerpattern"
android:layout_width="match_parent"
@@ -21,6 +21,7 @@
android:scaleType="fitXY"
android:src="@drawable/sky_gradient_drawable" />
-->
<!--
<ImageView
android:id="@+id/title_bg_bottom"
android:layout_width="match_parent"
@@ -28,7 +29,7 @@
android:layout_weight="0.6"
android:scaleType="fitXY"
android:src="@drawable/ts_sky_bottom" />
-->
</LinearLayout>

View File

@@ -90,11 +90,11 @@ public final class StartScreenActivity extends FragmentActivity implements OnNew
});
}
// 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));
// }
if (development_version.getVisibility() == View.VISIBLE) {
development_version.setText(development_version.getText() +
"\nMax Heap: " + Runtime.getRuntime().maxMemory() / (1024 * 1024) + "MB"+
"\nTile size: " + (int) (32 * res.getDisplayMetrics().density));
}
toggleUiVisibility();

View File

@@ -112,8 +112,6 @@ public class CloudsAnimatorView extends FrameLayout {
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)));
L.log("Cloud added at "+x+","+y);
prepareAnimation(iv, layer, speedFactor, x, y, d);
}
@@ -173,7 +171,6 @@ public class CloudsAnimatorView extends FrameLayout {
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
L.log("Clouds onWindowFocusChanged("+hasWindowFocus+")");
if (hasWindowFocus) {
if (!started) {
duration = (int) (DEFAULT_DURATION * getWidth() / (1024 * getResources().getDisplayMetrics().density));