aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgDirection.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2011-11-29 21:41:32 +0100
committerBananeweizen <bananeweizen@gmx.de>2011-11-29 21:41:32 +0100
commit5001dbaf1f0cbd8460655fe98ff0e78da78808cb (patch)
tree6e66e3649fe69c930a76ed4585fd4395be284ca6 /main/src/cgeo/geocaching/cgDirection.java
parentc6f8ba139da6e82c668dbc86964d99c5139fdb92 (diff)
downloadcgeo-5001dbaf1f0cbd8460655fe98ff0e78da78808cb.zip
cgeo-5001dbaf1f0cbd8460655fe98ff0e78da78808cb.tar.gz
cgeo-5001dbaf1f0cbd8460655fe98ff0e78da78808cb.tar.bz2
first refactoring of cgGeo, see #355
* removes mainly unnecessary variables and methods of cgGeo * next refactoring will remove all cgGeo/cgDirection instances in activies
Diffstat (limited to 'main/src/cgeo/geocaching/cgDirection.java')
-rw-r--r--main/src/cgeo/geocaching/cgDirection.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/cgDirection.java b/main/src/cgeo/geocaching/cgDirection.java
index 7b1ad60..7eeceb4 100644
--- a/main/src/cgeo/geocaching/cgDirection.java
+++ b/main/src/cgeo/geocaching/cgDirection.java
@@ -10,7 +10,6 @@ import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
public class cgDirection {
- private cgDirection dir = null;
private Context context = null;
private SensorManager sensorManager = null;
private cgeoSensorListener sensorListener = null;
@@ -22,11 +21,10 @@ public class cgDirection {
context = contextIn;
dirUpdate = dirUpdateIn;
sensorListener = new cgeoSensorListener();
+ initDir();
}
- public void initDir() {
- dir = this;
-
+ private void initDir() {
if (sensorManager == null) {
sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
}
@@ -43,7 +41,7 @@ public class cgDirection {
dirUpdate = dirUpdateIn;
if (dirUpdate != null && directionNow != null) {
- dirUpdate.updateDir(dir);
+ dirUpdate.updateDir(this);
}
}
@@ -68,7 +66,7 @@ public class cgDirection {
directionNow = Compatibility.getDirectionNow(event.values[0], (Activity) context);
if (dirUpdate != null && directionNow != null) {
- dirUpdate.updateDir(dir);
+ dirUpdate.updateDir(cgDirection.this);
}
}
}