aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/VisitCacheActivity.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-03-10 07:37:59 +0100
committerBananeweizen <bananeweizen@gmx.de>2012-03-10 07:37:59 +0100
commitb297de18e81872e9725867ba4da4a9481aedfcbf (patch)
tree80db5404f602577fdbf2d3e1bb34c36f850300d2 /main/src/cgeo/geocaching/VisitCacheActivity.java
parent5daaa3d454ff680e74fdbf8f673674d0eb339817 (diff)
downloadcgeo-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.java11
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()) {