diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 44038ff1..57063424 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="30" + android:versionName="0.5.9" android:installLocation="internalOnly"> Dirección de correo: "ORGANIZADOR de tus eventos; se necesita si se usa información de los asistentes" "Usa tu dirección de correo electrónico como nombre de cuenta porque Android usará el nombre de cuenta como campo de ORGANIZADOR para los eventos que crees. No puedes tener dos cuentas con el mismo nombre. + sólo lectura diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 662f3fad..640c200c 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -89,5 +89,6 @@ ORGANISATEUR de vos événements; nécessaire pour l\'information des participants Utilisez votre adresse email en tant que nom de compte car Android utilise ce nom pour le champ ORGANISATEUR des évènements que vous créez." Vous ne pouvez pas avoir deux comptes du même nom. + Lecture seule diff --git a/src/at/bitfire/davdroid/Constants.java b/src/at/bitfire/davdroid/Constants.java index 7c50021b..17274cd8 100644 --- a/src/at/bitfire/davdroid/Constants.java +++ b/src/at/bitfire/davdroid/Constants.java @@ -12,7 +12,7 @@ package at.bitfire.davdroid; public class Constants { public static final String - APP_VERSION = "0.5.8.1-alpha", + APP_VERSION = "0.5.9-alpha", ACCOUNT_TYPE = "bitfire.at.davdroid", diff --git a/src/at/bitfire/davdroid/syncadapter/SelectCollectionsAdapter.java b/src/at/bitfire/davdroid/syncadapter/SelectCollectionsAdapter.java index 33e03de4..fa311fbf 100644 --- a/src/at/bitfire/davdroid/syncadapter/SelectCollectionsAdapter.java +++ b/src/at/bitfire/davdroid/syncadapter/SelectCollectionsAdapter.java @@ -100,44 +100,42 @@ public class SelectCollectionsAdapter extends BaseAdapter implements ListAdapter break; case TYPE_ADDRESS_BOOKS_ROW: convertView = inflater.inflate(android.R.layout.simple_list_item_single_choice, null); - prepareRowView((CheckedTextView)convertView, R.drawable.addressbook); break; case TYPE_CALENDARS_HEADING: convertView = inflater.inflate(R.layout.calendars_heading, parent, false); break; case TYPE_CALENDARS_ROW: convertView = inflater.inflate(android.R.layout.simple_list_item_multiple_choice, null); - prepareRowView((CheckedTextView)convertView, R.drawable.calendar); } } // step 2: fill view with content switch (getItemViewType(position)) { case TYPE_ADDRESS_BOOKS_ROW: - setContent((CheckedTextView)convertView, (ServerInfo.ResourceInfo)getItem(position)); + setContent((CheckedTextView)convertView, R.drawable.addressbook, (ServerInfo.ResourceInfo)getItem(position)); break; case TYPE_CALENDARS_ROW: - setContent((CheckedTextView)convertView, (ServerInfo.ResourceInfo)getItem(position)); + setContent((CheckedTextView)convertView, R.drawable.calendar, (ServerInfo.ResourceInfo)getItem(position)); } return convertView; } - protected void prepareRowView(CheckedTextView view, int resIcon) { + protected void setContent(CheckedTextView view, int collectionIcon, ServerInfo.ResourceInfo info) { + // set layout and icons view.setPadding(10, 10, 10, 10); - view.setCompoundDrawablesWithIntrinsicBounds(resIcon, 0, 0, 0); + view.setCompoundDrawablesWithIntrinsicBounds(collectionIcon, 0, info.isReadOnly() ? R.drawable.ic_read_only : 0, 0); view.setCompoundDrawablePadding(10); - } - - protected void setContent(CheckedTextView view, ServerInfo.ResourceInfo info) { - String description = info.getDescription(); - if (description == null) - description = info.getPath(); + // set text String title = "" + info.getTitle() + ""; if (info.isReadOnly()) title = title + " (" + context.getString(R.string.read_only) + ")"; + String description = info.getDescription(); + if (description == null) + description = info.getPath(); + // FIXME escape HTML view.setText(Html.fromHtml(title + "
" + description)); } diff --git a/src/at/bitfire/davdroid/webdav/DavProp.java b/src/at/bitfire/davdroid/webdav/DavProp.java index 762076c5..fd090d86 100644 --- a/src/at/bitfire/davdroid/webdav/DavProp.java +++ b/src/at/bitfire/davdroid/webdav/DavProp.java @@ -90,11 +90,23 @@ public class DavProp { @Element(required=false) @Getter private PrivAll all; + @Element(required=false) + @Getter private PrivBind bind; + + @Element(required=false) + @Getter private PrivUnbind unbind; + @Element(required=false) @Getter private PrivWrite write; + @Element(required=false,name="write-content") + @Getter private PrivWriteContent writeContent; + public static class PrivAll { } + public static class PrivBind { } + public static class PrivUnbind { } public static class PrivWrite { } + public static class PrivWriteContent { } } diff --git a/src/at/bitfire/davdroid/webdav/WebDavResource.java b/src/at/bitfire/davdroid/webdav/WebDavResource.java index fd0d5939..33182e27 100644 --- a/src/at/bitfire/davdroid/webdav/WebDavResource.java +++ b/src/at/bitfire/davdroid/webdav/WebDavResource.java @@ -424,12 +424,20 @@ public class WebDavResource { if (prop.currentUserPrivilegeSet != null) { // privilege info available - boolean hasWrite = false; + boolean mayAll = false, + mayBind = false, + mayUnbind = false, + mayWrite = false, + mayWriteContent = false; for (DavProp.DavPropPrivilege privilege : prop.currentUserPrivilegeSet) { - if (privilege.getAll() != null || privilege.getWrite() != null) - hasWrite = true; + if (privilege.getAll() != null) mayAll = true; + if (privilege.getBind() != null) mayBind = true; + if (privilege.getUnbind() != null) mayUnbind = true; + if (privilege.getWrite() != null) mayWrite = true; + if (privilege.getWriteContent() != null) mayWriteContent = true; } - if (!hasWrite) properties.put(Property.READ_ONLY, "1"); + if (!mayAll && !mayWrite && !(mayWriteContent && mayBind && mayUnbind)) + properties.put(Property.READ_ONLY, "1"); } if (prop.addressbookHomeSet != null && prop.addressbookHomeSet.getHref() != null)