Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.

Commit 42fef64

Browse files
committed
Disable place order button when user has no delivery address
1 parent 5fac10f commit 42fef64

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

app/src/main/java/com/marknkamau/justjava/ui/checkout/CheckoutActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class CheckoutActivity : AppCompatActivity() {
8383
btnAddDeliveryAddress.visibility = View.GONE
8484
btnChangeDeliveryAddress.visibility = View.VISIBLE
8585
tvDeliveryAddress.visibility = View.VISIBLE
86+
btnPlaceOrder.isEnabled = true
8687

8788
loadAddressList()
8889
}
@@ -115,6 +116,7 @@ class CheckoutActivity : AppCompatActivity() {
115116
btnAddDeliveryAddress.visibility = View.VISIBLE
116117
btnChangeDeliveryAddress.visibility = View.GONE
117118
tvDeliveryAddress.visibility = View.GONE
119+
btnPlaceOrder.isEnabled = false
118120
} else {
119121
btnAddDeliveryAddress.visibility = View.GONE
120122
btnChangeDeliveryAddress.visibility = View.VISIBLE

0 commit comments

Comments
 (0)