Browse Source

2024-05-11 修改

修改

1. 部分页面UI界面调整

2. 代码逻辑优化
zhaiy 11 months ago
parent
commit
144b463c32
31 changed files with 299 additions and 534 deletions
  1. 0 12
      app/src/main/java/com/pan_american/android/ui/efficiency_tools/daily_payment/AddDailyPaymentActivity.kt
  2. 6 18
      app/src/main/java/com/pan_american/android/ui/group_airplane_ticket/airplane_payment_insert/AddAirplaneTicketActivity.kt
  3. 8 13
      app/src/main/java/com/pan_american/android/ui/group_common/insurance_payment_insert/AddInsurancePaymentActivity.kt
  4. 93 93
      app/src/main/java/com/pan_american/android/ui/group_hotel/hotel_predetermine/AddHotelPredetermineActivity.kt
  5. 6 18
      app/src/main/java/com/pan_american/android/ui/group_invite_official/invite_data/AddInviteDataActivity.kt
  6. 8 13
      app/src/main/java/com/pan_american/android/ui/group_invite_official/invite_official_payment_insert/AddInvitePaymentActivity.kt
  7. 8 13
      app/src/main/java/com/pan_american/android/ui/group_op/ground_convey_payment_insert/AddGroundConveyInfoActivity.kt
  8. 5 16
      app/src/main/java/com/pan_american/android/ui/group_op/ground_convey_payment_insert/GroundConveyPaymentDetailActivity.kt
  9. 8 13
      app/src/main/java/com/pan_american/android/ui/group_visa/visa_payment_insert/AddVisaPaymentActivity.kt
  10. 7 12
      app/src/main/java/com/pan_american/android/ui/resource_management/airplane_three_code/AddAirplaneThreeCodeActivity.kt
  11. 98 94
      app/src/main/java/com/pan_american/android/ui/resource_management/car_resource/AddCarResourceActivity.kt
  12. 2 0
      app/src/main/java/com/pan_american/android/ui/resource_management/car_resource/CarResourceSearchFragment.kt
  13. 11 5
      app/src/main/java/com/pan_american/android/ui/resource_management/guide_resource/AddGuideResourceActivity.kt
  14. 7 0
      app/src/main/java/com/pan_american/android/ui/resource_management/hotel_resource/AddHotelResourceActivity.kt
  15. 6 18
      app/src/main/java/com/pan_american/android/ui/resource_management/market_customer/AddNewCustomerActivity.kt
  16. 2 15
      app/src/main/res/layout/activity_add_airplane_three_code.xml
  17. 3 16
      app/src/main/res/layout/activity_add_airplane_ticket.xml
  18. 3 19
      app/src/main/res/layout/activity_add_car_resource.xml
  19. 0 8
      app/src/main/res/layout/activity_add_daily_payment.xml
  20. 2 15
      app/src/main/res/layout/activity_add_group_op_payment.xml
  21. 0 8
      app/src/main/res/layout/activity_add_guide_resource.xml
  22. 0 8
      app/src/main/res/layout/activity_add_hotel_predetermine.xml
  23. 0 8
      app/src/main/res/layout/activity_add_hotel_resource.xml
  24. 2 15
      app/src/main/res/layout/activity_add_insurance_payment.xml
  25. 2 15
      app/src/main/res/layout/activity_add_invite_data.xml
  26. 2 15
      app/src/main/res/layout/activity_add_invite_payment.xml
  27. 2 15
      app/src/main/res/layout/activity_add_new_customer.xml
  28. 2 15
      app/src/main/res/layout/activity_add_visa_payment.xml
  29. 1 0
      app/src/main/res/layout/activity_car_resource_.xml
  30. 2 15
      app/src/main/res/layout/activity_ground_convey_payment_detail.xml
  31. 3 9
      app/src/main/res/layout/fragment_car_resource_search.xml

+ 0 - 12
app/src/main/java/com/pan_american/android/ui/efficiency_tools/daily_payment/AddDailyPaymentActivity.kt

@@ -661,12 +661,6 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
 
     private fun addDailyPayment() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
-
 //        Log.e(
 //            "request", Gson().toJson(
 //                AddDailyPaymentRequest(
@@ -799,12 +793,6 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
 
     private fun updateDailyPayment() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
-
 //        Log.e(
 //            "request", Gson().toJson(
 //                UpdateDailyPaymentRequest(

+ 6 - 18
app/src/main/java/com/pan_american/android/ui/group_airplane_ticket/airplane_payment_insert/AddAirplaneTicketActivity.kt

@@ -141,7 +141,7 @@ class AddAirplaneTicketActivity : BaseActivity<ActivityAddAirplaneTicketBinding>
 
         if (fromList) {
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
 
             if (!canBeEdit()) {
                 binding.apply {
@@ -181,14 +181,14 @@ class AddAirplaneTicketActivity : BaseActivity<ActivityAddAirplaneTicketBinding>
                     airplaneTicketAgents.isEnabled = false
                     paymentApplyNotes.isEnabled(false)
 
-                    commit.text = resources.getString(R.string.back)
+                    commit.setText(resources.getString(R.string.back))
                 }
             }
 
             getAirplaneTicketDetail()
 
         } else {
-            binding.commit.text = resources.getString(R.string.add)
+            binding.commit.setText(resources.getString(R.string.add))
         }
     }
 
@@ -1114,11 +1114,7 @@ class AddAirplaneTicketActivity : BaseActivity<ActivityAddAirplaneTicketBinding>
 
     private fun updateAirplaneTicket(status: Int) {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         val updateAirplaneTicketRequest =
             UpdateAirplaneTicketRequest(status, airplaneTicketResource, cardPaymentResource)
@@ -1145,22 +1141,14 @@ class AddAirplaneTicketActivity : BaseActivity<ActivityAddAirplaneTicketBinding>
                         } else {
                             showMessage(baseResponse.msg)
 
-                            binding.commit.isEnabled = true
-
-                            binding.commit.visibility = View.VISIBLE
-
-                            binding.updateLoading.visibility = View.GONE
+                            binding.commit.setButtonStatus(0)
                         }
                     }
                 }
 
                 override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                    binding.commit.isEnabled = true
-
-                    binding.commit.visibility = View.VISIBLE
-
-                    binding.updateLoading.visibility = View.GONE
+                    binding.commit.setButtonStatus(0)
 
                     showErrorInfo(R.string.update_error)
                 }

+ 8 - 13
app/src/main/java/com/pan_american/android/ui/group_common/insurance_payment_insert/AddInsurancePaymentActivity.kt

@@ -126,7 +126,7 @@ class AddInsurancePaymentActivity : BaseActivity<ActivityAddInsurancePaymentBind
         if (fromList) {
             getInsurancePaymentDetail()
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
 
             if (!canBeEdit()) {
                 binding.apply {
@@ -146,12 +146,12 @@ class AddInsurancePaymentActivity : BaseActivity<ActivityAddInsurancePaymentBind
                     payee.isEnabled = false
                     paymentMark.isEnabled = false
 
-                    commit.text = resources.getString(R.string.back)
+                    commit.setText(resources.getString(R.string.back))
                 }
             }
 
         } else {
-            binding.commit.text = resources.getString(R.string.add)
+            binding.commit.setText(resources.getString(R.string.add))
 
             for (item in paymentWayList) {
                 if (item.id == OASystem.PAYMENT_WAY_INSURANCE_ID) {
@@ -716,11 +716,7 @@ class AddInsurancePaymentActivity : BaseActivity<ActivityAddInsurancePaymentBind
 
     private fun updateInsurancePayment() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         apiService.updateInsurancePayment(updateInsurancePaymentRequest)
             .enqueue(object : Callback<BaseResponse> {
@@ -743,6 +739,9 @@ class AddInsurancePaymentActivity : BaseActivity<ActivityAddInsurancePaymentBind
                             back()
 
                         } else {
+
+                            binding.commit.setButtonStatus(0)
+
                             showMessage(baseResponse.msg)
                         }
                     }
@@ -750,11 +749,7 @@ class AddInsurancePaymentActivity : BaseActivity<ActivityAddInsurancePaymentBind
 
                 override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                    binding.commit.isEnabled = true
-
-                    binding.commit.visibility = View.VISIBLE
-
-                    binding.updateLoading.visibility = View.GONE
+                    binding.commit.setButtonStatus(0)
 
                     showErrorInfo(R.string.update_error)
                 }

+ 93 - 93
app/src/main/java/com/pan_american/android/ui/group_hotel/hotel_predetermine/AddHotelPredetermineActivity.kt

@@ -1232,121 +1232,121 @@ class AddHotelPredetermineActivity : BaseActivity<ActivityAddHotelPredetermineBi
                             updateHotelPredetermine.isOpPay = 0
                         }
                     }
-                }
-            }
 
-            if (paymentWaySelect) {
-                updateHotelPredetermine.payDId = paymentWayId
-                when (paymentWayId) {
-                    73 -> {
-                        if (binding.companyBankNo.text.isBlank()) {
-                            showMessage(resources.getString(R.string.company_blank_number_input_hint))
-                            return@setOnClickListener
-                        } else {
-                            updateHotelPredetermine.companyBankNo =
-                                binding.companyBankNo.text.toString()
-                        }
+                    if (paymentWaySelect) {
+                        updateHotelPredetermine.payDId = paymentWayId
+                        when (paymentWayId) {
+                            73 -> {
+                                if (binding.companyBankNo.text.isBlank()) {
+                                    showMessage(resources.getString(R.string.company_blank_number_input_hint))
+                                    return@setOnClickListener
+                                } else {
+                                    updateHotelPredetermine.companyBankNo =
+                                        binding.companyBankNo.text.toString()
+                                }
 
-                        if (binding.transferOtherBankName.text.isBlank()) {
-                            showMessage(resources.getString(R.string.other_blank_name_input_hint))
-                            return@setOnClickListener
-                        } else {
-                            updateHotelPredetermine.otherBankName =
-                                binding.transferOtherBankName.text.toString()
-                        }
+                                if (binding.transferOtherBankName.text.isBlank()) {
+                                    showMessage(resources.getString(R.string.other_blank_name_input_hint))
+                                    return@setOnClickListener
+                                } else {
+                                    updateHotelPredetermine.otherBankName =
+                                        binding.transferOtherBankName.text.toString()
+                                }
 
-                        if (binding.transferOtherSideNo.text.isBlank()) {
-                            showMessage(resources.getString(R.string.other_side_no))
-                            return@setOnClickListener
-                        } else {
-                            updateHotelPredetermine.otherSideNo =
-                                binding.transferOtherSideNo.text.toString()
-                        }
+                                if (binding.transferOtherSideNo.text.isBlank()) {
+                                    showMessage(resources.getString(R.string.other_side_no))
+                                    return@setOnClickListener
+                                } else {
+                                    updateHotelPredetermine.otherSideNo =
+                                        binding.transferOtherSideNo.text.toString()
+                                }
 
-                        if (binding.transferOtherSideName.text.isBlank()) {
-                            showMessage(resources.getString(R.string.other_side_name))
-                            return@setOnClickListener
-                        } else {
-                            updateHotelPredetermine.otherSideName =
-                                binding.transferOtherSideName.text.toString()
-                        }
+                                if (binding.transferOtherSideName.text.isBlank()) {
+                                    showMessage(resources.getString(R.string.other_side_name))
+                                    return@setOnClickListener
+                                } else {
+                                    updateHotelPredetermine.otherSideName =
+                                        binding.transferOtherSideName.text.toString()
+                                }
 
-                    }
+                            }
 
-                    83 -> {
-                        if (binding.otherBankName.text.isBlank()) {
-                            showMessage(resources.getString(R.string.transfer_other_bank_name_input_hint))
-                            return@setOnClickListener
-                        } else {
-                            updateHotelPredetermine.otherBankName =
-                                binding.otherBankName.text.toString()
+                            83 -> {
+                                if (binding.otherBankName.text.isBlank()) {
+                                    showMessage(resources.getString(R.string.transfer_other_bank_name_input_hint))
+                                    return@setOnClickListener
+                                } else {
+                                    updateHotelPredetermine.otherBankName =
+                                        binding.otherBankName.text.toString()
+                                }
+
+                                if (binding.otherSideNo.text.isBlank()) {
+                                    showMessage(resources.getString(R.string.other_side_number_input_hint))
+                                    return@setOnClickListener
+                                } else {
+                                    updateHotelPredetermine.otherSideNo =
+                                        binding.otherSideNo.text.toString()
+                                }
+
+                                if (binding.otherSideName.text.isBlank()) {
+                                    showMessage(resources.getString(R.string.other_side_name_input_hint))
+                                    return@setOnClickListener
+                                } else {
+                                    updateHotelPredetermine.otherSideName =
+                                        binding.otherSideName.text.toString()
+                                }
+                            }
                         }
 
-                        if (binding.otherSideNo.text.isBlank()) {
-                            showMessage(resources.getString(R.string.other_side_number_input_hint))
-                            return@setOnClickListener
-                        } else {
-                            updateHotelPredetermine.otherSideNo =
-                                binding.otherSideNo.text.toString()
+                        binding.consumeWay.text.apply {
+                            if (isNullOrBlank()) {
+                                showMessage(resources.getString(R.string.consume_way_hint))
+                                return@setOnClickListener
+                            } else {
+                                updateHotelPredetermine.consumptionPatterns =
+                                    binding.consumeWay.text.toString()
+                            }
                         }
 
-                        if (binding.otherSideName.text.isBlank()) {
-                            showMessage(resources.getString(R.string.other_side_name_input_hint))
-                            return@setOnClickListener
+                        if (consumeDateSelect) {
+                            updateHotelPredetermine.consumptionDate = binding.consumeDate.text.toString()
                         } else {
-                            updateHotelPredetermine.otherSideName =
-                                binding.otherSideName.text.toString()
+                            showMessage(resources.getString(R.string.consume_date_select_hint))
+                            return@setOnClickListener
                         }
-                    }
-                }
 
-                binding.consumeWay.text.apply {
-                    if (isNullOrBlank()) {
-                        showMessage(resources.getString(R.string.consume_way_hint))
-                        return@setOnClickListener
-                    } else {
-                        updateHotelPredetermine.consumptionPatterns =
-                            binding.consumeWay.text.toString()
-                    }
-                }
+                        updateHotelPredetermine.payMoney = sumPayment
 
-                if (consumeDateSelect) {
-                    updateHotelPredetermine.consumptionDate = binding.consumeDate.text.toString()
-                } else {
-                    showMessage(resources.getString(R.string.consume_date_select_hint))
-                    return@setOnClickListener
-                }
+                        updateHotelPredetermine.paymentCurrency = sumUnitCurrencyId
 
-                updateHotelPredetermine.payMoney = sumPayment
+                        binding.payee.text.apply {
+                            if (isNullOrBlank()) {
+                                showMessage(resources.getString(R.string.payee_hint))
+                                return@setOnClickListener
+                            } else {
+                                updateHotelPredetermine.payee = toString()
+                            }
+                        }
 
-                updateHotelPredetermine.paymentCurrency = sumUnitCurrencyId
+                        if (paymentMarkSelect) {
+                            updateHotelPredetermine.orbitalPrivateTransfer = paymentMarkId
+                        } else {
+                            showMessage(resources.getString(R.string.payment_mark_hint))
+                            return@setOnClickListener
+                        }
 
-                binding.payee.text.apply {
-                    if (isNullOrBlank()) {
-                        showMessage(resources.getString(R.string.payee_hint))
-                        return@setOnClickListener
+                        binding.paymentApplyNotes.getText().apply {
+                            if (isNotBlank()) {
+                                updateHotelPredetermine.ccpRemark = this
+                            }
+                        }
                     } else {
-                        updateHotelPredetermine.payee = toString()
+                        showMessage(resources.getString(R.string.payment_way_hint))
                     }
-                }
 
-                if (paymentMarkSelect) {
-                    updateHotelPredetermine.orbitalPrivateTransfer = paymentMarkId
-                } else {
-                    showMessage(resources.getString(R.string.payment_mark_hint))
-                    return@setOnClickListener
+                    updateHotelPredetermine()
                 }
-
-                binding.paymentApplyNotes.getText().apply {
-                    if (isNotBlank()) {
-                        updateHotelPredetermine.ccpRemark = this
-                    }
-                }
-            } else {
-                showMessage(resources.getString(R.string.payment_way_hint))
             }
-
-            updateHotelPredetermine()
         }
     }
 

+ 6 - 18
app/src/main/java/com/pan_american/android/ui/group_invite_official/invite_data/AddInviteDataActivity.kt

@@ -148,7 +148,7 @@ class AddInviteDataActivity : BaseActivity<ActivityAddInviteDataBinding>() {
 
             getInviteDataDetail()
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
 
             if (!OASystem.authorization(OASystem.INVITE_DATA, OASystem.EDIT)) {
                 binding.apply {
@@ -170,13 +170,13 @@ class AddInviteDataActivity : BaseActivity<ActivityAddInviteDataBinding>() {
                     add.visibility = View.GONE
                     otherInfo.isEnabled(false)
 
-                    commit.text = resources.getString(R.string.back)
+                    commit.setText(resources.getString(R.string.back))
                 }
             }
 
         } else {
 
-            binding.commit.text = resources.getString(R.string.add)
+            binding.commit.setText(resources.getString(R.string.add))
 
         }
 
@@ -535,11 +535,7 @@ class AddInviteDataActivity : BaseActivity<ActivityAddInviteDataBinding>() {
 
     private fun updateInviteData() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         apiService.updateInviteData(updateInviteDataDetailRequest).enqueue(object : Callback<BaseResponse> {
             override fun onResponse(call: Call<BaseResponse>, response: Response<BaseResponse>) {
@@ -562,11 +558,7 @@ class AddInviteDataActivity : BaseActivity<ActivityAddInviteDataBinding>() {
                     } else {
                         showMessage(updateResponse.msg)
 
-                        binding.commit.isEnabled = true
-
-                        binding.commit.visibility = View.VISIBLE
-
-                        binding.updateLoading.visibility = View.GONE
+                        binding.commit.setButtonStatus(0)
                     }
                 }
 
@@ -574,11 +566,7 @@ class AddInviteDataActivity : BaseActivity<ActivityAddInviteDataBinding>() {
 
             override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                binding.commit.isEnabled = true
-
-                binding.commit.visibility = View.VISIBLE
-
-                binding.updateLoading.visibility = View.GONE
+                binding.commit.setButtonStatus(0)
 
                 showErrorInfo(R.string.update_error)
             }

+ 8 - 13
app/src/main/java/com/pan_american/android/ui/group_invite_official/invite_official_payment_insert/AddInvitePaymentActivity.kt

@@ -157,7 +157,7 @@ class AddInvitePaymentActivity : BaseActivity<ActivityAddInvitePaymentBinding>()
             //获取商邀费用详情
             getInviteOfficialDetail()
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
 
             if (!canBeEdit()) {
 
@@ -197,13 +197,13 @@ class AddInvitePaymentActivity : BaseActivity<ActivityAddInvitePaymentBinding>()
                     paymentMark.isEnabled = false
                     notes.isEnabled(false)
 
-                    commit.text = resources.getString(R.string.back)
+                    commit.setText(resources.getString(R.string.back))
                 }
 
             }
 
         } else {
-            binding.commit.text = resources.getString(R.string.add)
+            binding.commit.setText(resources.getString(R.string.add))
         }
     }
 
@@ -1196,11 +1196,7 @@ class AddInvitePaymentActivity : BaseActivity<ActivityAddInvitePaymentBinding>()
 
     private fun updateInvitePayment(type: Int) {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         apiService.inviteOfficialPaymentOperate(updateInviteOfficialRequest)
             .enqueue(object : Callback<BaseResponse> {
@@ -1222,6 +1218,9 @@ class AddInvitePaymentActivity : BaseActivity<ActivityAddInvitePaymentBinding>()
                             back()
 
                         } else {
+
+                            binding.commit.setButtonStatus(0)
+
                             showMessage(baseResponse.msg)
                         }
                     }
@@ -1229,11 +1228,7 @@ class AddInvitePaymentActivity : BaseActivity<ActivityAddInvitePaymentBinding>()
 
                 override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                    binding.commit.isEnabled = true
-
-                    binding.commit.visibility = View.VISIBLE
-
-                    binding.updateLoading.visibility = View.GONE
+                    binding.commit.setButtonStatus(0)
 
                     showErrorInfo(R.string.update_error)
                 }

+ 8 - 13
app/src/main/java/com/pan_american/android/ui/group_op/ground_convey_payment_insert/AddGroundConveyInfoActivity.kt

@@ -124,7 +124,7 @@ class AddGroundConveyInfoActivity : BaseActivity<ActivityAddGroupOpPaymentBindin
         if (fromList) {
             getGroundConveyDetail()
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
 
             if (!canBeEdit()) {
                 binding.apply {
@@ -142,11 +142,11 @@ class AddGroundConveyInfoActivity : BaseActivity<ActivityAddGroupOpPaymentBindin
                     serviceDescription.isEnabled(false)
                     notes.isEnabled(false)
 
-                    commit.text = resources.getString(R.string.back)
+                    commit.setText(resources.getString(R.string.back))
                 }
             }
         } else {
-            binding.commit.text = resources.getString(R.string.add)
+            binding.commit.setText(resources.getString(R.string.add))
         }
     }
 
@@ -561,11 +561,7 @@ class AddGroundConveyInfoActivity : BaseActivity<ActivityAddGroupOpPaymentBindin
 
     private fun updateGroundConvey() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         apiService.updateGroundConvey(updateGroundConveyRequest)
             .enqueue(object : Callback<BaseResponse> {
@@ -588,6 +584,9 @@ class AddGroundConveyInfoActivity : BaseActivity<ActivityAddGroupOpPaymentBindin
                             back()
 
                         } else {
+
+                            binding.commit.setButtonStatus(0)
+
                             showMessage(baseResponse.msg)
                         }
                     }
@@ -595,11 +594,7 @@ class AddGroundConveyInfoActivity : BaseActivity<ActivityAddGroupOpPaymentBindin
 
                 override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                    binding.commit.isEnabled = true
-
-                    binding.commit.visibility = View.VISIBLE
-
-                    binding.updateLoading.visibility = View.GONE
+                    binding.commit.setButtonStatus(0)
 
                     showErrorInfo(R.string.update_error)
                 }

+ 5 - 16
app/src/main/java/com/pan_american/android/ui/group_op/ground_convey_payment_insert/GroundConveyPaymentDetailActivity.kt

@@ -119,7 +119,7 @@ class GroundConveyPaymentDetailActivity : BaseActivity<ActivityGroundConveyPayme
         binding.paymentList.itemAnimator!!.changeDuration = 0
 
         if (!canBeEdit()) {
-            binding.commit.text = resources.getString(R.string.back)
+            binding.commit.setText(resources.getString(R.string.back))
         }
 
         headerAdapter.setCanBeEdit(canBeEdit())
@@ -638,11 +638,7 @@ class GroundConveyPaymentDetailActivity : BaseActivity<ActivityGroundConveyPayme
 
     private fun updateGroundConveyDetail() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         for (item in carTouristGuides) {
             if (item.isNew) {
@@ -686,24 +682,17 @@ class GroundConveyPaymentDetailActivity : BaseActivity<ActivityGroundConveyPayme
 
                             back()
                         } else {
-                            showMessage(updateResponse.msg)
-
-                            binding.commit.isEnabled = true
 
-                            binding.commit.visibility = View.VISIBLE
+                            binding.commit.setButtonStatus(0)
 
-                            binding.updateLoading.visibility = View.GONE
+                            showMessage(updateResponse.msg)
                         }
                     }
                 }
 
                 override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                    binding.commit.isEnabled = true
-
-                    binding.commit.visibility = View.VISIBLE
-
-                    binding.updateLoading.visibility = View.GONE
+                    binding.commit.setButtonStatus(0)
 
                     showErrorInfo(R.string.update_error)
                 }

+ 8 - 13
app/src/main/java/com/pan_american/android/ui/group_visa/visa_payment_insert/AddVisaPaymentActivity.kt

@@ -132,7 +132,7 @@ class AddVisaPaymentActivity : BaseActivity<ActivityAddVisaPaymentBinding>() {
         if (fromList) {
             getVisaPaymentDetail()
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
 
             if (!canBeEdit()) {
                 binding.apply {
@@ -162,12 +162,12 @@ class AddVisaPaymentActivity : BaseActivity<ActivityAddVisaPaymentBinding>() {
                     paymentMark.isEnabled = false
                     paymentApplyNotes.isEnabled(false)
 
-                    commit.text = resources.getString(R.string.back)
+                    commit.setText(resources.getString(R.string.back))
                 }
             }
 
         } else {
-            binding.commit.text = resources.getString(R.string.add)
+            binding.commit.setText(resources.getString(R.string.add))
 
             initCustomerList()
 
@@ -959,11 +959,7 @@ class AddVisaPaymentActivity : BaseActivity<ActivityAddVisaPaymentBinding>() {
 
     private fun updateVisaPayment() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         apiService.updateVisaPayment(updateVisaPaymentRequest)
             .enqueue(object : Callback<BaseResponse> {
@@ -986,6 +982,9 @@ class AddVisaPaymentActivity : BaseActivity<ActivityAddVisaPaymentBinding>() {
                             back()
 
                         } else {
+
+                            binding.commit.setButtonStatus(0)
+
                             showMessage(updateResponse.msg)
                         }
                     }
@@ -993,11 +992,7 @@ class AddVisaPaymentActivity : BaseActivity<ActivityAddVisaPaymentBinding>() {
 
                 override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                    binding.commit.isEnabled = true
-
-                    binding.commit.visibility = View.VISIBLE
-
-                    binding.updateLoading.visibility = View.GONE
+                    binding.commit.setButtonStatus(0)
 
                     showErrorInfo(R.string.update_error)
                 }

+ 7 - 12
app/src/main/java/com/pan_american/android/ui/resource_management/airplane_three_code/AddAirplaneThreeCodeActivity.kt

@@ -59,10 +59,10 @@ class AddAirplaneThreeCodeActivity : BaseActivity<ActivityAddAirplaneThreeCodeBi
                 intent.getSerializableExtra("airplaneResource", AirplaneThreeCode::class.java) as AirplaneThreeCode
             initAirplaneResourceInfo()
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
         } else {
 
-            binding.commit.text = resources.getString(R.string.add)
+            binding.commit.setText(resources.getString(R.string.add))
 
             airplaneThreeCode = AirplaneThreeCode()
         }
@@ -121,11 +121,7 @@ class AddAirplaneThreeCodeActivity : BaseActivity<ActivityAddAirplaneThreeCodeBi
 
     private fun updateAirplaneResource() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         val apiService = ServiceCreator.create<APIService>()
 
@@ -148,6 +144,9 @@ class AddAirplaneThreeCodeActivity : BaseActivity<ActivityAddAirplaneThreeCodeBi
                             back()
 
                         } else {
+
+                            binding.commit.setButtonStatus(0)
+
                             showMessage(baseResponse.msg)
                         }
                     }
@@ -155,11 +154,7 @@ class AddAirplaneThreeCodeActivity : BaseActivity<ActivityAddAirplaneThreeCodeBi
 
                 override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                    binding.commit.isEnabled = true
-
-                    binding.commit.visibility = View.VISIBLE
-
-                    binding.updateLoading.visibility = View.GONE
+                    binding.commit.setButtonStatus(0)
 
                     showErrorInfo(R.string.update_error)
                 }

+ 98 - 94
app/src/main/java/com/pan_american/android/ui/resource_management/car_resource/AddCarResourceActivity.kt

@@ -63,9 +63,65 @@ class AddCarResourceActivity : BaseActivity<ActivityAddCarResourceBinding>() {
         if (fromList) {
 
             carResource = intent.getSerializableExtra("carResource", CarResource::class.java) as CarResource
+
             initCarResourceInfo()
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
+
+            if (!OASystem.authorization(OASystem.CAR_RESOURCE, OASystem.EDIT)) {
+                binding.apply {
+                    carCompany.inputType = InputType.TYPE_NULL
+                    companyScore.isEnabled = false
+                    departmentArea.inputType = InputType.TYPE_NULL
+                    departmentLocation.setInputType(InputType.TYPE_NULL)
+                    contactsName.inputType = InputType.TYPE_NULL
+                    contactsPhone.inputType = InputType.TYPE_NULL
+                    contactsEmail.inputType = InputType.TYPE_NULL
+                    contactsFax.inputType = InputType.TYPE_NULL
+                    carDescription.setInputType(InputType.TYPE_NULL)
+                    otherInfo.setInputType(InputType.TYPE_NULL)
+                    otherInfo.setSingleLine(false)
+
+                    carQualificationA.isEnabled = false
+                    carQualificationB.isEnabled = false
+                    carQualificationC.isEnabled = false
+
+                    carAgeA.isEnabled = false
+                    carAgeB.isEnabled = false
+                    carAgeC.isEnabled = false
+
+                    carSurfaceA.isEnabled = false
+                    carSurfaceB.isEnabled = false
+                    carSurfaceC.isEnabled = false
+
+                    carInnerA.isEnabled = false
+                    carInnerB.isEnabled = false
+                    carInnerC.isEnabled = false
+
+                    carPrepareA.isEnabled = false
+                    carPrepareB.isEnabled = false
+                    carPrepareC.isEnabled = false
+
+                    carDisposeA.isEnabled = false
+                    carDisposeB.isEnabled = false
+                    carDisposeC.isEnabled = false
+
+                    timeConceptA.isEnabled = false
+                    timeConceptB.isEnabled = false
+                    timeConceptC.isEnabled = false
+
+                    safetyConceptA.isEnabled = false
+                    safetyConceptB.isEnabled = false
+                    safetyConceptC.isEnabled = false
+
+                    driverA.isEnabled = false
+                    driverB.isEnabled = false
+                    driverC.isEnabled = false
+
+                    commit.setText(resources.getString(R.string.back))
+                }
+            }
+
         } else {
 
             carResource = CarResource()
@@ -108,14 +164,46 @@ class AddCarResourceActivity : BaseActivity<ActivityAddCarResourceBinding>() {
         }
 
         binding.commit.setOnClickListener {
+
             if (fromList) {
-                updateCarResource()
-            } else {
-                if (isChose) {
-                    addCarResource()
-                } else {
+                if (OASystem.authorization(OASystem.CAR_RESOURCE, OASystem.EDIT)) {
+                    back()
+                    return@setOnClickListener
+                }
+            }
+
+            when {
+                binding.carCompany.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.department_name_hint))
+                }
+
+                !isChose -> {
                     showMessage(resources.getString(R.string.score_select_hint))
                 }
+
+                binding.departmentArea.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.department_location_input_hint))
+                }
+
+                binding.contactsName.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.connector_name_input_hint))
+                }
+
+                binding.contactsPhone.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.connector_phone_input_hint))
+                }
+
+                else -> {
+                    binding.commit.setButtonStatus(1)
+
+                    initCarResource()
+
+                    if (fromList) {
+                        updateCarResource()
+                    } else {
+                        addCarResource()
+                    }
+                }
             }
         }
     }
@@ -187,73 +275,12 @@ class AddCarResourceActivity : BaseActivity<ActivityAddCarResourceBinding>() {
             "B" -> binding.driverB.isChecked = true
             "C" -> binding.driverC.isChecked = true
         }
-
-        if (!OASystem.authorization(OASystem.CAR_RESOURCE, OASystem.EDIT)) {
-            binding.apply {
-                carCompany.inputType = InputType.TYPE_NULL
-                companyScore.isEnabled = false
-                departmentArea.inputType = InputType.TYPE_NULL
-                departmentLocation.setInputType(InputType.TYPE_NULL)
-                contactsName.inputType = InputType.TYPE_NULL
-                contactsPhone.inputType = InputType.TYPE_NULL
-                contactsEmail.inputType = InputType.TYPE_NULL
-                contactsFax.inputType = InputType.TYPE_NULL
-                carDescription.setInputType(InputType.TYPE_NULL)
-                otherInfo.setInputType(InputType.TYPE_NULL)
-                otherInfo.setSingleLine(false)
-
-                carQualificationA.isEnabled = false
-                carQualificationB.isEnabled = false
-                carQualificationC.isEnabled = false
-
-                carAgeA.isEnabled = false
-                carAgeB.isEnabled = false
-                carAgeC.isEnabled = false
-
-                carSurfaceA.isEnabled = false
-                carSurfaceB.isEnabled = false
-                carSurfaceC.isEnabled = false
-
-                carInnerA.isEnabled = false
-                carInnerB.isEnabled = false
-                carInnerC.isEnabled = false
-
-                carPrepareA.isEnabled = false
-                carPrepareB.isEnabled = false
-                carPrepareC.isEnabled = false
-
-                carDisposeA.isEnabled = false
-                carDisposeB.isEnabled = false
-                carDisposeC.isEnabled = false
-
-                timeConceptA.isEnabled = false
-                timeConceptB.isEnabled = false
-                timeConceptC.isEnabled = false
-
-                safetyConceptA.isEnabled = false
-                safetyConceptB.isEnabled = false
-                safetyConceptC.isEnabled = false
-
-                driverA.isEnabled = false
-                driverB.isEnabled = false
-                driverC.isEnabled = false
-
-                commit.visibility = View.GONE
-            }
-        }
     }
 
     /**
      * 修改车辆资源数据
      */
     private fun updateCarResource() {
-        initCarResource()
-
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
 
         val apiService = ServiceCreator.create<APIService>()
         apiService.updateCarData(carResource).enqueue(object : Callback<BaseResponse> {
@@ -269,22 +296,14 @@ class AddCarResourceActivity : BaseActivity<ActivityAddCarResourceBinding>() {
                     } else {
                         showMessage(baseResponse.msg)
 
-                        binding.commit.isEnabled = true
-
-                        binding.commit.visibility = View.VISIBLE
-
-                        binding.updateLoading.visibility = View.GONE
+                        binding.commit.setButtonStatus(0)
                     }
                 }
             }
 
             override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                binding.commit.isEnabled = true
-
-                binding.commit.visibility = View.VISIBLE
-
-                binding.updateLoading.visibility = View.GONE
+                binding.commit.setButtonStatus(0)
 
                 showErrorInfo(R.string.update_error)
             }
@@ -295,13 +314,6 @@ class AddCarResourceActivity : BaseActivity<ActivityAddCarResourceBinding>() {
      * 新增车辆资源数据
      */
     private fun addCarResource() {
-        initCarResource()
-
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
 
         val apiService = ServiceCreator.create<APIService>()
         apiService.addCarData(carResource).enqueue(object : Callback<BaseResponse> {
@@ -317,22 +329,14 @@ class AddCarResourceActivity : BaseActivity<ActivityAddCarResourceBinding>() {
                     } else {
                         showMessage(baseResponse.msg)
 
-                        binding.commit.isEnabled = true
-
-                        binding.commit.visibility = View.VISIBLE
-
-                        binding.updateLoading.visibility = View.GONE
+                        binding.commit.setButtonStatus(0)
                     }
                 }
             }
 
             override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                binding.commit.isEnabled = true
-
-                binding.commit.visibility = View.VISIBLE
-
-                binding.updateLoading.visibility = View.GONE
+                binding.commit.setButtonStatus(0)
 
                 showErrorInfo(R.string.update_error)
             }

+ 2 - 0
app/src/main/java/com/pan_american/android/ui/resource_management/car_resource/CarResourceSearchFragment.kt

@@ -83,6 +83,8 @@ class CarResourceSearchFragment : BaseFragment<FragmentCarResourceSearchBinding>
         } else {
             binding.supplierLocation.text = resources.getString(R.string.all)
         }
+
+        binding.commit.setText(resources.getString(R.string.search))
     }
 
     override fun initEvents() {

+ 11 - 5
app/src/main/java/com/pan_american/android/ui/resource_management/guide_resource/AddGuideResourceActivity.kt

@@ -68,6 +68,8 @@ class AddGuideResourceActivity : BaseActivity<ActivityAddGuideResourceBinding>()
 
             guideResource = intent.getSerializableExtra("guideResource", GuideResource::class.java) as GuideResource
 
+            initGuideResourceInfo()
+
             binding.commit.setText(resources.getString(R.string.update))
 
             if (!OASystem.authorization(OASystem.GUIDE_RESOURCE, OASystem.EDIT)) {
@@ -115,8 +117,6 @@ class AddGuideResourceActivity : BaseActivity<ActivityAddGuideResourceBinding>()
                 }
             }
 
-            initGuideResourceInfo()
-
         } else {
 
             binding.commit.setText(resources.getString(R.string.add))
@@ -196,6 +196,13 @@ class AddGuideResourceActivity : BaseActivity<ActivityAddGuideResourceBinding>()
 
         binding.commit.setOnClickListener {
 
+            if (fromList) {
+                if (!OASystem.authorization(OASystem.GUIDE_RESOURCE, OASystem.EDIT)) {
+                    back()
+                    return@setOnClickListener
+                }
+            }
+
             when {
                 guideTypeId == -1 -> {
                     showMessage(resources.getString(R.string.guide_type_select_hint))
@@ -222,14 +229,13 @@ class AddGuideResourceActivity : BaseActivity<ActivityAddGuideResourceBinding>()
                 }
 
                 else -> {
-
                     if (fromList) {
                         initGuideResource(2)
-                        updateGuideResourceInfo()
                     } else {
                         initGuideResource(1)
-                        updateGuideResourceInfo()
                     }
+
+                    updateGuideResourceInfo()
                 }
             }
         }

+ 7 - 0
app/src/main/java/com/pan_american/android/ui/resource_management/hotel_resource/AddHotelResourceActivity.kt

@@ -130,6 +130,13 @@ class AddHotelResourceActivity : BaseActivity<ActivityAddHotelResourceBinding>()
 
         binding.commit.setOnClickListener {
 
+            if (fromList) {
+                if (!OASystem.authorization(OASystem.HOTEL_RESOURCE, OASystem.EDIT)) {
+                    back()
+                    return@setOnClickListener
+                }
+            }
+
             when {
                 binding.hotelName.text.isNullOrBlank() -> {
                     showMessage(resources.getString(R.string.hotel_name_input_hint))

+ 6 - 18
app/src/main/java/com/pan_american/android/ui/resource_management/market_customer/AddNewCustomerActivity.kt

@@ -171,7 +171,7 @@ class AddNewCustomerActivity : BaseActivity<ActivityAddNewCustomerBinding>() {
 
         if (fromList) {
 
-            binding.commit.text = resources.getString(R.string.update)
+            binding.commit.setText(resources.getString(R.string.update))
 
             id = intent.getIntExtra("id", 0)
 
@@ -203,12 +203,12 @@ class AddNewCustomerActivity : BaseActivity<ActivityAddNewCustomerBinding>() {
                     businessCategory.isEnabled = false
                     notes.isEnabled(false)
 
-                    commit.text = resources.getString(R.string.back)
+                    commit.setText(resources.getString(R.string.back))
                 }
             }
 
         } else {
-            binding.commit.text = resources.getString(R.string.add)
+            binding.commit.setText(resources.getString(R.string.add))
 
             marketCustomer = MarketCustomer()
         }
@@ -745,11 +745,7 @@ class AddNewCustomerActivity : BaseActivity<ActivityAddNewCustomerBinding>() {
 
     private fun updateMarketCustomerInfo() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
+        binding.commit.setButtonStatus(1)
 
         apiService.newClientOperation(marketCustomer).enqueue(object : Callback<BaseResponse> {
             override fun onResponse(call: Call<BaseResponse>, response: Response<BaseResponse>) {
@@ -769,22 +765,14 @@ class AddNewCustomerActivity : BaseActivity<ActivityAddNewCustomerBinding>() {
                     } else {
                         showMessage(baseResponse.msg)
 
-                        binding.commit.isEnabled = true
-
-                        binding.commit.visibility = View.VISIBLE
-
-                        binding.updateLoading.visibility = View.GONE
+                        binding.commit.setButtonStatus(0)
                     }
                 }
             }
 
             override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
 
-                binding.commit.isEnabled = true
-
-                binding.commit.visibility = View.VISIBLE
-
-                binding.updateLoading.visibility = View.GONE
+                binding.commit.setButtonStatus(0)
 
                 showErrorInfo(R.string.update_error)
             }

+ 2 - 15
app/src/main/res/layout/activity_add_airplane_three_code.xml

@@ -255,23 +255,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
+                    android:layout_height="match_parent" />
 
             </LinearLayout>
         </LinearLayout>

+ 3 - 16
app/src/main/res/layout/activity_add_airplane_ticket.xml

@@ -1630,24 +1630,11 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
-
+                    android:layout_height="match_parent" />
+                
             </LinearLayout>
         </LinearLayout>
     </ScrollView>

+ 3 - 19
app/src/main/res/layout/activity_add_car_resource.xml

@@ -33,11 +33,10 @@
                 android:orientation="horizontal">
 
                 <TextView
-                    android:id="@+id/hotel_name_title"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_gravity="center"
-                    android:text="@string/car_company"
+                    android:text="@string/department_name"
                     android:textSize="@dimen/text_size_medium" />
 
                 <EditText
@@ -69,7 +68,6 @@
                 android:orientation="horizontal">
 
                 <TextView
-                    android:id="@+id/hotel_level_title"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_gravity="center"
@@ -140,7 +138,6 @@
                 android:orientation="vertical">
 
                 <TextView
-                    android:id="@+id/hotel_address_title"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_marginBottom="@dimen/common_padding"
@@ -1161,23 +1158,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
+                    android:layout_height="match_parent" />
 
             </LinearLayout>
         </LinearLayout>

+ 0 - 8
app/src/main/res/layout/activity_add_daily_payment.xml

@@ -337,14 +337,6 @@
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"/>
 
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
-
             </LinearLayout>
 
         </LinearLayout>

+ 2 - 15
app/src/main/res/layout/activity_add_group_op_payment.xml

@@ -657,23 +657,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
+                    android:layout_height="match_parent" />
 
             </LinearLayout>
         </LinearLayout>

+ 0 - 8
app/src/main/res/layout/activity_add_guide_resource.xml

@@ -952,14 +952,6 @@
                     android:layout_width="match_parent"
                     android:layout_height="match_parent" />
 
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
-
             </LinearLayout>
         </LinearLayout>
     </ScrollView>

+ 0 - 8
app/src/main/res/layout/activity_add_hotel_predetermine.xml

@@ -2205,14 +2205,6 @@
                     android:layout_width="match_parent"
                     android:layout_height="match_parent" />
 
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
-
             </LinearLayout>
         </LinearLayout>
     </ScrollView>

+ 0 - 8
app/src/main/res/layout/activity_add_hotel_resource.xml

@@ -343,14 +343,6 @@
                     android:layout_width="match_parent"
                     android:layout_height="match_parent" />
 
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
-
             </LinearLayout>
         </LinearLayout>
     </ScrollView>

+ 2 - 15
app/src/main/res/layout/activity_add_insurance_payment.xml

@@ -1016,23 +1016,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
+                    android:layout_height="match_parent" />
 
             </LinearLayout>
         </LinearLayout>

+ 2 - 15
app/src/main/res/layout/activity_add_invite_data.xml

@@ -655,23 +655,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
+                    android:layout_height="match_parent" />
 
             </LinearLayout>
         </LinearLayout>

+ 2 - 15
app/src/main/res/layout/activity_add_invite_payment.xml

@@ -1544,23 +1544,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
+                    android:layout_height="match_parent" />
 
             </LinearLayout>
         </LinearLayout>

+ 2 - 15
app/src/main/res/layout/activity_add_new_customer.xml

@@ -851,23 +851,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
+                    android:layout_height="match_parent" />
 
             </LinearLayout>
 

+ 2 - 15
app/src/main/res/layout/activity_add_visa_payment.xml

@@ -1206,23 +1206,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="horizontal">
 
-                <TextView
+                <com.pan_american.android.util.CommitButton
                     android:id="@+id/commit"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:gravity="center"
-                    android:text="@string/add"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
-
-                <ProgressBar
-                    android:id="@+id/update_loading"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_margin="@dimen/common_padding_small"
-                    android:indeterminateTint="@color/white"
-                    android:visibility="gone" />
+                    android:layout_height="match_parent" />
 
             </LinearLayout>
         </LinearLayout>

+ 1 - 0
app/src/main/res/layout/activity_car_resource_.xml

@@ -3,6 +3,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@color/background_color"
     android:orientation="vertical"
     tools:context=".ui.resource_management.car_resource.CarResourceActivity">
 

+ 2 - 15
app/src/main/res/layout/activity_ground_convey_payment_detail.xml

@@ -59,23 +59,10 @@
             android:background="@drawable/shape_corner_solid_blue"
             android:orientation="horizontal">
 
-            <TextView
+            <com.pan_american.android.util.CommitButton
                 android:id="@+id/commit"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:gravity="center"
-                android:text="@string/update"
-                android:textColor="@color/white"
-                android:textSize="@dimen/text_size_large"
-                android:textStyle="bold" />
-
-            <ProgressBar
-                android:id="@+id/update_loading"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_margin="@dimen/common_padding_small"
-                android:indeterminateTint="@color/white"
-                android:visibility="gone" />
+                android:layout_height="match_parent" />
 
         </LinearLayout>
     </LinearLayout>

+ 3 - 9
app/src/main/res/layout/fragment_car_resource_search.xml

@@ -163,16 +163,10 @@
         android:layout_margin="@dimen/common_padding_huge"
         android:orientation="horizontal">
 
-        <TextView
+        <com.pan_american.android.util.CommitButton
             android:id="@+id/commit"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/button_height"
-            android:layout_marginBottom="50dp"
-            android:background="@drawable/shape_corner_solid_blue"
-            android:gravity="center"
-            android:text="@string/confirm"
-            android:textColor="@color/white"
-            android:textSize="@dimen/text_size_large"
-            android:textStyle="bold" />
+            android:layout_height="@dimen/button_height" />
+
     </LinearLayout>
 </LinearLayout>