diff options
Diffstat (limited to 'main/src/cgeo/geocaching/VisitCacheActivity.java')
| -rw-r--r-- | main/src/cgeo/geocaching/VisitCacheActivity.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/main/src/cgeo/geocaching/VisitCacheActivity.java b/main/src/cgeo/geocaching/VisitCacheActivity.java index 443ef3a..a9d9147 100644 --- a/main/src/cgeo/geocaching/VisitCacheActivity.java +++ b/main/src/cgeo/geocaching/VisitCacheActivity.java @@ -42,6 +42,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; +import java.util.Locale; public class VisitCacheActivity extends AbstractLoggingActivity implements DateDialog.DateDialogParent { static final String EXTRAS_FOUND = "found"; @@ -126,7 +127,7 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD @Override public void onClick(View view) { - final Intent trackablesIntent = new Intent(VisitCacheActivity.this, cgeotrackable.class); + final Intent trackablesIntent = new Intent(VisitCacheActivity.this, TrackableActivity.class); trackablesIntent.putExtra(EXTRAS_GEOCODE, tbCode); startActivity(trackablesIntent); } @@ -250,18 +251,17 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD } if ((StringUtils.isBlank(cacheid)) && StringUtils.isNotBlank(geocode)) { - cacheid = app.getCacheid(geocode); + cacheid = cgData.getCacheidForGeocode(geocode); } if (StringUtils.isBlank(geocode) && StringUtils.isNotBlank(cacheid)) { - geocode = app.getGeocode(cacheid); + geocode = cgData.getGeocodeForGuid(cacheid); } - - cache = cgeoapplication.getInstance().loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB); + cache = cgData.loadCache(geocode, LoadFlags.LOAD_CACHE_OR_DB); if (StringUtils.isNotBlank(cache.getName())) { setTitle(res.getString(R.string.log_new_log) + ": " + cache.getName()); } else { - setTitle(res.getString(R.string.log_new_log) + ": " + cache.getGeocode().toUpperCase()); + setTitle(res.getString(R.string.log_new_log) + ": " + cache.getGeocode()); } init(); @@ -335,7 +335,7 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD } private static String ratingTextValue(final double rating) { - return String.format("%.1f", rating); + return String.format(Locale.getDefault(), "%.1f", rating); } @Override @@ -449,7 +449,7 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD possibleLogTypes = cache.getPossibleLogTypes(); - final LogEntry log = app.loadLogOffline(geocode); + final LogEntry log = cgData.loadLogOffline(geocode); if (log != null) { typeSelected = log.type; date.setTime(new Date(log.date)); @@ -575,7 +575,7 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD @Override public void onClick(View arg0) { //TODO: unify this method and the code in init() - app.clearLogOffline(geocode); + cgData.clearLogOffline(geocode); if (alreadyFound) { typeSelected = LogType.NOTE; @@ -686,11 +686,11 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD cache.setFound(true); } - app.updateCache(cache); + cgData.saveChangedCache(cache); } if (status == StatusCode.NO_ERROR) { - app.clearLogOffline(geocode); + cgData.clearLogOffline(geocode); } if (status == StatusCode.NO_ERROR && typeSelected == LogType.FOUND_IT && Settings.isUseTwitter() @@ -717,7 +717,7 @@ public class VisitCacheActivity extends AbstractLoggingActivity implements DateD // Do not erase the saved log if the user has removed all the characters // without using "Clear". This may be a manipulation mistake, and erasing // again will be easy using "Clear" while retyping the text may not be. - if (force || (log.length() > 0 && !StringUtils.equals(log, text))) { + if (force || (StringUtils.isNotEmpty(log) && !StringUtils.equals(log, text))) { cache.logOffline(this, log, date, typeSelected); } text = log; |
