From f3e83922f79ab62a7c98aff2f3e66231c510e867 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Tue, 26 May 2015 23:43:05 +0200 Subject: [PATCH] Version bump to 0.8.0-beta3 * don't offer to install Tasks from InstallAppsFragment, show instructions instead * fix crash when displaying "todo lists" heading in "selection collections" fragment (fixes #512, fixes #513) * use Android SDK build tools v22.0.1 --- app/src/main/AndroidManifest.xml | 2 +- .../java/at/bitfire/davdroid/Constants.java | 2 +- .../davdroid/resource/LocalCalendar.java | 4 -- .../ui/setup/InstallAppsFragment.java | 39 ++++++------------- .../ui/setup/SelectCollectionsAdapter.java | 8 ++-- .../main/res/layout/setup_install_apps.xml | 10 +---- .../setup_task_lists_heading.xml | 0 app/src/main/res/values-de/strings.xml | 12 +++++- app/src/main/res/values/strings.xml | 12 +++++- lib/httpclient-android/build.gradle | 2 +- 10 files changed, 40 insertions(+), 51 deletions(-) rename app/src/main/res/{layout-sw720dp => layout}/setup_task_lists_heading.xml (100%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c8872b9f..f92d8389 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,7 +9,7 @@ { protected Builder buildEntry(Builder builder, Resource resource, boolean update) { final Event event = (Event)resource; - if (!update) - builder .withValue(Events.ACCOUNT_TYPE, account.type) - .withValue(Events.ACCOUNT_NAME, account.name); - builder .withValue(Events.CALENDAR_ID, id) .withValue(Events.ALL_DAY, event.isAllDay() ? 1 : 0) .withValue(Events.DTSTART, event.getDtStartInMillis()) diff --git a/app/src/main/java/at/bitfire/davdroid/ui/setup/InstallAppsFragment.java b/app/src/main/java/at/bitfire/davdroid/ui/setup/InstallAppsFragment.java index 334acfce..a5beaa41 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/setup/InstallAppsFragment.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/setup/InstallAppsFragment.java @@ -19,6 +19,8 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.Handler; +import android.text.Html; +import android.text.method.LinkMovementMethod; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; @@ -28,19 +30,23 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import at.bitfire.davdroid.Constants; import at.bitfire.davdroid.R; import at.bitfire.davdroid.resource.LocalTaskList; -public class InstallAppsFragment extends Fragment implements Runnable { +public class InstallAppsFragment extends Fragment { private static final String TAG = "davdroid.setup"; - final protected Handler timerHandler = new Handler(); - + // https://code.google.com/p/android/issues/detail?id=25906 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.setup_install_apps, container, false); setHasOptionsMenu(true); + TextView tvInfo = (TextView)v.findViewById(R.id.setup_install_tasks_app); + tvInfo.setText(Html.fromHtml(getString(R.string.setup_install_tasks_app_html))); + tvInfo.setMovementMethod(LinkMovementMethod.getInstance()); + return v; } @@ -49,23 +55,11 @@ public class InstallAppsFragment extends Fragment implements Runnable { inflater.inflate(R.menu.only_skip, menu); } - @Override - public void onResume() { - super.onResume(); - timerHandler.postDelayed(this, 1000); - } - - @Override - public void onPause() { - super.onPause(); - timerHandler.removeCallbacks(this); - } - @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.skip: - skip(true); + skip(); break; default: return false; @@ -73,20 +67,9 @@ public class InstallAppsFragment extends Fragment implements Runnable { return true; } - @Override - public void run() { - if (LocalTaskList.isAvailable(getActivity())) - skip(false); - else - timerHandler.postDelayed(this, 1000); - } - - protected void skip(boolean addToBackStack) { + protected void skip() { FragmentManager fm = getFragmentManager(); - if (!addToBackStack) - fm.popBackStack(); - getFragmentManager().beginTransaction() .replace(R.id.right_pane, new SelectCollectionsFragment()) .addToBackStack(null) diff --git a/app/src/main/java/at/bitfire/davdroid/ui/setup/SelectCollectionsAdapter.java b/app/src/main/java/at/bitfire/davdroid/ui/setup/SelectCollectionsAdapter.java index cc5bda91..0bb90a2a 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/setup/SelectCollectionsAdapter.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/setup/SelectCollectionsAdapter.java @@ -56,11 +56,11 @@ public class SelectCollectionsAdapter extends BaseAdapter implements ListAdapter this.context = context; this.serverInfo = serverInfo; - nAddressBooks = serverInfo.getAddressBooks() == null ? 0 : serverInfo.getAddressBooks().size(); + nAddressBooks = serverInfo.getAddressBooks().size(); nAddressBookHeadings = nAddressBooks == 0 ? 0 : 1; - nCalendars = serverInfo.getCalendars() == null ? 0 : serverInfo.getCalendars().size(); + nCalendars = serverInfo.getCalendars().size(); nCalendarHeadings = nCalendars == 0 ? 0 : 1; - nTaskLists = serverInfo.getTodoLists() == null ? 0 : serverInfo.getTodoLists().size(); + nTaskLists = serverInfo.getTodoLists().size(); nTaskListHeadings = nTaskLists == 0 ? 0 : 1; } @@ -83,7 +83,7 @@ public class SelectCollectionsAdapter extends BaseAdapter implements ListAdapter return serverInfo.getCalendars().get(position - (nAddressBookHeadings + nAddressBooks + nCalendarHeadings)); else if (position >= (nAddressBookHeadings + nAddressBooks + nCalendarHeadings + nCalendars + nTaskListHeadings) && - (position < (nAddressBookHeadings + nAddressBooks + nCalendarHeadings + nCalendars + + nTaskListHeadings + nTaskLists))) + (position < (nAddressBookHeadings + nAddressBooks + nCalendarHeadings + nCalendars + nTaskListHeadings + nTaskLists))) return serverInfo.getTodoLists().get(position - (nAddressBookHeadings + nAddressBooks + nCalendarHeadings + nCalendars + nTaskListHeadings)); return null; diff --git a/app/src/main/res/layout/setup_install_apps.xml b/app/src/main/res/layout/setup_install_apps.xml index 4189256d..90d10bf8 100644 --- a/app/src/main/res/layout/setup_install_apps.xml +++ b/app/src/main/res/layout/setup_install_apps.xml @@ -30,16 +30,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" - android:text="@string/setup_install_tasks_app_info" + android:id="@+id/setup_install_tasks_app" + android:text="@string/setup_install_tasks_app_html" android:textAppearance="?android:attr/textAppearanceMedium" /> -