diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2011-08-10 07:58:37 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2011-08-10 07:58:37 +0200 |
| commit | cc9a678a367f34f693e9f2facabc79559ab72486 (patch) | |
| tree | e07b955cfee33eed24ddfc7bb12e3b53c979cbfc /src/cgeo/geocaching/mapcommon/cgeomap.java | |
| parent | c47ca7defa34a44ec1b5955d722e54c61c2ef506 (diff) | |
| download | cgeo-cc9a678a367f34f693e9f2facabc79559ab72486.zip cgeo-cc9a678a367f34f693e9f2facabc79559ab72486.tar.gz cgeo-cc9a678a367f34f693e9f2facabc79559ab72486.tar.bz2 | |
* have common base classes for cgeo related activities to encapsulate
the related code
* move several methods from base to the activities classes
* remove all duplicated goHome(), goManual() methods
* remove instance variable "activity", which is only a this-pointer
(all triggered by issue #98)
If you have trouble merging afterwards, I'm happy to help.
Diffstat (limited to 'src/cgeo/geocaching/mapcommon/cgeomap.java')
| -rw-r--r-- | src/cgeo/geocaching/mapcommon/cgeomap.java | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/cgeo/geocaching/mapcommon/cgeomap.java b/src/cgeo/geocaching/mapcommon/cgeomap.java index ce7aada..25f0b4e 100644 --- a/src/cgeo/geocaching/mapcommon/cgeomap.java +++ b/src/cgeo/geocaching/mapcommon/cgeomap.java @@ -1,7 +1,5 @@ package cgeo.geocaching.mapcommon; -import gnu.android.app.appmanualclient.AppManualReaderClient; - import java.util.ArrayList; import java.util.HashMap; import java.util.Locale; @@ -37,6 +35,7 @@ import cgeo.geocaching.cgUser; import cgeo.geocaching.cgWarning; import cgeo.geocaching.cgWaypoint; import cgeo.geocaching.cgeoapplication; +import cgeo.geocaching.activity.ActivityMixin; import cgeo.geocaching.mapinterfaces.ActivityImpl; import cgeo.geocaching.mapinterfaces.CacheOverlayItemImpl; import cgeo.geocaching.mapinterfaces.GeoPointImpl; @@ -155,7 +154,7 @@ public class cgeomap extends MapBase { title.append("]"); } - base.setTitle(activity, title.toString()); + ActivityMixin.setTitle(activity, title.toString()); } else if (what == 1 && mapView != null) { mapView.invalidate(); } @@ -168,9 +167,9 @@ public class cgeomap extends MapBase { final int what = msg.what; if (what == 0) { - base.showProgress(activity, false); + ActivityMixin.showProgress(activity, false); } else if (what == 1) { - base.showProgress(activity, true); + ActivityMixin.showProgress(activity, true); } } }; @@ -249,13 +248,9 @@ public class cgeomap extends MapBase { activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // set layout - if (settings.skin == 1) { - activity.setTheme(R.style.light); - } else { - activity.setTheme(R.style.dark); - } + ActivityMixin.setTheme(activity); activity.setContentView(settings.getMapFactory().getMapLayoutId()); - base.setTitle(activity, res.getString(R.string.map_map)); + ActivityMixin.setTitle(activity, res.getString(R.string.map_map)); if (geo == null) { geo = app.startGeo(activity, geoUpdate, base, settings, warning, 0, 0); @@ -1781,19 +1776,11 @@ public class cgeomap extends MapBase { // close activity and open homescreen public void goHome(View view) { - base.goHome(activity); + ActivityMixin.goHome(activity); } // open manual entry public void goManual(View view) { - try { - AppManualReaderClient.openManual( - "c-geo", - "c:geo-live-map", - activity, - "http://cgeo.carnero.cc/manual/"); - } catch (Exception e) { - // nothing - } + ActivityMixin.goManual(activity, "c:geo-live-map"); } } |
