From db7e1d9dd3018cf0180998e3e1667785a830352d Mon Sep 17 00:00:00 2001 From: Alexandru2909 Date: Thu, 28 Apr 2022 17:22:11 +0300 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/24971 - Split full name from Address editor into first, middle and last name --- .../address/view/AddressEditorView.kt | 8 +- .../res/layout/fragment_address_editor.xml | 104 ++++++++++++++++-- app/src/main/res/values/strings.xml | 8 +- 3 files changed, 107 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/settings/address/view/AddressEditorView.kt b/app/src/main/java/org/mozilla/fenix/settings/address/view/AddressEditorView.kt index 5e822a6598..fe2363b4f7 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/address/view/AddressEditorView.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/address/view/AddressEditorView.kt @@ -23,7 +23,7 @@ class AddressEditorView( * Binds the view. */ fun bind() { - binding.fullNameInput.apply { + binding.firstNameInput.apply { requestFocus() placeCursorAtEnd() showKeyboard() @@ -43,9 +43,9 @@ class AddressEditorView( interactor.onSaveAddress( UpdatableAddressFields( - givenName = binding.fullNameInput.text.toString(), - additionalName = "", - familyName = "", + givenName = binding.firstNameInput.text.toString(), + additionalName = binding.middleNameInput.text.toString(), + familyName = binding.lastNameInput.text.toString(), organization = "", streetAddress = binding.streetAddressInput.text.toString(), addressLevel3 = "", diff --git a/app/src/main/res/layout/fragment_address_editor.xml b/app/src/main/res/layout/fragment_address_editor.xml index 14a3ae571b..74673b2079 100644 --- a/app/src/main/res/layout/fragment_address_editor.xml +++ b/app/src/main/res/layout/fragment_address_editor.xml @@ -14,25 +14,25 @@ android:layout_height="wrap_content" android:layout_margin="16dp"> - + + app:layout_constraintTop_toBottomOf="@+id/first_name_title"> + + + + + + + + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/last_name_layout" /> Manage addresses - Full Name + Full Name + + First Name + + Middle Name + + Last Name Street Address