mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-03-18 04:00:12 +01:00
show user IMs when appropriate
This commit is contained in:
parent
5f4476c6af
commit
c416a46214
@ -149,6 +149,23 @@ abstract class ContactActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
fun getIMTypeText(type: Int, label: String): String {
|
||||
return if (type == ContactsContract.CommonDataKinds.Im.PROTOCOL_CUSTOM) {
|
||||
label
|
||||
} else {
|
||||
getString(when (type) {
|
||||
ContactsContract.CommonDataKinds.Im.PROTOCOL_AIM -> R.string.aim
|
||||
ContactsContract.CommonDataKinds.Im.PROTOCOL_MSN -> R.string.windows_live
|
||||
ContactsContract.CommonDataKinds.Im.PROTOCOL_YAHOO -> R.string.yahoo
|
||||
ContactsContract.CommonDataKinds.Im.PROTOCOL_SKYPE -> R.string.skype
|
||||
ContactsContract.CommonDataKinds.Im.PROTOCOL_QQ -> R.string.qq
|
||||
ContactsContract.CommonDataKinds.Im.PROTOCOL_GOOGLE_TALK -> R.string.hangouts
|
||||
ContactsContract.CommonDataKinds.Im.PROTOCOL_ICQ -> R.string.icq
|
||||
else -> R.string.jabber
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fun getEventTextId(type: Int) = when (type) {
|
||||
ContactsContract.CommonDataKinds.Event.TYPE_BIRTHDAY -> R.string.birthday
|
||||
ContactsContract.CommonDataKinds.Event.TYPE_ANNIVERSARY -> R.string.anniversary
|
||||
|
@ -35,7 +35,6 @@ import kotlinx.android.synthetic.main.item_edit_website.view.*
|
||||
import kotlinx.android.synthetic.main.item_event.view.*
|
||||
import org.joda.time.DateTime
|
||||
import org.joda.time.format.DateTimeFormat
|
||||
import java.util.*
|
||||
|
||||
class EditContactActivity : ContactActivity() {
|
||||
private val INTENT_TAKE_PHOTO = 1
|
||||
@ -183,6 +182,7 @@ class EditContactActivity : ContactActivity() {
|
||||
contact_numbers_image.applyColorFilter(textColor)
|
||||
contact_emails_image.applyColorFilter(textColor)
|
||||
contact_addresses_image.applyColorFilter(textColor)
|
||||
contact_ims_image.applyColorFilter(textColor)
|
||||
contact_events_image.applyColorFilter(textColor)
|
||||
contact_notes_image.applyColorFilter(textColor)
|
||||
contact_organization_image.applyColorFilter(textColor)
|
||||
@ -197,6 +197,8 @@ class EditContactActivity : ContactActivity() {
|
||||
contact_emails_add_new.background.applyColorFilter(textColor)
|
||||
contact_addresses_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||
contact_addresses_add_new.background.applyColorFilter(textColor)
|
||||
contact_ims_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||
contact_ims_add_new.background.applyColorFilter(textColor)
|
||||
contact_events_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||
contact_events_add_new.background.applyColorFilter(textColor)
|
||||
contact_websites_add_new.applyColorFilter(adjustedPrimaryColor)
|
||||
@ -212,6 +214,7 @@ class EditContactActivity : ContactActivity() {
|
||||
contact_numbers_add_new.setOnClickListener { addNewPhoneNumberField() }
|
||||
contact_emails_add_new.setOnClickListener { addNewEmailField() }
|
||||
contact_addresses_add_new.setOnClickListener { addNewAddressField() }
|
||||
contact_ims_add_new.setOnClickListener { addNewIMField() }
|
||||
contact_events_add_new.setOnClickListener { addNewEventField() }
|
||||
contact_websites_add_new.setOnClickListener { addNewWebsiteField() }
|
||||
contact_groups_add_new.setOnClickListener { showSelectGroupsDialog() }
|
||||
@ -300,6 +303,11 @@ class EditContactActivity : ContactActivity() {
|
||||
contact_addresses_holder.beVisibleIf(areAddressesVisible)
|
||||
contact_addresses_add_new.beVisibleIf(areAddressesVisible)
|
||||
|
||||
val areIMsVisible = showFields and SHOW_IMS_FIELD != 0
|
||||
contact_ims_image.beVisibleIf(areIMsVisible)
|
||||
contact_ims_holder.beVisibleIf(areIMsVisible)
|
||||
contact_ims_add_new.beVisibleIf(areIMsVisible)
|
||||
|
||||
val isOrganizationVisible = showFields and SHOW_ORGANIZATION_FIELD != 0
|
||||
contact_organization_company.beVisibleIf(isOrganizationVisible)
|
||||
contact_organization_job_position.beVisibleIf(isOrganizationVisible)
|
||||
@ -333,6 +341,7 @@ class EditContactActivity : ContactActivity() {
|
||||
setupPhoneNumbers()
|
||||
setupEmails()
|
||||
setupAddresses()
|
||||
setupIMs()
|
||||
setupNotes()
|
||||
setupOrganization()
|
||||
setupWebsites()
|
||||
@ -397,6 +406,10 @@ class EditContactActivity : ContactActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupIMs() {
|
||||
|
||||
}
|
||||
|
||||
private fun setupNotes() {
|
||||
contact_notes.setText(contact!!.notes)
|
||||
}
|
||||
@ -507,7 +520,7 @@ class EditContactActivity : ContactActivity() {
|
||||
originalContactSource = if (hasContactPermissions()) config.lastUsedContactSource else SMT_PRIVATE
|
||||
val organization = Organization("", "")
|
||||
contact = Contact(0, "", "", "", "", "", "", "", ArrayList(), ArrayList(), ArrayList(), ArrayList(), originalContactSource, 0, 0, "",
|
||||
null, "", ArrayList(), organization, ArrayList(), ArrayList())
|
||||
null, "", ArrayList(), organization, ArrayList(), ArrayList(), ArrayList())
|
||||
contact_source.text = getPublicContactSource(contact!!.source)
|
||||
}
|
||||
|
||||
@ -815,6 +828,10 @@ class EditContactActivity : ContactActivity() {
|
||||
return addresses
|
||||
}
|
||||
|
||||
private fun getFilledIMs() {
|
||||
|
||||
}
|
||||
|
||||
private fun getFilledEvents(): ArrayList<Event> {
|
||||
val unknown = getString(R.string.unknown)
|
||||
val events = ArrayList<Event>()
|
||||
@ -915,6 +932,10 @@ class EditContactActivity : ContactActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun addNewIMField() {
|
||||
|
||||
}
|
||||
|
||||
private fun addNewEventField() {
|
||||
val eventHolder = layoutInflater.inflate(R.layout.item_event, contact_events_holder, false) as ViewGroup
|
||||
updateTextColors(eventHolder)
|
||||
|
@ -19,6 +19,7 @@ import kotlinx.android.synthetic.main.item_event.view.*
|
||||
import kotlinx.android.synthetic.main.item_view_address.view.*
|
||||
import kotlinx.android.synthetic.main.item_view_email.view.*
|
||||
import kotlinx.android.synthetic.main.item_view_group.view.*
|
||||
import kotlinx.android.synthetic.main.item_view_im.view.*
|
||||
import kotlinx.android.synthetic.main.item_view_phone_number.view.*
|
||||
import kotlinx.android.synthetic.main.item_website.view.*
|
||||
|
||||
@ -153,6 +154,7 @@ class ViewContactActivity : ContactActivity() {
|
||||
setupPhoneNumbers()
|
||||
setupEmails()
|
||||
setupAddresses()
|
||||
setupIMs()
|
||||
setupEvents()
|
||||
setupNotes()
|
||||
setupOrganization()
|
||||
@ -291,6 +293,26 @@ class ViewContactActivity : ContactActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupIMs() {
|
||||
contact_ims_holder.removeAllViews()
|
||||
val IMs = contact!!.IMs
|
||||
if (IMs.isNotEmpty() && showFields and SHOW_IMS_FIELD != 0) {
|
||||
IMs.forEach {
|
||||
layoutInflater.inflate(R.layout.item_view_im, contact_ims_holder, false).apply {
|
||||
val IM = it
|
||||
contact_ims_holder.addView(this)
|
||||
contact_im.text = IM.value
|
||||
contact_im_type.text = getIMTypeText(IM.type, IM.label)
|
||||
}
|
||||
}
|
||||
contact_ims_image.beVisible()
|
||||
contact_ims_holder.beVisible()
|
||||
} else {
|
||||
contact_ims_image.beGone()
|
||||
contact_ims_holder.beGone()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupEvents() {
|
||||
contact_events_holder.removeAllViews()
|
||||
val events = contact!!.events
|
||||
|
@ -23,6 +23,7 @@ class ManageVisibleFieldsDialog(val activity: BaseSimpleActivity) {
|
||||
put(SHOW_PHONE_NUMBERS_FIELD, R.id.manage_visible_fields_phone_numbers)
|
||||
put(SHOW_EMAILS_FIELD, R.id.manage_visible_fields_emails)
|
||||
put(SHOW_ADDRESSES_FIELD, R.id.manage_visible_fields_addresses)
|
||||
put(SHOW_IMS_FIELD, R.id.manage_visible_fields_ims)
|
||||
put(SHOW_EVENTS_FIELD, R.id.manage_visible_fields_events)
|
||||
put(SHOW_NOTES_FIELD, R.id.manage_visible_fields_notes)
|
||||
put(SHOW_ORGANIZATION_FIELD, R.id.manage_visible_fields_organization)
|
||||
|
@ -85,6 +85,7 @@ const val SHOW_GROUPS_FIELD = 2048
|
||||
const val SHOW_CONTACT_SOURCE_FIELD = 4096
|
||||
const val SHOW_WEBSITES_FIELD = 8192
|
||||
const val SHOW_NICKNAME_FIELD = 16384
|
||||
const val SHOW_IMS_FIELD = 32768
|
||||
|
||||
const val DEFAULT_EMAIL_TYPE = CommonDataKinds.Email.TYPE_HOME
|
||||
const val DEFAULT_PHONE_NUMBER_TYPE = CommonDataKinds.Phone.TYPE_MOBILE
|
||||
|
@ -141,8 +141,9 @@ class ContactsHelper(val activity: Activity) {
|
||||
val organization = Organization("", "")
|
||||
val websites = ArrayList<String>()
|
||||
val cleanNumbers = ArrayList<PhoneNumber>()
|
||||
val ims = ArrayList<IM>()
|
||||
val contact = Contact(id, prefix, firstName, middleName, surname, suffix, nickname, photoUri, numbers, emails, addresses,
|
||||
events, accountName, starred, contactId, thumbnailUri, null, notes, groups, organization, websites, cleanNumbers)
|
||||
events, accountName, starred, contactId, thumbnailUri, null, notes, groups, organization, websites, cleanNumbers, ims)
|
||||
|
||||
contacts.put(id, contact)
|
||||
} while (cursor.moveToNext())
|
||||
@ -192,6 +193,8 @@ class ContactsHelper(val activity: Activity) {
|
||||
contacts[key]?.addresses = addresses.valueAt(i)
|
||||
}
|
||||
|
||||
val IMs = getIMs()
|
||||
|
||||
val events = getEvents()
|
||||
size = events.size()
|
||||
for (i in 0 until size) {
|
||||
@ -369,6 +372,45 @@ class ContactsHelper(val activity: Activity) {
|
||||
return addresses
|
||||
}
|
||||
|
||||
private fun getIMs(contactId: Int? = null): SparseArray<ArrayList<IM>> {
|
||||
val IMs = SparseArray<ArrayList<IM>>()
|
||||
val uri = ContactsContract.Data.CONTENT_URI
|
||||
val projection = arrayOf(
|
||||
ContactsContract.Data.RAW_CONTACT_ID,
|
||||
CommonDataKinds.Im.DATA,
|
||||
CommonDataKinds.Im.PROTOCOL,
|
||||
CommonDataKinds.Im.CUSTOM_PROTOCOL
|
||||
)
|
||||
|
||||
val selection = getSourcesSelection(true, contactId != null)
|
||||
val selectionArgs = getSourcesSelectionArgs(CommonDataKinds.Im.CONTENT_ITEM_TYPE, contactId)
|
||||
|
||||
var cursor: Cursor? = null
|
||||
try {
|
||||
cursor = activity.contentResolver.query(uri, projection, selection, selectionArgs, null)
|
||||
if (cursor?.moveToFirst() == true) {
|
||||
do {
|
||||
val id = cursor.getIntValue(ContactsContract.Data.RAW_CONTACT_ID)
|
||||
val IM = cursor.getStringValue(CommonDataKinds.Im.DATA) ?: continue
|
||||
val type = cursor.getIntValue(CommonDataKinds.Im.PROTOCOL)
|
||||
val label = cursor.getStringValue(CommonDataKinds.Im.CUSTOM_PROTOCOL) ?: ""
|
||||
|
||||
if (IMs[id] == null) {
|
||||
IMs.put(id, ArrayList())
|
||||
}
|
||||
|
||||
IMs[id]!!.add(IM(IM, type, label))
|
||||
} while (cursor.moveToNext())
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
activity.showErrorToast(e)
|
||||
} finally {
|
||||
cursor?.close()
|
||||
}
|
||||
|
||||
return IMs
|
||||
}
|
||||
|
||||
private fun getEvents(contactId: Int? = null): SparseArray<ArrayList<Event>> {
|
||||
val events = SparseArray<ArrayList<Event>>()
|
||||
val uri = ContactsContract.Data.CONTENT_URI
|
||||
@ -738,8 +780,10 @@ class ContactsHelper(val activity: Activity) {
|
||||
val thumbnailUri = cursor.getStringValue(CommonDataKinds.StructuredName.PHOTO_THUMBNAIL_URI) ?: ""
|
||||
val organization = getOrganizations(id)[id] ?: Organization("", "")
|
||||
val websites = getWebsites(id)[id] ?: ArrayList()
|
||||
val cleanNumbers = ArrayList<PhoneNumber>()
|
||||
val ims = getIMs(id)[id] ?: ArrayList()
|
||||
return Contact(id, prefix, firstName, middleName, surname, suffix, nickname, photoUri, number, emails, addresses, events,
|
||||
accountName, starred, contactId, thumbnailUri, null, notes, groups, organization, websites, ArrayList())
|
||||
accountName, starred, contactId, thumbnailUri, null, notes, groups, organization, websites, cleanNumbers, ims)
|
||||
}
|
||||
} finally {
|
||||
cursor?.close()
|
||||
|
@ -342,8 +342,10 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||
phoneNumbers.mapTo(cleanPhoneNumbers) { PhoneNumber(it.value.replace(PHONE_NUMBER_PATTERN.toRegex(), ""), 0, "") }
|
||||
}
|
||||
|
||||
val IMs = ArrayList<IM>()
|
||||
|
||||
val contact = Contact(id, prefix, firstName, middleName, surname, suffix, nickname, "", phoneNumbers, emails, addresses,
|
||||
events, SMT_PRIVATE, starred, id, "", photo, notes, groups, organization, websites, cleanPhoneNumbers)
|
||||
events, SMT_PRIVATE, starred, id, "", photo, notes, groups, organization, websites, cleanPhoneNumbers, IMs)
|
||||
contacts.add(contact)
|
||||
}
|
||||
}
|
||||
|
@ -111,9 +111,10 @@ class VcfImporter(val activity: SimpleActivity) {
|
||||
val photo = null
|
||||
val thumbnailUri = savePhoto(photoData)
|
||||
val cleanPhoneNumbers = ArrayList<PhoneNumber>()
|
||||
val IMs = ArrayList<IM>()
|
||||
|
||||
val contact = Contact(0, prefix, firstName, middleName, surname, suffix, nickname, photoUri, phoneNumbers, emails, addresses, events,
|
||||
targetContactSource, starred, contactId, thumbnailUri, photo, notes, groups, organization, websites, cleanPhoneNumbers)
|
||||
targetContactSource, starred, contactId, thumbnailUri, photo, notes, groups, organization, websites, cleanPhoneNumbers, IMs)
|
||||
|
||||
if (ContactsHelper(activity).insertContact(contact)) {
|
||||
contactsImported++
|
||||
|
@ -9,7 +9,8 @@ import com.simplemobiletools.commons.helpers.SORT_DESCENDING
|
||||
data class Contact(val id: Int, var prefix: String, var firstName: String, var middleName: String, var surname: String, var suffix: String, var nickname: String,
|
||||
var photoUri: String, var phoneNumbers: ArrayList<PhoneNumber>, var emails: ArrayList<Email>, var addresses: ArrayList<Address>,
|
||||
var events: ArrayList<Event>, var source: String, var starred: Int, val contactId: Int, val thumbnailUri: String, var photo: Bitmap?, var notes: String,
|
||||
var groups: ArrayList<Group>, var organization: Organization, var websites: ArrayList<String>, var cleanPhoneNumbers: ArrayList<PhoneNumber>) :
|
||||
var groups: ArrayList<Group>, var organization: Organization, var websites: ArrayList<String>, var cleanPhoneNumbers: ArrayList<PhoneNumber>,
|
||||
var IMs: ArrayList<IM>) :
|
||||
Comparable<Contact> {
|
||||
companion object {
|
||||
var sorting = 0
|
||||
@ -98,7 +99,8 @@ data class Contact(val id: Int, var prefix: String, var firstName: String, var m
|
||||
|
||||
return copy(id = 0, prefix = "", firstName = getFullName().toLowerCase(), middleName = "", surname = "", suffix = "", nickname = "", photoUri = "",
|
||||
phoneNumbers = ArrayList(), events = ArrayList(), addresses = ArrayList(), emails = newEmails, source = "", starred = 0,
|
||||
contactId = 0, thumbnailUri = "", notes = "", groups = ArrayList(), websites = ArrayList(), organization = Organization("", "")).toString()
|
||||
contactId = 0, thumbnailUri = "", notes = "", groups = ArrayList(), websites = ArrayList(), organization = Organization("", ""),
|
||||
IMs = ArrayList()).toString()
|
||||
}
|
||||
|
||||
fun getHashToCompare() = getStringToCompare().hashCode()
|
||||
|
@ -0,0 +1,3 @@
|
||||
package com.simplemobiletools.contacts.models
|
||||
|
||||
data class IM(var value: String, var type: Int, var label: String)
|
@ -299,6 +299,44 @@
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_plus"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_ims_image"
|
||||
android:layout_width="@dimen/contact_icons_size"
|
||||
android:layout_height="@dimen/contact_icons_size"
|
||||
android:layout_alignTop="@+id/contact_ims_holder"
|
||||
android:paddingBottom="@dimen/small_margin"
|
||||
android:paddingEnd="@dimen/small_margin"
|
||||
android:paddingRight="@dimen/small_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_im"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/contact_ims_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/contact_addresses_add_new"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:layout_toRightOf="@+id/contact_name_image"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/item_edit_im"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_ims_add_new"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/contact_ims_holder"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/small_margin"
|
||||
android:background="@drawable/button_background"
|
||||
android:paddingBottom="@dimen/medium_margin"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_plus"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_events_image"
|
||||
android:layout_width="@dimen/contact_icons_size"
|
||||
@ -314,7 +352,7 @@
|
||||
android:id="@+id/contact_events_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/contact_addresses_add_new"
|
||||
android:layout_below="@+id/contact_ims_add_new"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:layout_toRightOf="@+id/contact_name_image"
|
||||
android:orientation="vertical">
|
||||
|
@ -241,6 +241,26 @@
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/small_margin"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_ims_image"
|
||||
android:layout_width="@dimen/contact_icons_size"
|
||||
android:layout_height="@dimen/contact_icons_size"
|
||||
android:layout_alignTop="@+id/contact_ims_holder"
|
||||
android:paddingBottom="@dimen/small_margin"
|
||||
android:paddingEnd="@dimen/small_margin"
|
||||
android:paddingRight="@dimen/small_margin"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_im"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/contact_ims_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/contact_addresses_holder"
|
||||
android:layout_toRightOf="@+id/contact_name_image"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/small_margin"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_events_image"
|
||||
android:layout_width="@dimen/contact_icons_size"
|
||||
@ -256,7 +276,7 @@
|
||||
android:id="@+id/contact_events_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/contact_addresses_holder"
|
||||
android:layout_below="@+id/contact_ims_holder"
|
||||
android:layout_toRightOf="@+id/contact_name_image"
|
||||
android:orientation="vertical"/>
|
||||
|
||||
|
@ -86,6 +86,14 @@
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:text="@string/addresses"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/manage_visible_fields_ims"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:text="@string/instant_messaging"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/manage_visible_fields_events"
|
||||
android:layout_width="match_parent"
|
||||
|
38
app/src/main/res/layout/item_edit_im.xml
Normal file
38
app/src/main/res/layout/item_edit_im.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/contact_im_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/contact_im"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/contact_im_type"
|
||||
android:layout_toStartOf="@+id/contact_im_type"
|
||||
android:hint="@string/im"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/contact_im_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/contact_im"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignTop="@+id/contact_im"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingRight="@dimen/medium_margin"
|
||||
android:text="@string/skype"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
|
||||
</RelativeLayout>
|
38
app/src/main/res/layout/item_view_im.xml
Normal file
38
app/src/main/res/layout/item_view_im.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/contact_im_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingBottom="@dimen/normal_margin"
|
||||
android:paddingTop="@dimen/normal_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/contact_im"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/contact_im_type"
|
||||
android:layout_toStartOf="@+id/contact_im_type"
|
||||
android:lines="1"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/contact_im_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/contact_im"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignTop="@+id/contact_im"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingRight="@dimen/medium_margin"
|
||||
android:text="@string/aim"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
|
||||
</RelativeLayout>
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="im">IM</string>
|
||||
<string name="aim">AIM</string>
|
||||
<string name="windows_live">Windows Live</string>
|
||||
<string name="yahoo">Yahoo</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user