1
0
mirror of https://github.com/etesync/android synced 2024-11-15 20:38:58 +00:00

Remove add, share and delete restrictions on address books

Now that we have multiple address books support, we can share and delete
address books like we did calendars.
This commit is contained in:
Tom Hacohen 2017-04-21 20:31:08 +01:00
parent 2f95ddbda2
commit d6ace869fe
21 changed files with 31 additions and 36 deletions

View File

@ -100,6 +100,9 @@ public class AccountActivity extends AppCompatActivity implements Toolbar.OnMenu
// CardDAV toolbar
tbCardDAV = (Toolbar)findViewById(R.id.carddav_menu);
tbCardDAV.setOverflowIcon(icMenu);
tbCardDAV.inflateMenu(R.menu.carddav_actions);
tbCardDAV.setOnMenuItemClickListener(this);
tbCardDAV.setTitle(R.string.settings_carddav);
// CalDAV toolbar
@ -195,12 +198,18 @@ public class AccountActivity extends AppCompatActivity implements Toolbar.OnMenu
@Override
public boolean onMenuItemClick(MenuItem item) {
CollectionInfo info;
switch (item.getItemId()) {
case R.id.create_calendar:
CollectionInfo info = new CollectionInfo();
info = new CollectionInfo();
info.type = CollectionInfo.Type.CALENDAR;
startActivity(CreateCollectionActivity.newIntent(AccountActivity.this, account, info));
break;
case R.id.create_addressbook:
info = new CollectionInfo();
info.type = CollectionInfo.Type.ADDRESS_BOOK;
startActivity(CreateCollectionActivity.newIntent(AccountActivity.this, account, info));
break;
}
return false;
}

View File

@ -54,8 +54,10 @@ public class CreateCollectionActivity extends AppCompatActivity {
setContentView(R.layout.activity_create_collection);
final EditText displayName = (EditText) findViewById(R.id.display_name);
if (info.type == CollectionInfo.Type.CALENDAR) {
setTitle(R.string.create_calendar);
displayName.setHint(R.string.create_calendar_display_name_hint);
final View colorSquare = findViewById(R.id.color);
colorSquare.setOnClickListener(new View.OnClickListener() {
@ -75,6 +77,7 @@ public class CreateCollectionActivity extends AppCompatActivity {
});
} else {
setTitle(R.string.create_addressbook);
displayName.setHint(R.string.create_addressbook_display_name_hint);
final View colorGroup = findViewById(R.id.color_group);
colorGroup.setVisibility(View.GONE);

View File

@ -59,11 +59,7 @@ public class EditCollectionActivity extends CreateCollectionActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (info.type == CollectionInfo.Type.ADDRESS_BOOK) {
getMenuInflater().inflate(R.menu.activity_create_collection, menu);
} else {
getMenuInflater().inflate(R.menu.activity_edit_collection, menu);
}
getMenuInflater().inflate(R.menu.activity_edit_collection, menu);
return true;
}

View File

@ -193,19 +193,7 @@ public class ViewCollectionActivity extends AppCompatActivity implements Refresh
}
public void onManageMembers(MenuItem item) {
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 (info.version < 2) {
if (info.version < 2) {
AlertDialog dialog = new AlertDialog.Builder(this)
.setIcon(R.drawable.ic_info_dark)
.setTitle(R.string.not_allowed_title)

View File

@ -10,6 +10,6 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/create_calendar"
android:title="@string/account_create_new_calendar"/>
android:title="@string/create_calendar"/>
</menu>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright © 2013 2016 Ricki Hirner (bitfire web engineering).
~ All rights reserved. This program and the accompanying materials
~ are made available under the terms of the GNU Public License v3.0
~ which accompanies this distribution, and is available at
~ http://www.gnu.org/licenses/gpl.html
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/create_addressbook"
android:title="@string/create_addressbook"/>
</menu>

View File

@ -57,7 +57,6 @@
<string name="account_delete">Smazat účet</string>
<string name="account_delete_confirmation_title">Opravdu smazat účet?</string>
<string name="account_delete_confirmation_text">Všechny místní kopie adresáře, kalendářů a úkolů budou smazány.</string>
<string name="account_create_new_calendar">Vytvořit nový kalendář</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Oprávnění pro kalendáře</string>
<string name="permissions_calendar_request">Vyžádat oprávnění kalendáře</string>

View File

@ -44,7 +44,6 @@
<string name="account_delete">Slet konto</string>
<string name="account_delete_confirmation_title">Ønsker du at slette konto?</string>
<string name="account_delete_confirmation_text">Alle lokale kopier af addessebøger, kalendere og opgavelister vil blive slettet.</string>
<string name="account_create_new_calendar">Opret ny kalender</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Kalenderadgange</string>
<string name="permissions_calendar_request">Anmod om kalenderadgang</string>

View File

@ -78,7 +78,6 @@
<string name="account_delete">Konto löschen</string>
<string name="account_delete_confirmation_title">Konto wirklich löschen?</string>
<string name="account_delete_confirmation_text">Alle lokalen gespeicherten Kopien von Addressbüchern, Kalendern und Aufgabenlisten werden gelöscht.</string>
<string name="account_create_new_calendar">Neuen Kalender erstellen</string>
<string name="account_delete_collection_last_title">Letzte Sammlung kann nicht gelöscht werden</string>
<string name="account_delete_collection_last_text">Die letzte Sammlung kann nicht gelöscht werden, bitte erstellen Sie eine neue Sammlung wenn Sie diese löschen wollen.</string>

View File

@ -57,7 +57,6 @@
<string name="account_delete">Eliminar cuenta</string>
<string name="account_delete_confirmation_title">¿Seguro que deseas eliminar la cuenta?</string>
<string name="account_delete_confirmation_text">Todas las copias locales de tus contactos, calendarios y tareas serán eliminadas.</string>
<string name="account_create_new_calendar">Crear nuevo calendario</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Permisos de calendario</string>
<string name="permissions_calendar_request">Solicitar permisos sobre calendario</string>

View File

@ -57,7 +57,6 @@
<string name="account_delete">Supprimer le compte</string>
<string name="account_delete_confirmation_title">Voulez-vous vraiment supprimer le compte?</string>
<string name="account_delete_confirmation_text">Toutes les copies locales des carnets d\'adresses, des calendriers et des listes de tâches seront supprimées.</string>
<string name="account_create_new_calendar">Créer un nouveau calendrier</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Autorisations calendrier</string>
<string name="permissions_calendar_request">Demande d\'autorisations d\'accéder au calendrier</string>

View File

@ -57,7 +57,6 @@
<string name="account_delete">Fiók törlése</string>
<string name="account_delete_confirmation_title">Valóban törölni akarja a fiókot?</string>
<string name="account_delete_confirmation_text">Az összes címjegyzék, naptár és feladatlista helyi példányai törölve lesznek.</string>
<string name="account_create_new_calendar">Új naptár létrehozása</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Naptárengedély</string>
<string name="permissions_calendar_request">Naptárhozzáférés igénylése</string>

View File

@ -55,7 +55,6 @@
<string name="account_delete">Elimina account</string>
<string name="account_delete_confirmation_title">Cancellare l\'account?</string>
<string name="account_delete_confirmation_text">Tutte le copie locali delle rubriche, dei calendari e degli elenchi attività verranno eliminate.</string>
<string name="account_create_new_calendar">Crea nuovo calendario</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Permessi calendario</string>
<string name="permissions_calendar_request">Richiesta autorizzazione al calendario</string>

View File

@ -57,7 +57,6 @@
<string name="account_delete">アカウントを削除</string>
<string name="account_delete_confirmation_title">アカウントを削除してもよろしいですか?</string>
<string name="account_delete_confirmation_text">アドレス帳、カレンダー、タスクリストのローカルコピーがすべて削除されます。</string>
<string name="account_create_new_calendar">新しいカレンダーを作成</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">カレンダー アクセス許可</string>
<string name="permissions_calendar_request">カレンダー アクセス許可の要求</string>

View File

@ -51,7 +51,6 @@
<string name="account_delete">Account verwijderen</string>
<string name="account_delete_confirmation_title">Account echt verwijderen?</string>
<string name="account_delete_confirmation_text">Alle lokale kopieën van adresboeken, agenda\'s en taken worden verwijderd.</string>
<string name="account_create_new_calendar">Maak een nieuwe agenda</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Agenda rechten</string>
<string name="permissions_calendar_request">Agenda rechten verkrijgen</string>

View File

@ -57,7 +57,6 @@
<string name="account_delete">Usuń konto</string>
<string name="account_delete_confirmation_title">Naprawdę chcesz usunąć konto?</string>
<string name="account_delete_confirmation_text">Wszystkie lokalne kopie książek adresowych, kalendarzy i list zadań zostaną usunięte.</string>
<string name="account_create_new_calendar">Stwórz nowy kalendarz</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Uprawnienia kalendarza</string>
<string name="permissions_calendar_request">Zezwól na uprawnienia kalendarza</string>

View File

@ -57,7 +57,6 @@
<string name="account_delete">Excluir conta</string>
<string name="account_delete_confirmation_title">Deseja excluir a conta?</string>
<string name="account_delete_confirmation_text">Todas as cópias locais dos livros de endereços, calendários e listas de tarefas serão excluídas.</string>
<string name="account_create_new_calendar">Criar novo calendário</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Permissões do calendário</string>
<string name="permissions_calendar_request">Solicitar permissão do calendário</string>

View File

@ -57,7 +57,6 @@
<string name="account_delete">Обриши налог</string>
<string name="account_delete_confirmation_title">Заиста обрисати налог?</string>
<string name="account_delete_confirmation_text">Све локалне копије адресара, календара и листи задатака ће бити обрисане.</string>
<string name="account_create_new_calendar">Направи нови календар</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Дозволе за календар</string>
<string name="permissions_calendar_request">Захтевај дозволе за календар</string>

View File

@ -44,7 +44,6 @@
<string name="account_delete">Hesabı sil</string>
<string name="account_delete_confirmation_title">Hesap gerçekten silinsin mi?</string>
<string name="account_delete_confirmation_text">Rehber, takvim ve iş listelerinin tüm yerel kopyaları silinecektir.</string>
<string name="account_create_new_calendar">Yeni takvim oluştur</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">Takvim izinleri</string>
<string name="permissions_calendar_request">Takvim izinleri iste</string>

View File

@ -57,7 +57,6 @@
<string name="account_delete">删除账户</string>
<string name="account_delete_confirmation_title">真的要删除账户吗?</string>
<string name="account_delete_confirmation_text">所有通讯录、日历和任务列表的本机存储将被删除。</string>
<string name="account_create_new_calendar">创建日历</string>
<!--PermissionsActivity-->
<string name="permissions_calendar">日历权限</string>
<string name="permissions_calendar_request">请求日历权限</string>

View File

@ -98,7 +98,6 @@
<string name="account_show_fingerprint">Show Fingerprint</string>
<string name="account_delete_confirmation_title">Really delete account?</string>
<string name="account_delete_confirmation_text">All local copies of address books, calendars and task lists will be deleted.</string>
<string name="account_create_new_calendar">Create new calendar</string>
<string name="account_delete_collection_last_title">Can\'t delete last collection</string>
<string name="account_delete_collection_last_text">Deleting the last collection is not allowed, please create a new one if you\'d like to delete this one.</string>
<string name="account_showcase_view_collection">You can click on an item to view the collection. From there you can view the journal, import, and much more...</string>
@ -112,7 +111,6 @@
<string name="members_owner_only">Only the owner of this collection (%s) is allowed to view its members.</string>
<string name="not_allowed_title">Not Allowed</string>
<string name="edit_owner_only">Only the owner of this collection (%s) is allowed to edit it.</string>
<string name="members_address_book_not_allowed">Sharing of address books is currently not supported.</string>
<string name="members_old_journals_not_allowed">Sharing of old-style journals is not allowed. In order to share this journal, create a new one, and copy its contents over using the \"import\" dialog. If you are experiencing any issues, please contact support.</string>
<!-- CollectionMembers -->