From 8a02601cfc5dc6ac37d0d6f71427fd4d353c99fa Mon Sep 17 00:00:00 2001 From: rfc2822 Date: Sun, 9 Mar 2014 17:55:16 +0100 Subject: [PATCH] Version bump to 0.5.9 * GUI changes for read-only collections (new icons) * require only bind, unbind and write-content privileges --- AndroidManifest.xml | 4 ++-- res/drawable-hdpi/ic_read_only.png | Bin 0 -> 1438 bytes res/drawable-mdpi/ic_read_only.png | Bin 0 -> 868 bytes res/drawable-xhdpi/ic_read_only.png | Bin 0 -> 1895 bytes res/drawable-xxhdpi/ic_read_only.png | Bin 0 -> 2037 bytes res/values-es/strings.xml | 1 + res/values-fr/strings.xml | 1 + src/at/bitfire/davdroid/Constants.java | 2 +- .../syncadapter/SelectCollectionsAdapter.java | 22 ++++++++---------- src/at/bitfire/davdroid/webdav/DavProp.java | 12 ++++++++++ .../davdroid/webdav/WebDavResource.java | 16 +++++++++---- 11 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 res/drawable-hdpi/ic_read_only.png create mode 100644 res/drawable-mdpi/ic_read_only.png create mode 100644 res/drawable-xhdpi/ic_read_only.png create mode 100644 res/drawable-xxhdpi/ic_read_only.png 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"> 2;5i=~v_D4dD3^a7PqE*%(@gs2oGHr%8jpkSgV`eJ-CA(1y9NPJQs zcoKsqctH^nFik)npenNT&`_YY^ujH}04E;vpaAc0^ zng0rV97cZj8(ULYehy2S61ChxirJAsBCV5ZDxHp>OiJszsmd z7F`&mp^(8Yt1lsdBh-9XC?6ZOcJrb~o+0{J!ekbRQjXKeZ1R~a?#PRxjA^9vnQR}! zDjo}EeyuH|*qyUdJ8yP?o+iqLpS$vs_=#EMA*iH@Mi!Duv1p`~dKx(HH4R^)G}OLl z2{YWisMngzPVp*lu#|FfPxe^9iwM;eQp!m>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hU8mnLYlIP%Ko%9;Py< z)1FqWW3ke_&q6RN919gn{L^GmjIc$&KZO9CcGeRjRQbNA;;J^VmauH!<1$a{OT|Z4 ztaR_QES!&EVXk`W;5$<|9XlI&oMC*3oOG~UwKTLeKy`9>${3Jy93@49>y$-3>z`LM zRaL-^G9HR*+$O|;GfQ8~{%+&TL>5)$T45HFJeE8=X$G9R{6H20)iSvP$CX&uB3tToYEXpShN5IG4JlL68U z)8@={lh)@-%b1Am!GvK{y z$3sp0JU%f#3u6Olr#2_`X0c2Tnqe?nMp&8+$2eQ{+oK!5hw{)s*T8bS!@D+tEpTSD zG7$3_>Uhq1z$ph#W?`rJ(SOWCGQ}o-98$EFx7=wHiGj~>GcVLKe4WPtGYTNiPd+dY zko1$Ad7j|pG?S#;SRw!?!J^2V&u~BJG^bEO?{h$WiDyGg%Xn$*7d_DoG-jvSFblPg z059izpCjL6YY4u}@7<;nf>7G28AExRIVLHW*`xalbkH4n88M&L(HRkotbk82RzFjQ zCHwSn?mLdi4!VmOc^R=HsyaphkcVlGIQuMaagG=C?@X$wIikZZW8L^H<64Uzvem?KL6sVesS{O3|z%CIV^PZXwnpj0ePGT5_I!h zw(Db4@zKJ=?jpe|6tIu>WPbq$oH$S7@fUrSDHT`oG~dnlKEDFQoC-b^ai_cAb{Fv9 h6jyOa?#Tb9{2OSllaQM4uAl$_002ovPDHLkV1mYKcDn!o literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_read_only.png b/res/drawable-xxhdpi/ic_read_only.png new file mode 100644 index 0000000000000000000000000000000000000000..6ce79f8680d602fcd42f5e6808cc73d105a46b5e GIT binary patch literal 2037 zcmVU*sWPNKYUG1*8m%ucs8(|T);0i_Tr58a~t%n};;2uQq;K55T zy?E%QN_(haK|Cnvit(`iiNp-1hc0!X2D-DnR68xilBm(HhfHQO$^7}vzpY5#ab}Wz zpS<^dzxR8;Szv5q8{62%Hny?dJxh2$QcPCw?1U?F9y7=R*uVx5+#zT!QBu5#l3hLZ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)u8e>vQH0M+87JDx(^9Y+*|BS6P62_TIuvdAKB>}Yk%0fpPT@I&$m$7x=OCz!&Iv3q_~BGoHdnK`WAI87+-mG3BdV#5s@sY#V2kcJ&GlJ0b)w zs)8v*qpyTzXrll61#6b6|ET+?dy4ThoR1Vh&SSyma&7>j!xd7Iv#Cj@`(D$$U|LA| z5U?!*speZJI%Nh9E^OS710fkez!ov%ZFy#3d*b1~*C@=toRfhBY}uA$MP89}Hlrz9 z_l;3lWO5b(@a{injAt|v_YH*O_`wn3eDO$R8gLNsu>H*yfV*aE;p%>rT1W*J@bG-6 zcP!UMUc~+A5K^83enBvny<@qXC;%evM}^=4Ku1Ojqhkzs4d55#G?lqiO zz6dv<4TInUKnosQ6&;`9yz-;JoR1p84d7K50oQRsxyX%hgIS*l>gF{c0P>7^emk5r zt2n2uv5v^i6#@8WO5NNVzPQU*3#a0HKZnr%t-4wS-ocY2H?H9nKDYaCs+6FB+o<7; zQVuKDfKj-HQ~03zhu!nL1UgV1pW;#!ljML=aB<%mpr8L0e6Oh3VY48(y6=!e@(dQC z<7=E#DshO_M|Dq_WFa1vj-yZ;}zVy?IwV;kGp#x}OG{h#e$Zv5A! T&KWc200000NkvXXu0mjfH;u0r literal 0 HcmV?d00001 diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index b9de3256..4a6cb940 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -82,5 +82,6 @@ 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)