From 51030dbff1a4230e89cc17d9941dce29bdd8098d Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 13 Dec 2017 13:39:22 +0100 Subject: [PATCH] split the name at the Contact activity layout too --- .../contacts/activities/ContactActivity.kt | 4 +- .../contacts/adapters/ContactsAdapter.kt | 4 +- .../contacts/helpers/ContactsHelper.kt | 10 ++-- .../contacts/models/Contact.kt | 4 +- app/src/main/res/layout/activity_contact.xml | 48 +++++++++++++++---- app/src/main/res/layout/item_contact.xml | 4 +- 6 files changed, 54 insertions(+), 20 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/ContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/ContactActivity.kt index db12d518..0edc6f37 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/ContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/ContactActivity.kt @@ -135,7 +135,9 @@ class ContactActivity : SimpleActivity() { private fun setupEditContact() { window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) supportActionBar?.title = resources.getString(R.string.edit_contact) - contact_name.setText(contact!!.firstName) + contact_first_name.setText(contact!!.firstName) + contact_middle_name.setText(contact!!.middleName) + contact_surname.setText(contact!!.surname) contact_number.setText(contact!!.number) contact_email.setText(contact!!.email) } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt index 6a50b0aa..f2516e70 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt @@ -100,8 +100,8 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: MutableList { companion object { var sorting: Int = 0 @@ -38,6 +38,6 @@ data class Contact(val id: Int, var firstName: String, var middleName: String, v if (middleName.isNotEmpty()) { name += " $middleName" } - return "$name $familyName".trim() + return "$name $surname".trim() } } diff --git a/app/src/main/res/layout/activity_contact.xml b/app/src/main/res/layout/activity_contact.xml index 2c2cbbec..7d636f41 100644 --- a/app/src/main/res/layout/activity_contact.xml +++ b/app/src/main/res/layout/activity_contact.xml @@ -3,13 +3,13 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/contact_scrollview" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="@dimen/activity_margin"> + android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:padding="@dimen/activity_margin"> + + + +