mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
show groups as the last field at contacts too
This commit is contained in:
@ -208,14 +208,13 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
setupAddresses()
|
setupAddresses()
|
||||||
setupIMs()
|
setupIMs()
|
||||||
setupEvents()
|
setupEvents()
|
||||||
|
setupWebsites()
|
||||||
|
setupGroups()
|
||||||
|
setupContactSources()
|
||||||
setupNotes()
|
setupNotes()
|
||||||
setupOrganization()
|
setupOrganization()
|
||||||
setupWebsites()
|
|
||||||
setupContactSources()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setupGroups()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun launchEditContact(contact: Contact) {
|
private fun launchEditContact(contact: Contact) {
|
||||||
@ -522,18 +521,29 @@ class ViewContactActivity : ContactActivity() {
|
|||||||
|
|
||||||
private fun setupGroups() {
|
private fun setupGroups() {
|
||||||
contact_groups_holder.removeAllViews()
|
contact_groups_holder.removeAllViews()
|
||||||
val groups = contact!!.groups
|
if (showFields and SHOW_GROUPS_FIELD != 0) {
|
||||||
if (groups.isNotEmpty() && showFields and SHOW_GROUPS_FIELD != 0) {
|
var groups = contact!!.groups.toMutableSet() as LinkedHashSet<Group>
|
||||||
groups.forEach {
|
duplicateContacts.forEach {
|
||||||
layoutInflater.inflate(R.layout.item_view_group, contact_groups_holder, false).apply {
|
groups.addAll(it.groups)
|
||||||
val group = it
|
}
|
||||||
contact_groups_holder.addView(this)
|
|
||||||
contact_group.text = group.title
|
groups = groups.sortedBy { it.title }.toMutableSet() as LinkedHashSet<Group>
|
||||||
copyOnLongClick(group.title)
|
|
||||||
}
|
if (groups.isNotEmpty()) {
|
||||||
|
groups.forEach {
|
||||||
|
layoutInflater.inflate(R.layout.item_view_group, contact_groups_holder, false).apply {
|
||||||
|
val group = it
|
||||||
|
contact_groups_holder.addView(this)
|
||||||
|
contact_group.text = group.title
|
||||||
|
copyOnLongClick(group.title)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
contact_groups_image.beVisible()
|
||||||
|
contact_groups_holder.beVisible()
|
||||||
|
} else {
|
||||||
|
contact_groups_image.beGone()
|
||||||
|
contact_groups_holder.beGone()
|
||||||
}
|
}
|
||||||
contact_groups_image.beVisible()
|
|
||||||
contact_groups_holder.beVisible()
|
|
||||||
} else {
|
} else {
|
||||||
contact_groups_image.beGone()
|
contact_groups_image.beGone()
|
||||||
contact_groups_holder.beGone()
|
contact_groups_holder.beGone()
|
||||||
|
@ -374,7 +374,7 @@
|
|||||||
android:id="@+id/contact_sources_holder"
|
android:id="@+id/contact_sources_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/contact_websites_holder"
|
android:layout_below="@+id/contact_groups_holder"
|
||||||
android:layout_toEndOf="@+id/contact_name_image"
|
android:layout_toEndOf="@+id/contact_name_image"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingStart="@dimen/small_margin"
|
android:paddingStart="@dimen/small_margin"
|
||||||
|
Reference in New Issue
Block a user