Version bump to 0.5.9

* GUI changes for read-only collections (new icons)
* require only bind, unbind and write-content privileges
pull/2/head
rfc2822 10 years ago
parent a12942c606
commit 8a02601cfc

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.bitfire.davdroid"
android:versionCode="29"
android:versionName="0.5.8.1" android:installLocation="internalOnly">
android:versionCode="30"
android:versionName="0.5.9" android:installLocation="internalOnly">
<uses-sdk
android:minSdkVersion="14"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -82,5 +82,6 @@
<string name="email_address">Dirección de correo:</string>
<string name="organizer_hint">"ORGANIZADOR de tus eventos; se necesita si se usa información de los asistentes"</string>
<string name="account_name_info">"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.</string>
<string name="read_only">sólo lectura</string>
</resources>

@ -89,5 +89,6 @@
<string name="organizer_hint">ORGANISATEUR de vos événements; nécessaire pour l\'information des participants</string>
<string name="account_name_info">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.</string>
<string name="read_only">Lecture seule</string>
</resources>

@ -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",

@ -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 = "<b>" + info.getTitle() + "</b>";
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 + "<br/>" + description));
}

@ -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 { }
}

@ -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)

Loading…
Cancel
Save