From d48c64457ad8b08ccd51d60608aa68e5c12a2766 Mon Sep 17 00:00:00 2001 From: Mike Harris Date: Sat, 7 Oct 2017 22:17:46 -0700 Subject: [PATCH] Start the postponed activity transition as soon as Picasso loads the image. Doing it on the preDraw for the View is too complicated. This works just as well. --- .../activities/EmulationActivity.java | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index d28e78a8f7..0748a34004 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -23,7 +23,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; -import android.view.ViewTreeObserver; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; @@ -248,14 +247,14 @@ public final class EmulationActivity extends AppCompatActivity @Override public void onSuccess() { - scheduleStartPostponedTransition(mImageView); + startPostponedEnterTransition(); } @Override public void onError() { // Still have to do this, or else the app will crash. - scheduleStartPostponedTransition(mImageView); + startPostponedEnterTransition(); } }); @@ -862,22 +861,6 @@ public final class EmulationActivity extends AppCompatActivity hideSystemUiAfterDelay(); } - - private void scheduleStartPostponedTransition(final View sharedElement) - { - sharedElement.getViewTreeObserver().addOnPreDrawListener( - new ViewTreeObserver.OnPreDrawListener() - { - @Override - public boolean onPreDraw() - { - sharedElement.getViewTreeObserver().removeOnPreDrawListener(this); - startPostponedEnterTransition(); - return true; - } - }); - } - private void showMenu(SaveLoadStateFragment.SaveOrLoad saveOrLoad) { Fragment fragment = SaveLoadStateFragment.newInstance(saveOrLoad);