From d3057f86f03b645afa827d83650233e697a07910 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 19 Apr 2017 16:24:24 +0100 Subject: [PATCH] Disallow sharing of address books. At the moment we only support one address book per user, and sharing address books will interfere with this model. Hopefully, we'll add multiple address book support in the next release, and then we'll re-enable this. --- .../syncadapter/ui/ViewCollectionActivity.java | 14 +++++++++++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/ViewCollectionActivity.java b/app/src/main/java/com/etesync/syncadapter/ui/ViewCollectionActivity.java index 34f6fb77..a7ecf66c 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/ViewCollectionActivity.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/ViewCollectionActivity.java @@ -188,7 +188,19 @@ public class ViewCollectionActivity extends AppCompatActivity implements Refresh } public void onManageMembers(MenuItem item) { - if (isOwner) { + if (info.type.equals(CollectionInfo.Type.ADDRESS_BOOK)) { + AlertDialog dialog = new AlertDialog.Builder(this) + .setIcon(R.drawable.ic_info_dark) + .setTitle(R.string.not_allowed_title) + .setMessage(R.string.members_address_book_not_allowed) + .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + + } + }).create(); + dialog.show(); + } else if (isOwner) { startActivity(CollectionMembersActivity.newIntent(this, account, info)); } else { AlertDialog dialog = new AlertDialog.Builder(this) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 79ae6a1c..ccde4449 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -106,6 +106,7 @@ Only the owner of this collection (%s) is allowed to view its members. Not Allowed Only the owner of this collection (%s) is allowed to edit it. + Sharing of address books is currently not supported. Members