allow toggling contact Favorite state from the View screen too

This commit is contained in:
tibbi 2020-10-26 15:52:46 +01:00
parent 75b54e1d18
commit 9ad96061a9
33 changed files with 14 additions and 34 deletions

View file

@ -275,11 +275,23 @@ class ViewContactActivity : ContactActivity() {
private fun setupFavorite() {
contact_toggle_favorite.apply {
beVisible()
setImageDrawable(getStarDrawable(contact!!.starred == 1))
tag = contact!!.starred
setImageDrawable(getStarDrawable(tag == 1))
applyColorFilter(config.textColor)
setOnClickListener {
toast(R.string.must_be_at_edit)
val newIsStarred = if (tag == 1) 0 else 1
ensureBackgroundThread {
val contacts = arrayListOf(contact!!)
if (newIsStarred == 1) {
ContactsHelper(context).addFavorites(contacts)
} else {
ContactsHelper(context).removeFavorites(contacts)
}
}
contact!!.starred = newIsStarred
tag = contact!!.starred
setImageDrawable(getStarDrawable(tag == 1))
}
}
}

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">يبدو أنك لم تضف أية جهة اتصال مفضلة حتى الآن.</string>
<string name="must_be_at_edit">يجب أن تكون في شاشة التعديل لتعديل جهة اتصال</string>
<!-- Search -->
<string name="search_contacts">بحث في جهات الاتصال</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Görünür, hələlik heçbir sevimli kontakt əlavə etməmisiniz.</string>
<string name="must_be_at_edit">Kontaktı dəyişmək üçün İdarə et ekranında olmalısınız</string>
<!-- Search -->
<string name="search_contacts">Kontaktları axtar</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Vypadá to, že jste ještě nepřidali žádné oblíbené kontakty.</string>
<string name="must_be_at_edit">Pro úpravu kontaktu musíte být v Editoru kontaktu</string>
<!-- Search -->
<string name="search_contacts">Hledat v kontaktech</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Ymddangosir nad wyt wedi ychwanegu unrhyw ffefrynnau eto.</string>
<string name="must_be_at_edit">Rhaid bod ar y sgrin golygu er mwyn addasu cyswllt</string>
<!-- Search -->
<string name="search_contacts">Chwilio\'r cysylltiadau</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Det ser ud til, at du ikke har tilføjet nogen favoritkontakter endnu.</string>
<string name="must_be_at_edit">Du skal være på skærmen Rediger for at ændre en kontakt</string>
<!-- Search -->
<string name="search_contacts">Søg kontakter</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Anscheinend haben Sie bisher keine Kontakte zu den Favoriten hinzugefügt.</string>
<string name="must_be_at_edit">Sie müssen sich im Bearbeitungsmodus befinden, um einen Kontakt zu bearbeiten.</string>
<!-- Search -->
<string name="search_contacts">Kontakte durchsuchen</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Φαίνεται ότι δεν έχετε προσθέσει αγαπημένες επαφές ακόμη.</string>
<string name="must_be_at_edit">Πρέπει να είστε στην οθόνη "Επεξεργασία" για να τροποποιήσετε μια επαφή</string>
<!-- Search -->
<string name="search_contacts">Αναζήτηση επαφών</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Parece que aún no has añadido ningún contacto favorito.</string>
<string name="must_be_at_edit">Debes estar en la Pantalla de Edición para modificar un contacto</string>
<!-- Search -->
<string name="search_contacts">Buscar contactos</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Ez duzu oraindik gogokorik gehitu.</string>
<string name="must_be_at_edit">Kontaktu bat aldatzeko edizio pantailan egon behar zara</string>
<!-- Search -->
<string name="search_contacts">Bilatu kontaktuak</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Ei suosikkeja</string>
<string name="must_be_at_edit">Täytyy olla muokkaustilassa</string>
<!-- Search -->
<string name="search_contacts">Etsi yhteystietoja</string>

View file

@ -72,7 +72,6 @@
<!-- Favorites -->
<string name="no_favorites">Il semble que vous n\avez pas encore ajouté de contacts favoris</string>
<string name="must_be_at_edit">Vous devez être sur l\écran Modifier pour modifier un contact</string>
<!-- Search -->
<string name="search_contacts">Chercher dans les contacts</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Čini se da još niste dodali nijedan kontakt u favorite.</string>
<string name="must_be_at_edit">Morate biti na zaslonu Uređivanje da biste izmijenili kontakt</string>
<!-- Search -->
<string name="search_contacts">Pretraži kontakte</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Úgy tűnik, hogy még nincsenek kedvencek felvéve.</string>
<string name="must_be_at_edit">Névjegyet csak a szerkesztő képernyőn lehet módosítani.</string>
<!-- Search -->
<string name="search_contacts">Névjegyek keresése</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Sepertinya anda belum menambahkan kontak favorit.</string>
<string name="must_be_at_edit">Anda harus berada di layar Sunting untuk mengubah kontak</string>
<!-- Search -->
<string name="search_contacts">Cari kontak</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Sepertinya anda belum menambahkan kontak favorit.</string>
<string name="must_be_at_edit">Anda harus berada di layar Sunting untuk mengubah kontak</string>
<!-- Search -->
<string name="search_contacts">Cari kontak</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Non si ha ancora nessun contatto preferito.</string>
<string name="must_be_at_edit">Si deve stare nella schermata di modifica per modificare un contatto</string>
<!-- Search -->
<string name="search_contacts">Cerca contatti</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">お気に入りの連絡先はまだありません</string>
<string name="must_be_at_edit">連絡先を編集するには編集画面に切り替えてください</string>
<!-- Search -->
<string name="search_contacts">連絡先を検索</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">자주 사용하는 연락처가 아직 등록되지 않았습니다.</string>
<string name="must_be_at_edit">You must be at the Edit screen to modify a contact</string>
<!-- Search -->
<string name="search_contacts">연락처 검색</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Atrodo jog Jūs dar neįvedėte nė vieno mėgiamiausiojo kontakto.</string>
<string name="must_be_at_edit">You must be at the Edit screen to modify a contact</string>
<!-- Search -->
<string name="search_contacts">Ieškoti kontaktų</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">നിങ്ങൾ ഇതുവരെ പ്രിയപ്പെട്ട കോൺ‌ടാക്റ്റുകളൊന്നും ചേർത്തിട്ടില്ലെന്ന് തോന്നുന്നു.</string>
<string name="must_be_at_edit">ഒരു കോൺ‌ടാക്റ്റ് തിരുത്താൻ നിങ്ങൾ എഡിറ്റ് സ്ക്രീനിൽ ആയിരിക്കണം</string>
<!-- Search -->
<string name="search_contacts">കോൺ‌ടാക്റ്റുകൾ തിരയുക</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Er zijn nog geen favorieten toegevoegd.</string>
<string name="must_be_at_edit">Ga naar Contact bewerken om gegevens aan te passen</string>
<!-- Search -->
<string name="search_contacts">Contacten zoeken</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Wygląda na to, że nie dodałeś jeszcze żadnego ulubionego kontaktu.</string>
<string name="must_be_at_edit">Musisz wejść do ekranu edycji, aby zmodyfikować kontakt</string>
<!-- Search -->
<string name="search_contacts">Szukaj kontaktów</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Parece que você ainda não adicionou nenhum contato favorito.</string>
<string name="must_be_at_edit">Você deve estar na tela de edição para modificar um contato</string>
<!-- Search -->
<string name="search_contacts">Procurar contatos</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Parece que ainda não adicionou contactos aos favoritos</string>
<string name="must_be_at_edit">Tem que estar no ecrã de edição para alterar um contacto</string>
<!-- Search -->
<string name="search_contacts">Pesquisar nos contactos</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Похоже, вы ещё не добавили избранные контакты.</string>
<string name="must_be_at_edit">Для изменения контакта необходимо находиться на экране редактирования</string>
<!-- Search -->
<string name="search_contacts">Поиск контактов</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Zdá sa, že ste ešte nepridali žiadne obľúbené kontakty.</string>
<string name="must_be_at_edit">Pre úpravu kontaktu musíte byť v Editore kontaktu</string>
<!-- Search -->
<string name="search_contacts">Hľadať v kontaktoch</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Det verkar som att du inte har lagt till några favoritkontakter ännu.</string>
<string name="must_be_at_edit">Kontakter kan bara redigeras i redigeringsvyn</string>
<!-- Search -->
<string name="search_contacts">Sök efter kontakter</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Henüz herhangi bir favori kişi eklememişsiniz.</string>
<string name="must_be_at_edit">Bir kişiyi değiştirmek için Düzen ekranında olmalısınız</string>
<!-- Search -->
<string name="search_contacts">Kişileri ara</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Здається, ви ще не додали улюблені контакти.</string>
<string name="must_be_at_edit">Для того, щоб змінити контакт, необхідно відкрити меню редагування</string>
<!-- Search -->
<string name="search_contacts">Пошук контактів</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">您似乎还没加入任何我的收藏联系人。</string>
<string name="must_be_at_edit">您必须在编辑页面去修改联系人</string>
<!-- Search -->
<string name="search_contacts">搜索联系人</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">你似乎還沒加入任何我的最愛聯絡人。</string>
<string name="must_be_at_edit">你必須在編輯畫面去修改聯絡人</string>
<!-- Search -->
<string name="search_contacts">搜尋聯絡人</string>

View file

@ -74,7 +74,6 @@
<!-- Favorites -->
<string name="no_favorites">Seems like you haven\'t added any favorite contacts yet.</string>
<string name="must_be_at_edit">You must be at the Edit screen to modify a contact</string>
<!-- Search -->
<string name="search_contacts">Search contacts</string>