mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
make sure the contact list items have proper height even without thumbnail
This commit is contained in:
@ -36,6 +36,8 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: MutableList<Co
|
|||||||
var startNameWithSurname: Boolean
|
var startNameWithSurname: Boolean
|
||||||
var showContactThumbnails: Boolean
|
var showContactThumbnails: Boolean
|
||||||
var showPhoneNumbers: Boolean
|
var showPhoneNumbers: Boolean
|
||||||
|
var smallPadding = activity.resources.getDimension(R.dimen.small_margin).toInt()
|
||||||
|
var bigPadding = activity.resources.getDimension(R.dimen.normal_margin).toInt()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
initDrawables()
|
initDrawables()
|
||||||
@ -190,8 +192,10 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: MutableList<Co
|
|||||||
view.apply {
|
view.apply {
|
||||||
contact_name.text = contact.getFullName(startNameWithSurname)
|
contact_name.text = contact.getFullName(startNameWithSurname)
|
||||||
contact_name.setTextColor(textColor)
|
contact_name.setTextColor(textColor)
|
||||||
|
contact_name.setPadding(if (showContactThumbnails) smallPadding else bigPadding, smallPadding, 0, 0)
|
||||||
contact_number?.text = contact.phoneNumbers.firstOrNull()?.value ?: ""
|
contact_number?.text = contact.phoneNumbers.firstOrNull()?.value ?: ""
|
||||||
contact_number?.setTextColor(textColor)
|
contact_number?.setTextColor(textColor)
|
||||||
|
contact_number?.setPadding(if (showContactThumbnails) smallPadding else bigPadding, 0, 0, 0)
|
||||||
contact_tmb.beVisibleIf(showContactThumbnails)
|
contact_tmb.beVisibleIf(showContactThumbnails)
|
||||||
|
|
||||||
if (showContactThumbnails) {
|
if (showContactThumbnails) {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/contact_holder"
|
android:id="@+id/contact_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/contact_item_height"
|
||||||
android:paddingRight="@dimen/activity_margin">
|
android:paddingRight="@dimen/activity_margin">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -40,6 +40,7 @@
|
|||||||
android:id="@+id/contact_number"
|
android:id="@+id/contact_number"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignLeft="@+id/contact_name"
|
||||||
android:layout_below="@+id/contact_name"
|
android:layout_below="@+id/contact_name"
|
||||||
android:layout_toRightOf="@+id/contact_tmb"
|
android:layout_toRightOf="@+id/contact_tmb"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
@ -26,9 +26,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/contact_name"
|
android:id="@+id/contact_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="@dimen/contact_item_height"
|
||||||
android:layout_alignBottom="@+id/contact_tmb"
|
|
||||||
android:layout_alignTop="@+id/contact_tmb"
|
|
||||||
android:layout_toRightOf="@+id/contact_tmb"
|
android:layout_toRightOf="@+id/contact_tmb"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
@ -3,4 +3,5 @@
|
|||||||
<dimen name="contact_photo_size">80dp</dimen>
|
<dimen name="contact_photo_size">80dp</dimen>
|
||||||
<dimen name="contact_actions_size">45dp</dimen>
|
<dimen name="contact_actions_size">45dp</dimen>
|
||||||
<dimen name="contact_icons_size">40dp</dimen>
|
<dimen name="contact_icons_size">40dp</dimen>
|
||||||
|
<dimen name="contact_item_height">48dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
Reference in New Issue
Block a user