mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Better handling of clouds position
This commit is contained in:
@@ -171,17 +171,14 @@ public final class StartScreenActivity extends FragmentActivity implements OnNew
|
||||
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
float[] point = new float[]{0f,0f,0f,iv.getDrawable().getIntrinsicHeight()};
|
||||
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 imgHeight = (int) (point[3] - point[1]);
|
||||
L.log("ANIM imgHeight" + imgHeight);
|
||||
int cloudSpace = (int) (imgY + (0.25 * imgHeight));
|
||||
L.log("ANIM cloudSpace" + cloudSpace);
|
||||
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||
L.log("ANIM screenHeight" + screenHeight);
|
||||
float maxY = ((float)cloudSpace) / ((float)screenHeight);
|
||||
float maxY = ((float)imgY) / ((float)screenHeight);
|
||||
L.log("ANIM maxY" + maxY);
|
||||
|
||||
if (clouds_back != null) {
|
||||
|
||||
@@ -152,6 +152,7 @@ public class CloudsAnimatorView extends FrameLayout {
|
||||
super.onWindowFocusChanged(hasWindowFocus);
|
||||
if (hasWindowFocus) {
|
||||
if (!started) {
|
||||
L.log("ANIM focus start");
|
||||
duration = (int) (DEFAULT_DURATION * getWidth() / (1024 * getResources().getDisplayMetrics().density));
|
||||
startAnimation();
|
||||
started = true;
|
||||
|
||||
Reference in New Issue
Block a user