From 9a8d29e774f71c764a81e09ed3c42011267aec64 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Fri, 8 Jan 2016 17:57:51 +0100 Subject: [PATCH] Append trailing slashes to Web URLs; okhttp upgrade --- app/build.gradle | 2 +- app/src/main/java/at/bitfire/davdroid/Constants.java | 6 ++---- .../java/at/bitfire/davdroid/ui/DonateDialogFragment.java | 2 +- app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java | 2 +- .../at/bitfire/davdroid/ui/setup/AddAccountActivity.java | 2 +- dav4android | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2de9edcf..68f49f7c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -66,5 +66,5 @@ dependencies { compile project(':MemorizingTrustManager') - androidTestCompile 'com.squareup.okhttp:mockwebserver:2.7.1' + androidTestCompile 'com.squareup.okhttp:mockwebserver:2.7.2' } diff --git a/app/src/main/java/at/bitfire/davdroid/Constants.java b/app/src/main/java/at/bitfire/davdroid/Constants.java index 7f6fba64..9d5bb76f 100644 --- a/app/src/main/java/at/bitfire/davdroid/Constants.java +++ b/app/src/main/java/at/bitfire/davdroid/Constants.java @@ -14,9 +14,7 @@ import org.slf4j.LoggerFactory; public class Constants { public static final String - ACCOUNT_TYPE = "bitfire.at.davdroid", - WEB_URL_MAIN = "https://davdroid.bitfire.at/?pk_campaign=davdroid-app", - WEB_URL_HELP = "https://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app"; + ACCOUNT_TYPE = "bitfire.at.davdroid"; public static final Logger log = LoggerFactory.getLogger("davdroid"); @@ -28,5 +26,5 @@ public class Constants { NOTIFICATION_CALENDAR_SYNC = 11, NOTIFICATION_TASK_SYNC = 12; - public final static Uri donationUri = Uri.parse("https://davdroid.bitfire.at/donate?pk_campaign=davdroid-app"); + public final static Uri webUri = Uri.parse("https://davdroid.bitfire.at/?pk_campaign=davdroid-app"); } diff --git a/app/src/main/java/at/bitfire/davdroid/ui/DonateDialogFragment.java b/app/src/main/java/at/bitfire/davdroid/ui/DonateDialogFragment.java index ebb6d9a5..b28dd5bd 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/DonateDialogFragment.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/DonateDialogFragment.java @@ -33,7 +33,7 @@ public class DonateDialogFragment extends DialogFragment { .setPositiveButton(R.string.donate_now, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - startActivity(new Intent(Intent.ACTION_VIEW, Constants.donationUri)); + startActivity(new Intent(Intent.ACTION_VIEW, Constants.webUri.buildUpon().appendEncodedPath("donate/").build())); } }) .setNegativeButton(R.string.donate_later, new DialogInterface.OnClickListener() { diff --git a/app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java b/app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java index da5c05c8..8e4b3395 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/MainActivity.java @@ -119,7 +119,7 @@ public class MainActivity extends Activity { public void showWebsite(MenuItem item) { Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(Constants.WEB_URL_MAIN + "&pk_kwd=main-activity")); + intent.setData(Constants.webUri); startActivity(intent); } diff --git a/app/src/main/java/at/bitfire/davdroid/ui/setup/AddAccountActivity.java b/app/src/main/java/at/bitfire/davdroid/ui/setup/AddAccountActivity.java index 3cc9d5f9..23934f9a 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/setup/AddAccountActivity.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/setup/AddAccountActivity.java @@ -54,7 +54,7 @@ public class AddAccountActivity extends Activity { } public void showHelp(MenuItem item) { - startActivityForResult(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.WEB_URL_HELP + "&pk_kwd=add-account-activity")), 0); + startActivityForResult(new Intent(Intent.ACTION_VIEW, Constants.webUri.buildUpon().appendEncodedPath("configuration/").build()), 0); } } diff --git a/dav4android b/dav4android index f060f00f..adb19e52 160000 --- a/dav4android +++ b/dav4android @@ -1 +1 @@ -Subproject commit f060f00fe6ccf5e8a79690c8707cf2b1d98a3d17 +Subproject commit adb19e52298c11e1abc7d9aeee15380f835f1ba2