Search
lxdream.org :: lxdream :: r1247:e48ea82eb72c
lxdream 0.9.1
released Jun 29
Download Now
changeset1247:e48ea82eb72c
parent1246:887f7b0ac7f3
child1248:0ea1904e2b14
authornkeynes
dateSat Mar 03 15:52:59 2012 +1000 (12 years ago)
Swap between run + pause icons when pressed
android/gen/org/lxdream/R.java
android/src/org/lxdream/LxdreamActivity.java
1.1 --- a/android/gen/org/lxdream/R.java Sat Mar 03 00:17:36 2012 +1000
1.2 +++ b/android/gen/org/lxdream/R.java Sat Mar 03 15:52:59 2012 +1000
1.3 @@ -12,9 +12,10 @@
1.4 }
1.5 public static final class drawable {
1.6 public static final int tb_cdrom=0x7f020000;
1.7 - public static final int tb_preferences=0x7f020001;
1.8 - public static final int tb_reset=0x7f020002;
1.9 - public static final int tb_run=0x7f020003;
1.10 + public static final int tb_pause=0x7f020001;
1.11 + public static final int tb_preferences=0x7f020002;
1.12 + public static final int tb_reset=0x7f020003;
1.13 + public static final int tb_run=0x7f020004;
1.14 }
1.15 public static final class id {
1.16 public static final int menu_reset=0x7f050001;
2.1 --- a/android/src/org/lxdream/LxdreamActivity.java Sat Mar 03 00:17:36 2012 +1000
2.2 +++ b/android/src/org/lxdream/LxdreamActivity.java Sat Mar 03 15:52:59 2012 +1000
2.3 @@ -20,6 +20,8 @@
2.4
2.5 import android.app.Activity;
2.6 import android.content.Context;
2.7 +import android.content.res.Resources;
2.8 +import android.graphics.drawable.Drawable;
2.9 import android.os.Bundle;
2.10 import android.util.Log;
2.11 import android.view.Menu;
2.12 @@ -32,11 +34,17 @@
2.13
2.14 public class LxdreamActivity extends Activity {
2.15 LxdreamView view;
2.16 + boolean isRunning = false;
2.17 + Context ctx;
2.18 + Drawable runIcon, pauseIcon;
2.19
2.20 @Override
2.21 protected void onCreate(Bundle bundle) {
2.22 super.onCreate(bundle);
2.23 - Context ctx = getApplication();
2.24 + ctx = getApplication();
2.25 + Resources res = ctx.getResources();
2.26 + runIcon = res.getDrawable(R.drawable.tb_run);
2.27 + pauseIcon = res.getDrawable(R.drawable.tb_pause);
2.28
2.29 Log.i("LxdreamActivity", "Calling Dreamcast.init");
2.30 Dreamcast.init( ctx.getFilesDir().toString() );
2.31 @@ -65,7 +73,13 @@
2.32 }
2.33
2.34 public void onRunClicked( MenuItem item ) {
2.35 + if( isRunning ) {
2.36 + item.setIcon( runIcon );
2.37 + } else {
2.38 + item.setIcon( pauseIcon );
2.39 + }
2.40 Dreamcast.toggleRun();
2.41 + isRunning = !isRunning;
2.42 }
2.43
2.44 public void onResetClicked( MenuItem item ) {
.