fill in the first email and phone number of the contact

This commit is contained in:
tibbi
2017-12-18 15:16:58 +01:00
parent bb18218c0a
commit 77f1c2f2fa
4 changed files with 45 additions and 5 deletions

View File

@ -1,3 +1,13 @@
package com.simplemobiletools.contacts.models
data class Email(var value: String, var type: Int)
import android.provider.ContactsContract
import com.simplemobiletools.contacts.R
data class Email(var value: String, var type: Int) {
fun getTextId() = when (type) {
ContactsContract.CommonDataKinds.Email.TYPE_HOME -> R.string.home
ContactsContract.CommonDataKinds.Email.TYPE_WORK -> R.string.work
ContactsContract.CommonDataKinds.Email.TYPE_MOBILE -> R.string.mobile
else -> R.string.other
}
}