Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import kotlinx.android.synthetic.main.fragment_attendee.view.email
import kotlinx.android.synthetic.main.fragment_attendee.view.firstName
import kotlinx.android.synthetic.main.fragment_attendee.view.helloUser
import kotlinx.android.synthetic.main.fragment_attendee.view.lastName
import kotlinx.android.synthetic.main.fragment_attendee.view.postalCode
import kotlinx.android.synthetic.main.fragment_attendee.view.billingPostalCode
import kotlinx.android.synthetic.main.fragment_attendee.view.attendeeScrollView
import kotlinx.android.synthetic.main.fragment_attendee.view.accept
import kotlinx.android.synthetic.main.fragment_attendee.view.amount
Expand Down Expand Up @@ -62,18 +62,18 @@ import kotlinx.android.synthetic.main.fragment_attendee.view.countryPickerContai
import kotlinx.android.synthetic.main.fragment_attendee.view.billingInfoContainer
import kotlinx.android.synthetic.main.fragment_attendee.view.billingInfoCheckboxSection
import kotlinx.android.synthetic.main.fragment_attendee.view.billingEnabledCheckbox
import kotlinx.android.synthetic.main.fragment_attendee.view.city
import kotlinx.android.synthetic.main.fragment_attendee.view.company
import kotlinx.android.synthetic.main.fragment_attendee.view.billingCity
import kotlinx.android.synthetic.main.fragment_attendee.view.billingCompany
import kotlinx.android.synthetic.main.fragment_attendee.view.taxId
import kotlinx.android.synthetic.main.fragment_attendee.view.address
import kotlinx.android.synthetic.main.fragment_attendee.view.billingAddress
import kotlinx.android.synthetic.main.fragment_attendee.view.firstNameLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.lastNameLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.emailLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.companyLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.addressLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.billingCompanyLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.billingAddressLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.cvcLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.cityLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.postalCodeLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.billingCityLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.billingPostalCodeLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.cardNumberLayout
import kotlinx.android.synthetic.main.fragment_attendee.view.sameBuyerCheckBox
import kotlinx.android.synthetic.main.fragment_attendee.view.timeoutTextView
Expand Down Expand Up @@ -503,10 +503,10 @@ class AttendeeFragment : Fragment(), ComplexBackPressFragment {
}

private fun setupBillingInfo() {
rootView.companyLayout.setRequired()
rootView.addressLayout.setRequired()
rootView.cityLayout.setRequired()
rootView.postalCodeLayout.setRequired()
rootView.billingCompanyLayout.setRequired()
rootView.billingAddressLayout.setRequired()
rootView.billingCityLayout.setRequired()
rootView.billingPostalCodeLayout.setRequired()
rootView.billingInfoContainer.isVisible = rootView.billingEnabledCheckbox.isChecked
attendeeViewModel.billingEnabled = rootView.billingEnabledCheckbox.isChecked
rootView.billingEnabledCheckbox.setOnCheckedChangeListener { _, isChecked ->
Expand Down Expand Up @@ -698,12 +698,12 @@ class AttendeeFragment : Fragment(), ComplexBackPressFragment {

private fun checkRequiredFields(): Boolean {
val checkBasicInfo = rootView.firstName.checkEmpty() && rootView.lastName.checkEmpty() &&
rootView.email.checkEmpty() && rootView.email.checkEmpty() && rootView.email.checkValidEmail()
rootView.email.checkEmpty()

var checkBillingInfo = true
if (rootView.billingEnabledCheckbox.isChecked) {
checkBillingInfo = rootView.company.checkEmpty() && rootView.company.checkEmpty() &&
rootView.address.checkEmpty() && rootView.city.checkEmpty() && rootView.postalCode.checkEmpty()
checkBillingInfo = rootView.billingCompany.checkEmpty() && rootView.billingAddress.checkEmpty() &&
rootView.billingCity.checkEmpty() && rootView.billingPostalCode.checkEmpty()
}

var checkStripeInfo = true
Expand Down Expand Up @@ -755,11 +755,11 @@ class AttendeeFragment : Fragment(), ComplexBackPressFragment {
val paymentOption =
if (safeArgs.amount != 0F) getPaymentMode(rootView.paymentSelector.selectedItem.toString())
else PAYMENT_MODE_FREE
val company = rootView.company.text.toString()
val city = rootView.city.text.toString()
val company = rootView.billingCompany.text.toString()
val city = rootView.billingCity.text.toString()
val taxId = rootView.taxId.text.toString()
val address = rootView.address.text.toString()
val postalCode = rootView.postalCode.text.toString()
val address = rootView.billingAddress.text.toString()
val postalCode = rootView.billingPostalCode.text.toString()
attendeeViewModel.createAttendees(attendees, country, company, taxId, address,
city, postalCode, paymentOption)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import kotlinx.android.synthetic.main.item_attendee.view.lastNameLayout
import kotlinx.android.synthetic.main.item_attendee.view.lastName
import kotlinx.android.synthetic.main.item_attendee.view.emailLayout
import kotlinx.android.synthetic.main.item_attendee.view.email
import kotlinx.android.synthetic.main.item_attendee.view.billingAddressLayout
import kotlinx.android.synthetic.main.item_attendee.view.billingAddress
import kotlinx.android.synthetic.main.item_attendee.view.attendeeBillingAddressLayout
import kotlinx.android.synthetic.main.item_attendee.view.attendeeBillingAddress
import kotlinx.android.synthetic.main.item_attendee.view.phoneLayout
import kotlinx.android.synthetic.main.item_attendee.view.phone
import kotlinx.android.synthetic.main.item_attendee.view.workPhoneLayout
Expand Down Expand Up @@ -113,7 +113,7 @@ class AttendeeViewHolder(private val binding: ItemAttendeeBinding) : RecyclerVie
jobTitle = itemView.jobTitle.text.toString().emptyToNull(),
phone = itemView.phone.text.toString().emptyToNull(),
taxBusinessInfo = itemView.taxBusinessInfo.text.toString().emptyToNull(),
billingAddress = itemView.billingAddress.text.toString().emptyToNull(),
billingAddress = itemView.attendeeBillingAddress.text.toString().emptyToNull(),
homeAddress = itemView.homeAddress.text.toString().emptyToNull(),
shippingAddress = itemView.shippingAddress.text.toString().emptyToNull(),
company = itemView.company.text.toString().emptyToNull(),
Expand Down Expand Up @@ -161,7 +161,8 @@ class AttendeeViewHolder(private val binding: ItemAttendeeBinding) : RecyclerVie
FormIdentifier.TAX_INFO ->
setupField(itemView.taxBusinessInfoLayout, itemView.taxBusinessInfo, form.isRequired, textWatcher)
FormIdentifier.BILLING_ADDRESS ->
setupField(itemView.billingAddressLayout, itemView.billingAddress, form.isRequired, textWatcher)
setupField(itemView.attendeeBillingAddressLayout, itemView.attendeeBillingAddress, form.isRequired,
textWatcher)
FormIdentifier.HOME_ADDRESS ->
setupField(itemView.homeAddressLayout, itemView.homeAddress, form.isRequired, textWatcher)
FormIdentifier.SHIPPING_ADDRESS ->
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/layout/fragment_attendee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
android:visibility="gone"
tools:visibility="visible">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/companyLayout"
android:id="@+id/billingCompanyLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -407,7 +407,7 @@
android:hint="@string/company" >

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/company"
android:id="@+id/billingCompany"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
Expand All @@ -425,7 +425,7 @@
android:hint="@string/tax_id" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/addressLayout"
android:id="@+id/billingAddressLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -434,12 +434,12 @@
android:hint="@string/address" >

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/address"
android:id="@+id/billingAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/cityLayout"
android:id="@+id/billingCityLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -448,12 +448,12 @@
android:hint="@string/city" >

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/city"
android:id="@+id/billingCity"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/postalCodeLayout"
android:id="@+id/billingPostalCodeLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -462,7 +462,7 @@
android:hint="@string/postal_code" >

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/postalCode"
android:id="@+id/billingPostalCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_attendee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:id="@+id/billingAddressLayout"
android:id="@+id/attendeeBillingAddressLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/padding_medium"
Expand All @@ -194,7 +194,7 @@
tools:visibility="visible">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/billingAddress"
android:id="@+id/attendeeBillingAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{attendee.billingAddress}"/>
Expand Down