mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 22:49:00 +01:00
Android: Show screenshot on EmulationActivity before game starts.
This commit is contained in:
parent
da7ec75350
commit
0679e43efe
@ -12,6 +12,10 @@ import android.view.Menu;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
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.NativeLibrary;
|
||||||
import org.dolphinemu.dolphinemu.R;
|
import org.dolphinemu.dolphinemu.R;
|
||||||
@ -22,6 +26,8 @@ import java.util.List;
|
|||||||
public final class EmulationActivity extends AppCompatActivity
|
public final class EmulationActivity extends AppCompatActivity
|
||||||
{
|
{
|
||||||
private View mDecorView;
|
private View mDecorView;
|
||||||
|
private ImageView mImageView;
|
||||||
|
private FrameLayout mFrameLayout;
|
||||||
|
|
||||||
private boolean mDeviceHasTouchScreen;
|
private boolean mDeviceHasTouchScreen;
|
||||||
private boolean mSystemUiVisible;
|
private boolean mSystemUiVisible;
|
||||||
@ -79,9 +85,33 @@ public final class EmulationActivity extends AppCompatActivity
|
|||||||
|
|
||||||
setContentView(R.layout.activity_emulation);
|
setContentView(R.layout.activity_emulation);
|
||||||
|
|
||||||
|
mImageView = (ImageView) findViewById(R.id.image_screenshot);
|
||||||
|
mFrameLayout = (FrameLayout) findViewById(R.id.frame_content);
|
||||||
|
|
||||||
Intent gameToEmulate = getIntent();
|
Intent gameToEmulate = getIntent();
|
||||||
String path = gameToEmulate.getStringExtra("SelectedGame");
|
String path = gameToEmulate.getStringExtra("SelectedGame");
|
||||||
String title = gameToEmulate.getStringExtra("SelectedTitle");
|
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);
|
setTitle(title);
|
||||||
|
|
||||||
|
@ -220,6 +220,7 @@ public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> impl
|
|||||||
|
|
||||||
intent.putExtra("SelectedGame", holder.path);
|
intent.putExtra("SelectedGame", holder.path);
|
||||||
intent.putExtra("SelectedTitle", holder.title);
|
intent.putExtra("SelectedTitle", holder.title);
|
||||||
|
intent.putExtra("ScreenPath", holder.screenshotPath);
|
||||||
|
|
||||||
view.getContext().startActivity(intent);
|
view.getContext().startActivity(intent);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,16 @@
|
|||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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>
|
</FrameLayout>
|
Loading…
x
Reference in New Issue
Block a user