From 0679e43efec8e9ca8dc690ea2a59bf7c1d045f7c Mon Sep 17 00:00:00 2001 From: sigmabeta Date: Thu, 25 Jun 2015 21:43:00 -0400 Subject: [PATCH] Android: Show screenshot on EmulationActivity before game starts. --- .../activities/EmulationActivity.java | 30 +++++++++++++++++++ .../dolphinemu/adapters/GameAdapter.java | 1 + .../main/res/layout/activity_emulation.xml | 13 +++++++- 3 files changed, 43 insertions(+), 1 deletion(-) 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 d1e6f47273..ce3f9624c7 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 @@ -12,6 +12,10 @@ import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; + +import com.squareup.picasso.Picasso; import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.R; @@ -22,6 +26,8 @@ import java.util.List; public final class EmulationActivity extends AppCompatActivity { private View mDecorView; + private ImageView mImageView; + private FrameLayout mFrameLayout; private boolean mDeviceHasTouchScreen; private boolean mSystemUiVisible; @@ -79,9 +85,33 @@ public final class EmulationActivity extends AppCompatActivity setContentView(R.layout.activity_emulation); + mImageView = (ImageView) findViewById(R.id.image_screenshot); + mFrameLayout = (FrameLayout) findViewById(R.id.frame_content); + Intent gameToEmulate = getIntent(); String path = gameToEmulate.getStringExtra("SelectedGame"); String title = gameToEmulate.getStringExtra("SelectedTitle"); + String screenPath = gameToEmulate.getStringExtra("ScreenPath"); + + Picasso.with(this) + .load(screenPath) + .fit() + .noFade() + .into(mImageView); + + mImageView.animate() + .setStartDelay(2000) + .setDuration(500) + .alpha(0.0f) + .withEndAction(new Runnable() + { + @Override + public void run() + { + mImageView.setVisibility(View.GONE); + mFrameLayout.setVisibility(View.VISIBLE); + } + }); setTitle(title); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java index a9a7be930e..8b279c52c2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java @@ -220,6 +220,7 @@ public final class GameAdapter extends RecyclerView.Adapter impl intent.putExtra("SelectedGame", holder.path); intent.putExtra("SelectedTitle", holder.title); + intent.putExtra("ScreenPath", holder.screenshotPath); view.getContext().startActivity(intent); } diff --git a/Source/Android/app/src/main/res/layout/activity_emulation.xml b/Source/Android/app/src/main/res/layout/activity_emulation.xml index 63ea99ba83..5a644b260a 100644 --- a/Source/Android/app/src/main/res/layout/activity_emulation.xml +++ b/Source/Android/app/src/main/res/layout/activity_emulation.xml @@ -1,5 +1,16 @@ + > + + + + \ No newline at end of file