diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2012-03-10 07:37:59 +0100 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2012-03-10 07:37:59 +0100 |
commit | b297de18e81872e9725867ba4da4a9481aedfcbf (patch) | |
tree | 80db5404f602577fdbf2d3e1bb34c36f850300d2 /main/src/cgeo/geocaching/VisitCacheActivity.java | |
parent | 5daaa3d454ff680e74fdbf8f673674d0eb339817 (diff) | |
download | cgeo-b297de18e81872e9725867ba4da4a9481aedfcbf.zip cgeo-b297de18e81872e9725867ba4da4a9481aedfcbf.tar.gz cgeo-b297de18e81872e9725867ba4da4a9481aedfcbf.tar.bz2 |
refactoring: first part of removing cgBase
* extract network stuff (non GC related)
* extract GC login stuff
* move UI related pieces to activities
* to do: move parsing and searching to better places, remove cgBase
completely afterwards
Diffstat (limited to 'main/src/cgeo/geocaching/VisitCacheActivity.java')
-rw-r--r-- | main/src/cgeo/geocaching/VisitCacheActivity.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/VisitCacheActivity.java b/main/src/cgeo/geocaching/VisitCacheActivity.java index 6d0097a..f0acd97 100644 --- a/main/src/cgeo/geocaching/VisitCacheActivity.java +++ b/main/src/cgeo/geocaching/VisitCacheActivity.java @@ -8,7 +8,10 @@ import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.enumerations.LogTypeTrackable; import cgeo.geocaching.enumerations.StatusCode; import cgeo.geocaching.gcvote.GCVote; +import cgeo.geocaching.network.Login; +import cgeo.geocaching.network.Network; import cgeo.geocaching.network.Parameters; +import cgeo.geocaching.twitter.Twitter; import cgeo.geocaching.ui.DateDialog; import cgeo.geocaching.utils.LogTemplateProvider; import cgeo.geocaching.utils.LogTemplateProvider.LogTemplate; @@ -352,7 +355,7 @@ public class VisitCacheActivity extends AbstractActivity implements DateDialog.D private void insertIntoLog(String newText, final boolean moveCursor) { final EditText log = (EditText) findViewById(R.id.log); - cgBase.insertAtPosition(log, newText, moveCursor); + insertAtPosition(log, newText, moveCursor); } private static String ratingTextValue(final double rating) { @@ -653,9 +656,9 @@ public class VisitCacheActivity extends AbstractActivity implements DateDialog.D return; } - final String page = cgBase.getResponseData(cgBase.request("http://www.geocaching.com/seek/log.aspx", params, false, false, false)); + final String page = Network.getResponseData(Network.request("http://www.geocaching.com/seek/log.aspx", params, false, false, false)); - viewstates = cgBase.getViewstates(page); + viewstates = Login.getViewstates(page); trackables = cgBase.parseTrackableLog(page); final List<LogType> typesPre = cgBase.parseTypes(page); @@ -729,7 +732,7 @@ public class VisitCacheActivity extends AbstractActivity implements DateDialog.D if (status == StatusCode.NO_ERROR && typeSelected == LogType.LOG_FOUND_IT && Settings.isUseTwitter() && Settings.isTwitterLoginValid() && tweetCheck.isChecked() && tweetBox.getVisibility() == View.VISIBLE) { - cgBase.postTweetCache(geocode); + Twitter.postTweetCache(geocode); } if (status == StatusCode.NO_ERROR && typeSelected == LogType.LOG_FOUND_IT && Settings.isGCvoteLogin()) { |