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" /> -