aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/cgeotouch.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgeo/geocaching/cgeotouch.java')
-rw-r--r--src/cgeo/geocaching/cgeotouch.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/cgeo/geocaching/cgeotouch.java b/src/cgeo/geocaching/cgeotouch.java
index a085255..f75ced7 100644
--- a/src/cgeo/geocaching/cgeotouch.java
+++ b/src/cgeo/geocaching/cgeotouch.java
@@ -4,6 +4,9 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.res.Configuration;
@@ -46,7 +49,7 @@ public class cgeotouch extends cgLogForm {
private Handler loadDataHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
- if (cgBase.isEmpty(viewstates) && attempts < 2) {
+ if (ArrayUtils.isEmpty(viewstates) && attempts < 2) {
showToast(res.getString(R.string.err_log_load_data_again));
loadData thread;
@@ -54,7 +57,7 @@ public class cgeotouch extends cgLogForm {
thread.start();
return;
- } else if (cgBase.isEmpty(viewstates) && attempts >= 2) {
+ } else if (ArrayUtils.isEmpty(viewstates) && attempts >= 2) {
showToast(res.getString(R.string.err_log_load_data));
showProgress(false);
@@ -125,7 +128,7 @@ public class cgeotouch extends cgLogForm {
trackable = app.getTrackableByGeocode("logging trackable");
- if (trackable.name != null && trackable.name.length() > 0) {
+ if (StringUtils.isNotBlank(trackable.name)) {
setTitle(res.getString(R.string.trackable_touch) + trackable.name);
} else {
setTitle(res.getString(R.string.trackable_touch) + trackable.geocode.toUpperCase());
@@ -285,7 +288,7 @@ public class cgeotouch extends cgLogForm {
tweetCheck.setChecked(true);
Button buttonPost = (Button)findViewById(R.id.post);
- if (cgBase.isEmpty(viewstates)) {
+ if (ArrayUtils.isEmpty(viewstates)) {
buttonPost.setEnabled(false);
buttonPost.setOnTouchListener(null);
buttonPost.setOnClickListener(null);
@@ -365,7 +368,7 @@ public class cgeotouch extends cgLogForm {
attempts ++;
try {
- if (guid != null && guid.length() > 0) {
+ if (StringUtils.isNotBlank(guid)) {
params.put("wid", guid);
} else {
loadDataHandler.sendEmptyMessage(0);
@@ -428,7 +431,7 @@ public class cgeotouch extends cgLogForm {
if (
status == 1 && settings.twitter == 1 &&
- settings.tokenPublic != null && settings.tokenPublic.length() > 0 && settings.tokenSecret != null && settings.tokenSecret.length() > 0 &&
+ StringUtils.isNotBlank(settings.tokenPublic) && StringUtils.isNotBlank(settings.tokenSecret) &&
tweetCheck.isChecked() && tweetBox.getVisibility() == View.VISIBLE
) {
cgBase.postTweetTrackable(app, settings, geocode);