From 5d8d0dd7b02f6eaa3b47fce2de8c9506e0fd5018 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 26 Sep 2018 12:13:05 +0200 Subject: [PATCH] implement the "Create new contact" button on the insert_or_Edit screen --- .../activities/InsertOrEditContactActivity.kt | 27 ++++++++++++++++- .../main/res/drawable-hdpi/ic_new_contact.png | Bin 0 -> 269 bytes .../res/drawable-xhdpi/ic_new_contact.png | Bin 0 -> 322 bytes .../res/drawable-xxhdpi/ic_new_contact.png | Bin 0 -> 421 bytes .../res/drawable-xxxhdpi/ic_new_contact.png | Bin 0 -> 578 bytes .../layout/activity_insert_edit_contact.xml | 28 ++++++++++++++++++ app/src/main/res/values-az/strings.xml | 2 ++ app/src/main/res/values-de/strings.xml | 2 ++ app/src/main/res/values-el/strings.xml | 2 ++ app/src/main/res/values-fr/strings.xml | 2 ++ app/src/main/res/values-hr/strings.xml | 2 ++ app/src/main/res/values-ja/strings.xml | 2 ++ app/src/main/res/values-ko-rKR/strings.xml | 2 ++ app/src/main/res/values-lt/strings.xml | 2 ++ app/src/main/res/values-pt/strings.xml | 2 ++ app/src/main/res/values-ru/strings.xml | 2 ++ app/src/main/res/values-sk/strings.xml | 2 ++ app/src/main/res/values-sv/strings.xml | 2 ++ app/src/main/res/values-tr/strings.xml | 2 ++ app/src/main/res/values-zh-rTW/strings.xml | 2 ++ app/src/main/res/values/dimens.xml | 1 + app/src/main/res/values/strings.xml | 2 ++ 22 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_new_contact.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_new_contact.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_new_contact.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_new_contact.png diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/InsertOrEditContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/InsertOrEditContactActivity.kt index 3a2c5063..7feea511 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/InsertOrEditContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/InsertOrEditContactActivity.kt @@ -1,18 +1,43 @@ package com.simplemobiletools.contacts.activities +import android.content.Intent import android.os.Bundle +import android.provider.ContactsContract +import com.simplemobiletools.commons.extensions.getColoredDrawableWithColor +import com.simplemobiletools.commons.extensions.toast +import com.simplemobiletools.commons.extensions.updateTextColors import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS import com.simplemobiletools.contacts.R +import com.simplemobiletools.contacts.extensions.config +import com.simplemobiletools.contacts.helpers.KEY_PHONE +import kotlinx.android.synthetic.main.activity_insert_edit_contact.* -class InsertOrEditContactActivity : ContactActivity() { +class InsertOrEditContactActivity : SimpleActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_insert_edit_contact) title = getString(R.string.select_contact) + updateTextColors(insert_edit_contact_holder) handlePermission(PERMISSION_READ_CONTACTS) { // we do not really care about the permission request result. Even if it was denied, load private contacts + setupViews() + } + } + private fun setupViews() { + new_contact_tmb.setImageDrawable(resources.getColoredDrawableWithColor(R.drawable.ic_new_contact, config.textColor)) + new_contact_holder.setOnClickListener { + Intent().apply { + action = Intent.ACTION_INSERT + data = ContactsContract.Contacts.CONTENT_URI + putExtra(KEY_PHONE, intent.getStringExtra(KEY_PHONE)) + if (resolveActivity(packageManager) != null) { + startActivity(this) + } else { + toast(R.string.no_app_found) + } + } } } } diff --git a/app/src/main/res/drawable-hdpi/ic_new_contact.png b/app/src/main/res/drawable-hdpi/ic_new_contact.png new file mode 100644 index 0000000000000000000000000000000000000000..ded0ae9204330f787b238e650155b0929d65f1cc GIT binary patch literal 269 zcmV+o0rLKdP)H&J1pq`*e50DfD0w{nI>Jb_R2!cY$l!E#Tqp01xb_Q|3 z0mk{c+dY;MjbV_X&Vu9fSx_ev?{J4Pci!C@e$jbvQ zR9fMN_`bedqTts+PdJP| zmfgr-cH)4KEH!^!&#Ar6Ui^{ebgenCq z3X04KYew<6;Yo)4YDhBd_!0-AI8e6qNU7@tOnT-VUU>EvzJ_nT_GbV`@WYeMq}A3RVwBiit|R`|J9X}R@4okQ z!~5HZ|MtF*LI@#*P>pUDIpLZjZ(MWC5?%T)43Ou8-^%3aQ})PFqLvalWs6nnSyOhH zroL}xlnr`#Cy94@l?C=mYES+c#9~n1*uY{#jiG}6L;;I}f6yHkcm6@2SQPz(imeuO zkHx)z&>0qI{z02qZ2AWcVKM9(WIrAIN(LiUq1SX={evWCNMc&bC`e+Rde)^3gCu4t zQ%jkgEHH9^@-a#{gKjuVZ3a<6t$+xMpa^1=IkwoQzyn_ZeDT03dA68mG_xQ^SmBUo z>UrjX6-FF`m>|y+R!?j*sdUl70v9ynf(1I14yL#z4Yy3GS#+{Pns(__;~3+Sv^_Ge z#?a3z9$pxb9c^6U<&t(;v5co>S#gf1b6HWsQ%P1hi=YUKpq3Ou2qF9cn1^3$=;qUg P00000NkvXXu0mjf0jarG literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_new_contact.png b/app/src/main/res/drawable-xxxhdpi/ic_new_contact.png new file mode 100644 index 0000000000000000000000000000000000000000..07435b94a46a5a0ebea6ded6f76b1e5394d799e4 GIT binary patch literal 578 zcmV-I0=@l-P)41mTFnG&hjq9cYom=e&NlW$yRkJf>o%zEHnwZqwh`2$;H}*qojY^RB>xjT z@Ads;j4{R-V~jD?Kog_v;T(_1km51t*~L5>R10Wl9Vz}N#X8y*GNzK`1NnR)$y9}j zW{y&fqckf#%-}x7y3Y)Sg*Kj0iYIg`95iy4Qe7gZP_U44EKnHeB~3Zf^eF_aqg?Cd zA9bWCSBg6M#t1G(6czrWBC#45Yy1Zsz{LUo0k?2*%YVQ}Tzv2!@E#ZM{RiB}#clrq zhj4L7uIw>d^DnYGKKlQZa0rlCOS#rbAp~@m{W;yC(%~q=ADV?yC;^RJq*P~V3?@LL zi^r7W32jn90TMI0>prV^43KE%1jRT-vlL)}L>);|VgZPhjBJ> zo*c!7rbb#;3Gg;h6 + + + + + + + diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index e624edca..650b76f5 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -15,6 +15,8 @@ Grupa e-poçt göndər %s şəxsinə zng et Lazım olan icazələri istə + Create new contact + Add to an existing contact Yeni kontakt Redaktə et diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 0fecfa66..041a1687 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -15,6 +15,8 @@ Sende E-Mail an Gruppe %s anrufen Benötigte Berechtigungen anfordern + Create new contact + Add to an existing contact Neuer Kontakt Kontakt bearbeiten diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 1328162b..0a3751f8 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -15,6 +15,8 @@ Αποστολή email σε ομάδες Κλήση %s Ζητούνται τα απαιτούμενα δικαιώματα + Create new contact + Add to an existing contact Νέα επαφή Επεξεργασία επαφής diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index dca32b94..d646b479 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -15,6 +15,8 @@ Envoyer un e-mail au groupe Call %s Demander les autorisations requises + Create new contact + Add to an existing contact Nouveau contact Modifier contact diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 00c7183e..6f564596 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -15,6 +15,8 @@ Pošalji e-poštu grupi Nazovi %s Zatraži potrebna dopuštenja + Create new contact + Add to an existing contact Novi kontakt Uredi kontakt diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 504bfc7b..ee37c62a 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -15,6 +15,8 @@ グループにメールを送信 Call %s Request the required permissions + Create new contact + Add to an existing contact 新しい連絡先 連絡先を編集 diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 60867b85..fa4c5d54 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -15,6 +15,8 @@ Send email to group Call %s Request the required permissions + Create new contact + Add to an existing contact 새로운 연락처 연락처 수정 diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index cd643243..c16881d5 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -15,6 +15,8 @@ Send email to group Call %s Request the required permissions + Create new contact + Add to an existing contact Naujas kontaktas Redaguoti kontaktą diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index c6696378..0c72f160 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -15,6 +15,8 @@ Enviar e-mail para o grupo Ligar a %s Pedir a permissão necessária + Create new contact + Add to an existing contact Novo contacto Editar contacto diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index a9987c6c..dd978592 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -15,6 +15,8 @@ Отправить письмо группе Вызов %s Запрос необходимых разрешений + Create new contact + Add to an existing contact Новый контакт Редактировать контакт diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index c8cce6c5..8c738576 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -15,6 +15,8 @@ Poslať skupine email Zavolať %s Vyžiadať potrebné oprávnenia + Vytvoriť nový kontakt + Pridať k existujúcemu kontaktu Nový kontakt Upraviť kontakt diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 45469d81..0fb23153 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -15,6 +15,8 @@ Skicka e-post till grupp Ring %s Begär de behörigheter som krävs + Create new contact + Add to an existing contact Ny kontakt Redigera kontakt diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index c2fc8d90..710fa376 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -15,6 +15,8 @@ Gruba e-posta gönder Call %s Request the required permissions + Create new contact + Add to an existing contact Yeni kişi Kişiyi düzenle diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index d2deece6..af88bce6 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -15,6 +15,8 @@ 發送電子郵件給群組 打電話給 %s 請求必要的權限 + Create new contact + Add to an existing contact 新聯絡人 編輯聯絡人 diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 56d5d4fc..e72744fc 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -4,6 +4,7 @@ 45dp 40dp 52dp + 68dp 60dp 44sp 40sp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ebb5d39a..2ec0cd04 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -15,6 +15,8 @@ Send email to group Call %s Request the required permissions + Create new contact + Add to an existing contact New contact Edit contact