Android: Show screenshot on EmulationActivity before game starts.

This commit is contained in:
sigmabeta 2015-06-25 21:43:00 -04:00
parent da7ec75350
commit 0679e43efe
3 changed files with 43 additions and 1 deletions

View File

@ -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);

View File

@ -220,6 +220,7 @@ public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> impl
intent.putExtra("SelectedGame", holder.path);
intent.putExtra("SelectedTitle", holder.title);
intent.putExtra("ScreenPath", holder.screenshotPath);
view.getContext().startActivity(intent);
}

View File

@ -1,5 +1,16 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frame_content">
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/image_screenshot"/>
<FrameLayout
android:id="@+id/frame_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
</FrameLayout>