summaryrefslogtreecommitdiff
path: root/same-android/src/main/java/com
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-03-02 16:09:21 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-03-02 16:09:21 +0100
commitbe139aca1d1239d38898f7549ecde78b43b03b1f (patch)
tree2930743e1762418d2fb60aa211d077cd65d6068e /same-android/src/main/java/com
parent4474ee26b3eee38d1ad33bb3d771d6f804fedfcb (diff)
Clean up warnings.
– Fix imports. – Remove unused variables. – Clean up some code.
Diffstat (limited to 'same-android/src/main/java/com')
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/GameView.java14
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/GraphicsActivity.java10
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java8
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/SameService.java3
-rw-r--r--same-android/src/main/java/com/orbekk/same/android/VariableTestActivity.java4
5 files changed, 13 insertions, 26 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/android/GameView.java b/same-android/src/main/java/com/orbekk/same/android/GameView.java
index c3485bb..a03ec9c 100644
--- a/same-android/src/main/java/com/orbekk/same/android/GameView.java
+++ b/same-android/src/main/java/com/orbekk/same/android/GameView.java
@@ -5,10 +5,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.orbekk.same.Variable;
-import com.orbekk.same.VariableUpdaterTask;
-import com.orbekk.same.Variable.OnChangeListener;
-
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
@@ -16,6 +12,9 @@ import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
+import com.orbekk.same.Variable;
+import com.orbekk.same.VariableUpdaterTask;
+
public class GameView extends SurfaceView implements SurfaceHolder.Callback {
private Logger logger = LoggerFactory.getLogger(getClass());
private GameThread thread;
@@ -38,7 +37,6 @@ public class GameView extends SurfaceView implements SurfaceHolder.Callback {
private int height = 0;
private int width = 0;
private SurfaceHolder holder;
- private Context context;
private Paint background;
private Variable<Player> player;
private VariableUpdaterTask<Player> updater;
@@ -46,10 +44,8 @@ public class GameView extends SurfaceView implements SurfaceHolder.Callback {
private Paint color = new Paint();
- public GameThread(SurfaceHolder holder, Context context,
- Variable<Player> player) {
+ public GameThread(SurfaceHolder holder, Variable<Player> player) {
this.holder = holder;
- this.context = context;
this.player = player;
background = new Paint();
background.setARGB(255, 0, 0, 0);
@@ -139,7 +135,7 @@ public class GameView extends SurfaceView implements SurfaceHolder.Callback {
public GameView(Context context, Variable<Player> player) {
super(context);
getHolder().addCallback(this);
- thread = new GameThread(getHolder(), context, player);
+ thread = new GameThread(getHolder(), player);
}
public void setUp() {
diff --git a/same-android/src/main/java/com/orbekk/same/android/GraphicsActivity.java b/same-android/src/main/java/com/orbekk/same/android/GraphicsActivity.java
index dab26a7..c26b062 100644
--- a/same-android/src/main/java/com/orbekk/same/android/GraphicsActivity.java
+++ b/same-android/src/main/java/com/orbekk/same/android/GraphicsActivity.java
@@ -1,12 +1,11 @@
package com.orbekk.same.android;
-import org.codehaus.jackson.type.TypeReference;
-
-import com.orbekk.same.Variable;
-
import android.app.Activity;
import android.os.Bundle;
+import com.orbekk.same.Types;
+import com.orbekk.same.Variable;
+
public class GraphicsActivity extends Activity {
private GameView gameView;
private ClientInterfaceBridge client;
@@ -20,9 +19,8 @@ public class GraphicsActivity extends Activity {
super.onResume();
client = new ClientInterfaceBridge(this);
client.connect();
- TypeReference playerType = new TypeReference<GameView.Player>() {};
Variable<GameView.Player> player = client.createVariableFactory()
- .create("Player", playerType);
+ .create("Player", Types.fromType(GameView.Player.class));
gameView = new GameView(this, player);
gameView.setUp();
setContentView(gameView);
diff --git a/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java b/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java
index 7700e2f..a111bcc 100644
--- a/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java
+++ b/same-android/src/main/java/com/orbekk/same/android/SameControllerActivity.java
@@ -1,14 +1,11 @@
package com.orbekk.same.android;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.orbekk.same.android.R;
-import com.orbekk.same.android.net.Broadcaster;
-
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -27,7 +24,8 @@ import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
-import android.widget.Toast;
+
+import com.orbekk.same.android.net.Broadcaster;
public class SameControllerActivity extends Activity {
private Logger logger = LoggerFactory.getLogger(getClass());
diff --git a/same-android/src/main/java/com/orbekk/same/android/SameService.java b/same-android/src/main/java/com/orbekk/same/android/SameService.java
index f5116ba..0ebcbad 100644
--- a/same-android/src/main/java/com/orbekk/same/android/SameService.java
+++ b/same-android/src/main/java/com/orbekk/same/android/SameService.java
@@ -14,13 +14,12 @@ import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
-import android.widget.Toast;
import com.orbekk.same.NetworkNotificationListener;
import com.orbekk.same.SameController;
import com.orbekk.same.State;
-import com.orbekk.same.StateChangedListener;
import com.orbekk.same.State.Component;
+import com.orbekk.same.StateChangedListener;
import com.orbekk.same.android.net.AndroidBroadcasterFactory;
import com.orbekk.same.android.net.Broadcaster;
import com.orbekk.same.config.Configuration;
diff --git a/same-android/src/main/java/com/orbekk/same/android/VariableTestActivity.java b/same-android/src/main/java/com/orbekk/same/android/VariableTestActivity.java
index 7560a41..1149ce5 100644
--- a/same-android/src/main/java/com/orbekk/same/android/VariableTestActivity.java
+++ b/same-android/src/main/java/com/orbekk/same/android/VariableTestActivity.java
@@ -11,11 +11,7 @@ import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
-import com.orbekk.same.android.R;
import com.orbekk.same.Variable;
-import com.orbekk.same.android.R.id;
-import com.orbekk.same.android.R.layout;
-import com.orbekk.same.Variable.OnChangeListener;
import com.orbekk.util.DelayedOperation;
public class VariableTestActivity extends Activity {