From 100b78a6a485b8daa264a1787b954751f7e9c842 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Thu, 24 Mar 2016 20:51:09 +0100 Subject: [PATCH] Version bump to 1.0-rc1 * fix migration bug (doesn't set read-only flag) * unify progress dialogs * improve debug info report styling --- app/build.gradle | 4 +- .../at/bitfire/davdroid/AccountSettings.java | 2 + .../at/bitfire/davdroid/model/ServiceDB.java | 9 ++-- .../davdroid/ui/CreateCollectionFragment.java | 11 ++-- .../davdroid/ui/DebugInfoActivity.java | 50 +++++++++---------- .../davdroid/ui/DeleteCollectionFragment.java | 11 ++-- .../davdroid/ui/StartupDialogFragment.java | 2 +- .../ui/setup/DetectConfigurationFragment.java | 13 +++-- app/src/main/res/values-de/strings.xml | 2 +- 9 files changed, 52 insertions(+), 52 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fef70a44..64841ec5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { minSdkVersion 14 targetSdkVersion 22 - versionCode 88 - versionName "1.0-beta1" + versionCode 89 + versionName "1.0-rc1" buildConfigField "long", "buildTime", System.currentTimeMillis() + "L" } diff --git a/app/src/main/java/at/bitfire/davdroid/AccountSettings.java b/app/src/main/java/at/bitfire/davdroid/AccountSettings.java index 65a20c66..2bd61e12 100644 --- a/app/src/main/java/at/bitfire/davdroid/AccountSettings.java +++ b/app/src/main/java/at/bitfire/davdroid/AccountSettings.java @@ -93,6 +93,8 @@ public class AccountSettings { .setContentTitle(context.getString(R.string.settings_version_update)) .setContentText(context.getString(R.string.settings_version_update_settings_updated)) .setSubText(context.getString(R.string.settings_version_update_install_hint)) + .setStyle(new NotificationCompat.BigTextStyle() + .bigText(context.getString(R.string.settings_version_update_settings_updated))) .setCategory(NotificationCompat.CATEGORY_SYSTEM) .setPriority(NotificationCompat.PRIORITY_HIGH) .setLocalOnly(true) diff --git a/app/src/main/java/at/bitfire/davdroid/model/ServiceDB.java b/app/src/main/java/at/bitfire/davdroid/model/ServiceDB.java index 9f6fc296..b33505fe 100644 --- a/app/src/main/java/at/bitfire/davdroid/model/ServiceDB.java +++ b/app/src/main/java/at/bitfire/davdroid/model/ServiceDB.java @@ -112,7 +112,7 @@ public class ServiceDB { Collections.ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + Collections.SERVICE_ID + " INTEGER NOT NULL REFERENCES " + Services._TABLE +" ON DELETE CASCADE," + Collections.URL + " TEXT NOT NULL," + - Collections.READ_ONLY + " INTEGER NOT NULL," + + Collections.READ_ONLY + " INTEGER DEFAULT 0 NOT NULL," + Collections.DISPLAY_NAME + " TEXT NULL," + Collections.DESCRIPTION + " TEXT NULL," + Collections.COLOR + " INTEGER NULL," + @@ -137,12 +137,12 @@ public class ServiceDB { @Cleanup Cursor cursorTables = db.query("sqlite_master", new String[] { "name" }, "type='table'", null, null, null, null); while (cursorTables.moveToNext()) { String table = cursorTables.getString(0); - sb.append("\t").append(table).append("\n"); + sb.append(table).append("\n"); @Cleanup Cursor cursor = db.query(table, null, null, null, null, null, null); // print columns int cols = cursor.getColumnCount(); - sb.append("\t\t| "); + sb.append("\t| "); for (int i = 0; i < cols; i++) { sb.append(" "); sb.append(cursor.getColumnName(i)); @@ -152,7 +152,7 @@ public class ServiceDB { // print rows while (cursor.moveToNext()) { - sb.append("\t\t| "); + sb.append("\t| "); for (int i = 0; i < cols; i++) { sb.append(" "); try { @@ -171,6 +171,7 @@ public class ServiceDB { } sb.append("\n"); } + sb.append("----------\n"); } db.endTransaction(); } diff --git a/app/src/main/java/at/bitfire/davdroid/ui/CreateCollectionFragment.java b/app/src/main/java/at/bitfire/davdroid/ui/CreateCollectionFragment.java index d86e7c3b..d962a747 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/CreateCollectionFragment.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/CreateCollectionFragment.java @@ -73,12 +73,13 @@ public class CreateCollectionFragment extends DialogFragment implements LoaderMa @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - Dialog dialog = new ProgressDialog.Builder(getContext()) - .setTitle(R.string.create_collection_creating) - .setMessage(R.string.please_wait) - .create(); + ProgressDialog progress = new ProgressDialog(getContext()); + progress.setTitle(R.string.create_collection_creating); + progress.setMessage(getString(R.string.please_wait)); + progress.setIndeterminate(true); + progress.setCanceledOnTouchOutside(false); setCancelable(false); - return dialog; + return progress; } diff --git a/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java b/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java index 8bd47cc1..40ad4ea0 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java @@ -34,6 +34,7 @@ import android.view.Menu; import android.view.MenuItem; import android.widget.TextView; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.text.WordUtils; import java.io.File; @@ -168,28 +169,27 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage // begin with most specific information if (phase != -1) - report.append("SYNCHRONIZATION INFO\nSynchronization phase: " + phase + "\n"); + report.append("SYNCHRONIZATION INFO\nSynchronization phase: ").append(phase).append("\n"); if (account != null) - report.append("Account name: " + account.name + "\n"); + report.append("Account name: ").append(account.name).append("\n"); if (authority != null) - report.append("Authority: " + authority + "\n"); + report.append("Authority: ").append(authority).append("\n"); if (exception instanceof HttpException) { HttpException http = (HttpException)exception; if (http.request != null) - report.append("\nHTTP REQUEST:\n" + http.request + "\n\n"); + report.append("\nHTTP REQUEST:\n").append(http.request).append("\n\n"); if (http.response != null) - report.append("HTTP RESPONSE:\n" + http.response + "\n"); + report.append("HTTP RESPONSE:\n").append(http.response).append("\n"); } - if (exception != null) { - report.append("\nSTACK TRACE:\n"); - report.append(Log.getStackTraceString(exception)); - report.append("\n"); - } + if (exception != null) + report .append("\nEXCEPTION:\n") + .append(ExceptionUtils.getMessage(exception)).append("\n") + .append(ExceptionUtils.getStackTrace(exception)); if (logs != null) - report.append("\nLOGS:\n" + logs + "\n"); + report.append("\nLOGS:\n").append(logs).append("\n"); try { PackageManager pm = getContext().getPackageManager(); @@ -199,30 +199,26 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage boolean workaroundInstalled = false; try { workaroundInstalled = pm.getPackageInfo("at.bitfire.davdroid.jbworkaround", 0) != null; - } catch(PackageManager.NameNotFoundException e) {} - report.append( - "\nSOFTWARE INFORMATION\n" + - "DAVdroid version: " + BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ") " + new Date(BuildConfig.buildTime) + "\n" + - "Installed from: " + installedFrom + "\n" + - "JB Workaround installed: " + (workaroundInstalled ? "yes" : "no") + "\n\n" - ); + } catch(PackageManager.NameNotFoundException ignored) {} + report.append("\nSOFTWARE INFORMATION\n" + + "DAVdroid version: ").append(BuildConfig.VERSION_NAME).append(" (").append(BuildConfig.VERSION_CODE).append(") ").append(new Date(BuildConfig.buildTime)).append("\n") + .append("Installed from: ").append(installedFrom).append("\n") + .append("JB Workaround installed: ").append(workaroundInstalled ? "yes" : "no").append("\n\n"); } catch(Exception ex) { App.log.log(Level.SEVERE, "Couldn't get software information", ex); } report.append( "CONFIGURATION\n" + - "System-wide synchronization: " + (ContentResolver.getMasterSyncAutomatically() ? "automatically" : "manually") + "\n" - ); + "System-wide synchronization: ").append(ContentResolver.getMasterSyncAutomatically() ? "automatically" : "manually").append("\n"); AccountManager accountManager = AccountManager.get(getContext()); for (Account acct : accountManager.getAccountsByType(Constants.ACCOUNT_TYPE)) { AccountSettings settings = new AccountSettings(getContext(), acct); report.append( - "Account: " + acct.name + "\n" + - " Address book sync. interval: " + syncStatus(settings, ContactsContract.AUTHORITY) + "\n" + - " Calendar sync. interval: " + syncStatus(settings, CalendarContract.AUTHORITY) + "\n" + - " OpenTasks sync. interval: " + syncStatus(settings, "org.dmfs.tasks") + "\n" - ); + "Account: ").append(acct.name).append("\n" + + " Address book sync. interval: ").append(syncStatus(settings, ContactsContract.AUTHORITY)).append("\n" + + " Calendar sync. interval: ").append(syncStatus(settings, CalendarContract.AUTHORITY)).append("\n" + + " OpenTasks sync. interval: ").append(syncStatus(settings, "org.dmfs.tasks")).append("\n"); } report.append("\n"); @@ -234,8 +230,8 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage try { report.append( "SYSTEM INFORMATION\n" + - "Android version: " + Build.VERSION.RELEASE + " (" + Build.DISPLAY + ")\n" + - "Device: " + WordUtils.capitalize(Build.MANUFACTURER) + " " + Build.MODEL + " (" + Build.DEVICE + ")\n\n" + "Android version: ").append(Build.VERSION.RELEASE).append(" (").append(Build.DISPLAY).append(")\n" + + "Device: ").append(WordUtils.capitalize(Build.MANUFACTURER)).append(" ").append(Build.MODEL).append(" (").append(Build.DEVICE).append(")\n\n" ); } catch (Exception ex) { App.log.log(Level.SEVERE, "Couldn't get system details", ex); diff --git a/app/src/main/java/at/bitfire/davdroid/ui/DeleteCollectionFragment.java b/app/src/main/java/at/bitfire/davdroid/ui/DeleteCollectionFragment.java index 46c3e3b5..4c9ec7e5 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/DeleteCollectionFragment.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/DeleteCollectionFragment.java @@ -53,12 +53,13 @@ public class DeleteCollectionFragment extends DialogFragment implements LoaderMa @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - Dialog dialog = new ProgressDialog.Builder(getContext()) - .setTitle(R.string.delete_collection_deleting_collection) - .setMessage(R.string.please_wait) - .create(); + ProgressDialog progress = new ProgressDialog(getContext()); + progress.setTitle(R.string.delete_collection_deleting_collection); + progress.setMessage(getString(R.string.please_wait)); + progress.setIndeterminate(true); + progress.setCanceledOnTouchOutside(false); setCancelable(false); - return dialog; + return progress; } diff --git a/app/src/main/java/at/bitfire/davdroid/ui/StartupDialogFragment.java b/app/src/main/java/at/bitfire/davdroid/ui/StartupDialogFragment.java index a27826f4..70d0bbd0 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/StartupDialogFragment.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/StartupDialogFragment.java @@ -55,7 +55,7 @@ public class StartupDialogFragment extends DialogFragment { @Cleanup ServiceDB.OpenHelper dbHelper = new ServiceDB.OpenHelper(context); Settings settings = new Settings(dbHelper.getReadableDatabase()); - if (BuildConfig.VERSION_NAME.contains("-alpha") || BuildConfig.VERSION_NAME.contains("-beta")) + if (BuildConfig.VERSION_NAME.contains("-alpha") || BuildConfig.VERSION_NAME.contains("-beta") || BuildConfig.VERSION_NAME.contains("-rc")) dialogs.add(StartupDialogFragment.instantiate(Mode.DEVELOPMENT_VERSION)); else { // store-specific information diff --git a/app/src/main/java/at/bitfire/davdroid/ui/setup/DetectConfigurationFragment.java b/app/src/main/java/at/bitfire/davdroid/ui/setup/DetectConfigurationFragment.java index c1fbfa17..76cb4860 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/setup/DetectConfigurationFragment.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/setup/DetectConfigurationFragment.java @@ -39,14 +39,13 @@ public class DetectConfigurationFragment extends DialogFragment implements Loade @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - ProgressDialog dialog = new ProgressDialog(getActivity()); - dialog.setCanceledOnTouchOutside(false); + ProgressDialog progress = new ProgressDialog(getActivity()); + progress.setTitle(R.string.login_configuration_detection); + progress.setMessage(getString(R.string.login_querying_server)); + progress.setIndeterminate(true); + progress.setCanceledOnTouchOutside(false); setCancelable(false); - - dialog.setTitle(R.string.login_configuration_detection); - dialog.setIndeterminate(true); - dialog.setMessage(getString(R.string.login_querying_server)); - return dialog; + return progress; } @Override diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index aab9880d..5a2ad545 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -23,7 +23,7 @@ OpenTasks installieren Lizenzbedingungen - Dieses Programm OHNE JEDE GEWÄHRLEISTUNG bereitgestellt. Es ist freie Software; Sie können es also unter bestimmten Bedingungen weiterverbreiten. + Dieses Programm wird OHNE JEDE GEWÄHRLEISTUNG bereitgestellt. Es ist freie Software – Sie können es also unter bestimmten Bedingungen weiterverbreiten. DAVdroid Datei-Protokollierung Protokollierung auf externen Speicher: %s