diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml index f968d48..9d4b0e0 100644 --- a/.idea/codeStyleSettings.xml +++ b/.idea/codeStyleSettings.xml @@ -34,6 +34,34 @@ + + diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/Emaily.iml b/Emaily.iml index 5a0419d..fe1b347 100644 --- a/Emaily.iml +++ b/Emaily.iml @@ -8,7 +8,7 @@ - + diff --git a/app/app.iml b/app/app.iml index ef68a70..35469ec 100644 --- a/app/app.iml +++ b/app/app.iml @@ -12,10 +12,12 @@ - + @@ -84,12 +86,11 @@ - + - @@ -100,5 +101,6 @@ + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 7d6e307..1d02d0b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,13 +2,13 @@ apply plugin: 'com.android.application' apply plugin: 'versionPlugin' android { - compileSdkVersion 22 - buildToolsVersion "21.1.2" + compileSdkVersion 23 + buildToolsVersion "23.0.1" defaultConfig { applicationId "net.thauvin.erik.android.emaily" minSdkVersion 14 - targetSdkVersion 22 + targetSdkVersion 23 versionCode 2 versionName "1.1b10" } @@ -37,5 +37,5 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) //compile 'com.android.support:appcompat-v7:22.0.0' - compile 'com.android.support:support-annotations:20.0.0' + compile 'com.android.support:support-annotations:23.1.0' } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index e22f608..8fa57da 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -78,4 +78,5 @@ # Emaily -keep class com.google.api.client.googleapis.json.* -dontwarn org.apache.commons.codec.binary.StringUtils --dontwarn org.apache.commons.codec.binary.Base64 \ No newline at end of file +-dontwarn org.apache.commons.codec.binary.Base64 +-dontwarn com.google.api.client.http.apache.* \ No newline at end of file diff --git a/app/src/main/java/net/thauvin/erik/android/emaily/Emaily.java b/app/src/main/java/net/thauvin/erik/android/emaily/Emaily.java index 91be73b..727a865 100644 --- a/app/src/main/java/net/thauvin/erik/android/emaily/Emaily.java +++ b/app/src/main/java/net/thauvin/erik/android/emaily/Emaily.java @@ -33,15 +33,6 @@ */ package net.thauvin.erik.android.emaily; -import static com.rosaloves.bitlyj.Bitly.as; -import static com.rosaloves.bitlyj.Bitly.shorten; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.UnknownHostException; -import java.util.Date; - import android.accounts.Account; import android.accounts.AccountManager; import android.accounts.AccountManagerCallback; @@ -78,6 +69,15 @@ import com.google.api.services.urlshortener.Urlshortener; import com.google.api.services.urlshortener.UrlshortenerRequest; import com.google.api.services.urlshortener.model.Url; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.UnknownHostException; +import java.util.Date; + +import static com.rosaloves.bitlyj.Bitly.as; +import static com.rosaloves.bitlyj.Bitly.shorten; + /** * The Emaily class implements a URL shortener intent. * @@ -93,6 +93,17 @@ public class Emaily extends Activity private String appName; private SharedPreferences sharedPrefs; + /** + * Validates a string. + * + * @param s The string to validate. + * @return returns true if the string is not empty or null, false otherwise. + */ + public static boolean isValid(String s) + { + return (s != null) && (!s.trim().isEmpty()); + } + @SuppressLint("CommitPrefEdits") @Override public void onCreate(Bundle savedInstanceState) @@ -290,17 +301,6 @@ public class Emaily extends Activity startEmailyTask(intent, new Account(getPref(R.string.prefs_key_googl_account), ACCOUNT_TYPE), true); } - /** - * Validates a string. - * - * @param s The string to validate. - * @return returns true if the string is not empty or null, false otherwise. - */ - public static boolean isValid(String s) - { - return (s != null) && (!s.trim().isEmpty()); - } - /** * Returns the value of the specified shared reference based on the specified string id. The default value is an empty string. * @@ -643,10 +643,10 @@ public class Emaily extends Activity */ private class EmailyResult { + private final Intent intent; private int code = 0; private String message; private boolean retry = false; - private final Intent intent; public EmailyResult(Intent intent) { @@ -658,6 +658,11 @@ public class Emaily extends Activity return code; } + public void setCode(int code) + { + this.code = code; + } + public String getMessage() { if (isValid(message)) @@ -670,6 +675,11 @@ public class Emaily extends Activity } } + public void setMessage(String message) + { + this.message = message; + } + public Intent getIntent() { return intent; @@ -685,16 +695,6 @@ public class Emaily extends Activity return retry; } - public void setCode(int code) - { - this.code = code; - } - - public void setMessage(String message) - { - this.message = message; - } - public void setRetry(boolean retry) { this.retry = retry;