mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
show websites at contact details
This commit is contained in:
@ -19,10 +19,10 @@ import com.simplemobiletools.contacts.pro.extensions.*
|
|||||||
import com.simplemobiletools.contacts.pro.helpers.*
|
import com.simplemobiletools.contacts.pro.helpers.*
|
||||||
import com.simplemobiletools.contacts.pro.models.*
|
import com.simplemobiletools.contacts.pro.models.*
|
||||||
import kotlinx.android.synthetic.main.activity_view_contact.*
|
import kotlinx.android.synthetic.main.activity_view_contact.*
|
||||||
import kotlinx.android.synthetic.main.item_event.view.*
|
|
||||||
import kotlinx.android.synthetic.main.item_view_address.view.*
|
import kotlinx.android.synthetic.main.item_view_address.view.*
|
||||||
import kotlinx.android.synthetic.main.item_view_contact_source.view.*
|
import kotlinx.android.synthetic.main.item_view_contact_source.view.*
|
||||||
import kotlinx.android.synthetic.main.item_view_email.view.*
|
import kotlinx.android.synthetic.main.item_view_email.view.*
|
||||||
|
import kotlinx.android.synthetic.main.item_view_event.view.*
|
||||||
import kotlinx.android.synthetic.main.item_view_group.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_im.view.*
|
||||||
import kotlinx.android.synthetic.main.item_view_phone_number.view.*
|
import kotlinx.android.synthetic.main.item_view_phone_number.view.*
|
||||||
@ -208,13 +208,13 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
setupAddresses()
|
setupAddresses()
|
||||||
setupIMs()
|
setupIMs()
|
||||||
setupEvents()
|
setupEvents()
|
||||||
|
setupNotes()
|
||||||
|
setupOrganization()
|
||||||
|
setupWebsites()
|
||||||
setupContactSources()
|
setupContactSources()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setupNotes()
|
|
||||||
setupOrganization()
|
|
||||||
setupWebsites()
|
|
||||||
setupGroups()
|
setupGroups()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,22 +487,33 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
|
|
||||||
private fun setupWebsites() {
|
private fun setupWebsites() {
|
||||||
contact_websites_holder.removeAllViews()
|
contact_websites_holder.removeAllViews()
|
||||||
val websites = contact!!.websites
|
if (showFields and SHOW_WEBSITES_FIELD != 0) {
|
||||||
if (websites.isNotEmpty() && showFields and SHOW_WEBSITES_FIELD != 0) {
|
var websites = contact!!.websites.toMutableSet() as LinkedHashSet<String>
|
||||||
websites.forEach {
|
duplicateContacts.forEach {
|
||||||
val url = it
|
websites.addAll(it.websites)
|
||||||
layoutInflater.inflate(R.layout.item_website, contact_websites_holder, false).apply {
|
}
|
||||||
contact_websites_holder.addView(this)
|
|
||||||
contact_website.text = url
|
|
||||||
copyOnLongClick(url)
|
|
||||||
|
|
||||||
setOnClickListener {
|
websites = websites.sorted().toMutableSet() as LinkedHashSet<String>
|
||||||
openWebsiteIntent(url)
|
|
||||||
|
if (websites.isNotEmpty()) {
|
||||||
|
websites.forEach {
|
||||||
|
val url = it
|
||||||
|
layoutInflater.inflate(R.layout.item_website, contact_websites_holder, false).apply {
|
||||||
|
contact_websites_holder.addView(this)
|
||||||
|
contact_website.text = url
|
||||||
|
copyOnLongClick(url)
|
||||||
|
|
||||||
|
setOnClickListener {
|
||||||
|
openWebsiteIntent(url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
contact_websites_image.beVisible()
|
||||||
|
contact_websites_holder.beVisible()
|
||||||
|
} else {
|
||||||
|
contact_websites_image.beGone()
|
||||||
|
contact_websites_holder.beGone()
|
||||||
}
|
}
|
||||||
contact_websites_image.beVisible()
|
|
||||||
contact_websites_holder.beVisible()
|
|
||||||
} else {
|
} else {
|
||||||
contact_websites_image.beGone()
|
contact_websites_image.beGone()
|
||||||
contact_websites_holder.beGone()
|
contact_websites_holder.beGone()
|
||||||
|
Reference in New Issue
Block a user