浏览代码

2024-05-10 修改

修改

1. 部分页面UI界面调整

2. 代码逻辑优化

3. 酒店资料录入界面 补充必填提示

4. 部分UI控件动画效果优化
zhaiy 1 年之前
父节点
当前提交
4a3fbac8dc
共有 22 个文件被更改,包括 347 次插入206 次删除
  1. 1 1
      app/src/main/java/com/pan_american/android/base/BaseActivity.kt
  2. 1 1
      app/src/main/java/com/pan_american/android/base/BaseFragment.kt
  3. 17 28
      app/src/main/java/com/pan_american/android/ui/efficiency_tools/daily_payment/AddDailyPaymentActivity.kt
  4. 67 20
      app/src/main/java/com/pan_american/android/ui/efficiency_tools/daily_payment/DailyPaymentListActivity.kt
  5. 6 13
      app/src/main/java/com/pan_american/android/ui/login/LoginActivity.kt
  6. 73 47
      app/src/main/java/com/pan_american/android/ui/resource_management/hotel_resource/AddHotelResourceActivity.kt
  7. 0 1
      app/src/main/java/com/pan_american/android/ui/resource_management/hotel_resource/HotelResourceActivity.kt
  8. 16 9
      app/src/main/java/com/pan_american/android/ui/resource_management/hotel_resource/HotelResourceListFragment.kt
  9. 18 5
      app/src/main/java/com/pan_american/android/ui/resource_management/hotel_resource/HotelResourceSearchFragment.kt
  10. 72 0
      app/src/main/java/com/pan_american/android/util/CommitButton.kt
  11. 14 0
      app/src/main/res/anim/popup_to_bottom.xml
  12. 2 7
      app/src/main/res/layout/activity_add_daily_payment.xml
  13. 9 14
      app/src/main/res/layout/activity_add_hotel_resource.xml
  14. 2 9
      app/src/main/res/layout/activity_daliy_payment_list.xml
  15. 2 3
      app/src/main/res/layout/activity_hotel_resource.xml
  16. 3 26
      app/src/main/res/layout/activity_login.xml
  17. 3 5
      app/src/main/res/layout/fragment_hotel_resource_list.xml
  18. 2 9
      app/src/main/res/layout/fragment_hotel_resource_search.xml
  19. 5 4
      app/src/main/res/layout/item_hotel_list.xml
  20. 29 0
      app/src/main/res/layout/layout_commit_button.xml
  21. 3 3
      app/src/main/res/layout/layout_scroll_edit_text.xml
  22. 2 1
      app/src/main/res/values/styles.xml

+ 1 - 1
app/src/main/java/com/pan_american/android/base/BaseActivity.kt

@@ -146,7 +146,7 @@ abstract class BaseActivity<T: ViewBinding>: AppCompatActivity() {
                     //手势提示条适配
                     isClippingEnabled = false
                     //设置动画效果
-                    animationStyle = R.style.AnimationBottomIn
+                    animationStyle = R.style.AnimationBottomPopup
                     //设置聚焦,点击外部可以取消
                     isOutsideTouchable = true
                     isFocusable = true

+ 1 - 1
app/src/main/java/com/pan_american/android/base/BaseFragment.kt

@@ -96,7 +96,7 @@ abstract class BaseFragment<T: ViewBinding>: Fragment() {
             //手势提示条适配
             isClippingEnabled = false
             //设置动画效果
-            animationStyle = R.style.AnimationBottomIn
+            animationStyle = R.style.AnimationBottomPopup
             //设置聚焦,点击外部可以取消
             isOutsideTouchable = true
             isFocusable = true

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

@@ -108,7 +108,7 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
         }
 
         initTitle()
-
+        initViews()
         //获取类型标识、转账标识和公司列表再初始化界面
         getSelectorItem()
     }
@@ -134,12 +134,8 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
     override fun initViews() {
 
         if (fromList) {
-
-            //根据ID获取日付item详情
-            getDailyPaymentFromId(dailyPaymentId)
-
             if (canBeEdit()) {
-                binding.commit.text = resources.getString(R.string.update)
+                binding.commit.setText(resources.getString(R.string.update))
             } else {
                 binding.paymentIdentification.isEnabled = false
                 binding.transferIdentification.isEnabled = false
@@ -149,10 +145,12 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
                 binding.paymentNotes.isEnabled(false)
                 binding.addPaymentItem.visibility = View.GONE
 
-                binding.commit.text = resources.getString(R.string.back)
+                binding.commit.setText(resources.getString(R.string.back))
             }
 
         } else {
+            binding.commit.setText(resources.getString(R.string.submit))
+
             setTotalPayment()
         }
     }
@@ -494,6 +492,9 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
                 }
 
                 else -> {
+
+                    binding.commit.setButtonStatus(1)
+
                     if (fromList) {
                         updateDailyPayment()
                     } else {
@@ -527,7 +528,11 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
                             transferIdentification =
                                 dailyPaymentSelectorItemResponse.data.feeTypeSubData
 
-                            initViews()
+                            if (fromList) {
+                                //根据ID获取日付item详情
+                                getDailyPaymentFromId(dailyPaymentId)
+                            }
+
                             initEvents()
 
                         } else {
@@ -697,22 +702,14 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
                     } 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)
 
                 showMessage(resources.getString(R.string.network_error))
             }
@@ -847,22 +844,14 @@ class AddDailyPaymentActivity : BaseActivity<ActivityAddDailyPaymentBinding>() {
                     } 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)
 
                 showMessage(resources.getString(R.string.network_error))
             }

+ 67 - 20
app/src/main/java/com/pan_american/android/ui/efficiency_tools/daily_payment/DailyPaymentListActivity.kt

@@ -71,7 +71,7 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
         dailyPaymentListRequest.pageSize = 10
 
         initTitle()
-
+        initViews()
         //先获取筛选列表信息,再初始化界面
         initSiftItems()
     }
@@ -79,7 +79,7 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
     override fun onStart() {
         super.onStart()
 
-        initViews()
+        getDailyPaymentList()
     }
 
     override fun initTitle() {
@@ -106,19 +106,10 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
     }
 
     override fun initViews() {
-
-        if (!OASystem.authorization(OASystem.DAILY_PAYMENT, OASystem.PROCESS)) {
-            binding.createUser.text = OASystem.userInfo.cnName
-        }
-
-        binding.dailyPaymentContainer.setRefreshHeader(ClassicsHeader(OASystem.context))
-        binding.dailyPaymentContainer.setRefreshFooter(ClassicsFooter(OASystem.context))
-
-        initDailyPaymentList(1)
+        binding.commit.setText(resources.getString(R.string.sift))
     }
 
     override fun initEvents() {
-
         initSiftOnClickListener()
     }
 
@@ -197,9 +188,21 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
                             text = data.name
 
                             if (binding.paymentType.text == data.name) {
-                                setTextColor(ResourcesCompat.getColor(resources, R.color.text_color_blue, null))
+                                setTextColor(
+                                    ResourcesCompat.getColor(
+                                        resources,
+                                        R.color.text_color_blue,
+                                        null
+                                    )
+                                )
                             } else {
-                                setTextColor(ResourcesCompat.getColor(resources, R.color.text_color, null))
+                                setTextColor(
+                                    ResourcesCompat.getColor(
+                                        resources,
+                                        R.color.text_color,
+                                        null
+                                    )
+                                )
                             }
                         }
                     }
@@ -255,9 +258,21 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
                             text = data.name
 
                             if (binding.paymentSubType.text == data.name) {
-                                setTextColor(ResourcesCompat.getColor(resources, R.color.text_color_blue, null))
+                                setTextColor(
+                                    ResourcesCompat.getColor(
+                                        resources,
+                                        R.color.text_color_blue,
+                                        null
+                                    )
+                                )
                             } else {
-                                setTextColor(ResourcesCompat.getColor(resources, R.color.text_color, null))
+                                setTextColor(
+                                    ResourcesCompat.getColor(
+                                        resources,
+                                        R.color.text_color,
+                                        null
+                                    )
+                                )
                             }
                         }
                     }
@@ -305,9 +320,21 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
                             text = data.cnName
 
                             if (binding.createUser.text == data.cnName) {
-                                setTextColor(ResourcesCompat.getColor(resources, R.color.text_color_blue, null))
+                                setTextColor(
+                                    ResourcesCompat.getColor(
+                                        resources,
+                                        R.color.text_color_blue,
+                                        null
+                                    )
+                                )
                             } else {
-                                setTextColor(ResourcesCompat.getColor(resources, R.color.text_color, null))
+                                setTextColor(
+                                    ResourcesCompat.getColor(
+                                        resources,
+                                        R.color.text_color,
+                                        null
+                                    )
+                                )
                             }
                         }
                     }
@@ -378,11 +405,14 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
 
             dailyPaymentCardListItems.clear()
 
+            binding.commit.setButtonStatus(1)
+
             initDailyPaymentList(1)
         }
     }
 
     private fun initDailyPaymentList(type: Int) {
+
         if (!listInit) {
             apiService.getDailyPaymentList(dailyPaymentListRequest)
                 .enqueue(object : Callback<DailyPaymentListResponse> {
@@ -393,6 +423,7 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
                         val dailyPaymentResponse = response.body()
                         if (dailyPaymentResponse != null) {
                             if (dailyPaymentResponse.code == 200) {
+
                                 for (item in dailyPaymentResponse.data.dataList) {
                                     dailyPaymentCardListItems.add(item)
                                 }
@@ -436,9 +467,12 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
                                 showMessage(dailyPaymentResponse.msg)
                             }
                         }
+
+                        binding.commit.setButtonStatus(0)
                     }
 
                     override fun onFailure(call: Call<DailyPaymentListResponse>, t: Throwable) {
+                        binding.commit.setButtonStatus(0)
                         showMessage(resources.getString(R.string.network_error))
                     }
                 })
@@ -535,7 +569,8 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
                             text = resources.getString(R.string.not_pay)
                             setTextColor(Color.rgb(23, 171, 227))
                         }
-                        itemView.findViewById<ImageView>(R.id.is_pay_icon).setImageResource(R.mipmap.icon_wait)
+                        itemView.findViewById<ImageView>(R.id.is_pay_icon)
+                            .setImageResource(R.mipmap.icon_wait)
                     }
 
                     1 -> {
@@ -543,7 +578,8 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
                             text = resources.getString(R.string.paid)
                             setTextColor(Color.rgb(84, 213, 77))
                         }
-                        itemView.findViewById<ImageView>(R.id.is_pay_icon).setImageResource(R.mipmap.icon_passed)
+                        itemView.findViewById<ImageView>(R.id.is_pay_icon)
+                            .setImageResource(R.mipmap.icon_passed)
                     }
                 }
             }
@@ -628,4 +664,15 @@ class DailyPaymentListActivity : BaseActivity<ActivityDaliyPaymentListBinding>()
                 }
             })
     }
+
+    private fun getDailyPaymentList() {
+        if (!OASystem.authorization(OASystem.DAILY_PAYMENT, OASystem.PROCESS)) {
+            binding.createUser.text = OASystem.userInfo.cnName
+        }
+
+        binding.dailyPaymentContainer.setRefreshHeader(ClassicsHeader(OASystem.context))
+        binding.dailyPaymentContainer.setRefreshFooter(ClassicsFooter(OASystem.context))
+
+        initDailyPaymentList(1)
+    }
 }

+ 6 - 13
app/src/main/java/com/pan_american/android/ui/login/LoginActivity.kt

@@ -3,7 +3,6 @@ package com.pan_american.android.ui.login
 import android.content.Intent
 import android.net.Uri
 import android.os.Bundle
-import android.view.View
 import com.pan_american.android.BuildConfig
 import com.pan_american.android.OASystem
 import com.pan_american.android.R
@@ -43,6 +42,9 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
     }
 
     override fun initViews() {
+
+        binding.loginButton.setText(resources.getString(R.string.login))
+
         binding.systemInfo.text =
             String.format(getString(R.string.system_info, BuildConfig.VERSION_NAME))
     }
@@ -54,9 +56,6 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
             } else if (binding.password.text.isNullOrBlank()) {
                 showMessage(resources.getString(R.string.password_input_hint))
             } else {
-                //执行登录操作,避免重复点击
-                binding.loginButton.isClickable = false
-
                 login()
             }
         }
@@ -69,9 +68,7 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
 
     private fun login() {
 
-        binding.login.visibility = View.GONE
-
-        binding.loginLoading.visibility = View.VISIBLE
+        binding.loginButton.setButtonStatus(1)
 
         val loginRequest =
             LoginRequest(binding.account.text.toString(), binding.password.text.toString())
@@ -92,9 +89,7 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
                         back()
                     } else {
                         //登陆失败重新显示登录按钮
-                        binding.login.visibility = View.VISIBLE
-                        binding.loginLoading.visibility = View.GONE
-                        binding.loginButton.isClickable = true
+                        binding.loginButton.setButtonStatus(0)
                         showMessage(loginResponse.msg)
                     }
                 }
@@ -103,9 +98,7 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
             override fun onFailure(call: Call<LoginResponse>, t: Throwable) {
 
                 //登陆失败重新显示登录按钮
-                binding.login.visibility = View.VISIBLE
-                binding.loginLoading.visibility = View.GONE
-                binding.loginButton.isClickable = true
+                binding.loginButton.setButtonStatus(0)
 
                 showErrorInfo(R.string.login_failed)
             }

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

@@ -58,20 +58,40 @@ class AddHotelResourceActivity : BaseActivity<ActivityAddHotelResourceBinding>()
 
     override fun initViews() {
 
-        titleBinding.apply {
-            if (fromList) {
+        if (fromList) {
 
-                hotelResource = intent.getSerializableExtra("hotelResource", HotelResource::class.java) as HotelResource
-                initHotelResourceInfo()
+            hotelResource = intent.getSerializableExtra("hotelResource", HotelResource::class.java) as HotelResource
 
-                binding.commit.text = resources.getString(R.string.update)
+            initHotelResourceInfo()
 
-            } else {
+            if (OASystem.authorization(OASystem.HOTEL_RESOURCE, OASystem.EDIT)) {
 
-                binding.commit.text = resources.getString(R.string.add)
+                if (!OASystem.authorization(OASystem.HOTEL_RESOURCE, OASystem.EDIT)) {
+                    binding.apply {
+                        hotelName.isEnabled = false
+                        hotelLocation.isEnabled = false
+                        hotelAddress.isEnabled(false)
+                        hotelPhone.isEnabled = false
+                        hotelFax.isEnabled = false
+                        hotelLevel.isEnabled = false
+                        contactsName.isEnabled = false
+                        contactsPhone.isEnabled = false
+                        otherInfo.isEnabled(false)
 
-                hotelResource = HotelResource()
+                        commit.setText(resources.getString(R.string.update))
+                    }
+                }
+            } else {
+                binding.commit.setText(resources.getString(R.string.back))
             }
+
+            isChose = true
+
+        } else {
+
+            binding.commit.setText(resources.getString(R.string.add))
+
+            hotelResource = HotelResource()
         }
 
     }
@@ -109,16 +129,51 @@ class AddHotelResourceActivity : BaseActivity<ActivityAddHotelResourceBinding>()
         }
 
         binding.commit.setOnClickListener {
-            if (fromList) {
-                initHotelResource(2)
-                updateHotelResourceInfo()
-            } else {
-                if (isChose) {
-                    initHotelResource(1)
-                    updateHotelResourceInfo()
-                } else {
+
+            when {
+                binding.hotelName.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.hotel_name_input_hint))
+                }
+
+                binding.hotelLocation.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.hotel_located_input_hint))
+                }
+
+                binding.hotelAddress.getText().isBlank() -> {
+                    showMessage(resources.getString(R.string.hotel_address_input_hint))
+                }
+
+                binding.hotelPhone.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.hotel_tel_input_hint))
+                }
+
+                !isChose -> {
                     showMessage(resources.getString(R.string.hotel_level_select_hint))
                 }
+
+                binding.contactsName.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.connector_name_input_hint))
+                }
+
+                binding.contactsPhone.text.isNullOrBlank() -> {
+                    showMessage(resources.getString(R.string.contacts_tel_hint))
+                }
+
+                else -> {
+                    binding.commit.setButtonStatus(1)
+
+                    if (fromList) {
+                        initHotelResource(2)
+                        updateHotelResourceInfo()
+                    } else {
+                        if (isChose) {
+                            initHotelResource(1)
+                            updateHotelResourceInfo()
+                        } else {
+                            showMessage(resources.getString(R.string.hotel_level_select_hint))
+                        }
+                    }
+                }
             }
         }
     }
@@ -134,21 +189,6 @@ class AddHotelResourceActivity : BaseActivity<ActivityAddHotelResourceBinding>()
             contactsName.setText(hotelResource.contact)
             contactsPhone.setText(hotelResource.contactPhone)
             otherInfo.setText(hotelResource.otherInformation)
-
-            if (!OASystem.authorization(OASystem.HOTEL_RESOURCE, OASystem.EDIT)) {
-                hotelName.inputType = InputType.TYPE_NULL
-                hotelLocation.inputType = InputType.TYPE_NULL
-                hotelAddress.setInputType(InputType.TYPE_NULL)
-                hotelPhone.inputType = InputType.TYPE_NULL
-                hotelFax.inputType = InputType.TYPE_NULL
-                hotelLevel.isEnabled = false
-                contactsName.inputType = InputType.TYPE_NULL
-                contactsPhone.inputType = InputType.TYPE_NULL
-                otherInfo.setInputType(InputType.TYPE_NULL)
-                otherInfo.setSingleLine(false)
-
-                commit.visibility = View.GONE
-            }
         }
     }
 
@@ -170,12 +210,6 @@ class AddHotelResourceActivity : BaseActivity<ActivityAddHotelResourceBinding>()
 
     private fun updateHotelResourceInfo() {
 
-        binding.commit.isEnabled = false
-
-        binding.commit.visibility = View.GONE
-
-        binding.updateLoading.visibility = View.VISIBLE
-
         val apiService = ServiceCreator.create<APIService>()
 
         apiService.hotelDataOperation(hotelResource).enqueue(object : Callback<BaseResponse> {
@@ -196,22 +230,14 @@ class AddHotelResourceActivity : BaseActivity<ActivityAddHotelResourceBinding>()
                     } 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)
             }

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

@@ -45,7 +45,6 @@ class HotelResourceActivity : BaseActivity<ActivityHotelResourceBinding>() {
     }
 
     override fun initViews() {
-
         supportFragmentManager.beginTransaction().addToBackStack(null)
             .replace(binding.hotelResourceContainer.id, HotelResourceSearchFragment()).commit()
     }

+ 16 - 9
app/src/main/java/com/pan_american/android/ui/resource_management/hotel_resource/HotelResourceListFragment.kt

@@ -64,8 +64,8 @@ class HotelResourceListFragment : BaseFragment<FragmentHotelResourceListBinding>
     }
 
     override fun initViews() {
-        binding.hotelResourceContainer.setRefreshHeader(ClassicsHeader(OASystem.context))
-        binding.hotelResourceContainer.setRefreshFooter(ClassicsFooter(OASystem.context))
+        binding.hotelResourceListContainer.setRefreshHeader(ClassicsHeader(OASystem.context))
+        binding.hotelResourceListContainer.setRefreshFooter(ClassicsFooter(OASystem.context))
         initHotelResourceList(1)
     }
 
@@ -88,25 +88,31 @@ class HotelResourceListFragment : BaseFragment<FragmentHotelResourceListBinding>
                                 for (item in guideResourceResponse.data.pageSource) {
                                     hotelList.add(item)
                                 }
+
+                                if (hotelList.size == 0) {
+                                    showMessage(resources.getString(R.string.no_data))
+                                    return
+                                }
+
                                 when (type) {
                                     1 -> {
                                         totalPage = guideResourceResponse.data.totalPage
-                                        binding.hotelResourceContainer.setEnableLoadMore(pageIndex < totalPage)
+                                        binding.hotelResourceListContainer.setEnableLoadMore(pageIndex < totalPage)
                                         listInit = true
                                         initList()
                                     }
 
                                     2 -> {
-                                        binding.hotelResourceContainer.finishRefresh()
+                                        binding.hotelResourceListContainer.finishRefresh()
                                         totalPage = guideResourceResponse.data.totalPage
-                                        binding.hotelResourceContainer.setEnableLoadMore(pageIndex < totalPage)
+                                        binding.hotelResourceListContainer.setEnableLoadMore(pageIndex < totalPage)
                                         initList()
                                         listInit = true
                                     }
 
                                     3 -> {
-                                        binding.hotelResourceContainer.finishLoadMore()
-                                        binding.hotelResourceContainer.setEnableLoadMore(pageIndex < totalPage)
+                                        binding.hotelResourceListContainer.finishLoadMore()
+                                        binding.hotelResourceListContainer.setEnableLoadMore(pageIndex < totalPage)
                                         binding.hotelResourceList.adapter!!.notifyItemInserted(
                                             hotelList.size
                                         )
@@ -135,6 +141,7 @@ class HotelResourceListFragment : BaseFragment<FragmentHotelResourceListBinding>
     }
 
     private fun initList() {
+
         val layoutManager = LinearLayoutManager(OASystem.context)
         binding.hotelResourceList.layoutManager = layoutManager
 
@@ -184,7 +191,7 @@ class HotelResourceListFragment : BaseFragment<FragmentHotelResourceListBinding>
                 }
             }
 
-        binding.hotelResourceContainer.setOnRefreshLoadMoreListener(object :
+        binding.hotelResourceListContainer.setOnRefreshLoadMoreListener(object :
             OnRefreshLoadMoreListener {
             override fun onRefresh(refreshLayout: RefreshLayout) {
                 pageIndex = 1
@@ -228,7 +235,7 @@ class HotelResourceListFragment : BaseFragment<FragmentHotelResourceListBinding>
                 }
 
                 override fun onFailure(call: Call<BaseResponse>, t: Throwable) {
-                    showErrorInfo(R.string.base_resource_data_get_failed)
+                    showErrorInfo(R.string.delete_error)
                 }
 
             })

+ 18 - 5
app/src/main/java/com/pan_american/android/ui/resource_management/hotel_resource/HotelResourceSearchFragment.kt

@@ -71,7 +71,6 @@ class HotelResourceSearchFragment : BaseFragment<FragmentHotelResourceSearchBind
         contactsPhone = binding.contactsPhone.text.toString()
         inStack = true
 
-
     }
 
     override fun initViews() {
@@ -83,8 +82,10 @@ class HotelResourceSearchFragment : BaseFragment<FragmentHotelResourceSearchBind
 
             inStack = false
         } else {
-            binding.hotelLocation.text = "全部"
+            binding.hotelLocation.text = resources.getString(R.string.all)
         }
+
+        binding.commit.setText(resources.getString(R.string.search))
     }
 
     override fun initEvents() {
@@ -98,7 +99,11 @@ class HotelResourceSearchFragment : BaseFragment<FragmentHotelResourceSearchBind
             }
 
             val popView = View.inflate(OASystem.context, R.layout.popup_selector, null)
-            popupWindow = PopupWindow(popView, RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT)
+            popupWindow = PopupWindow(
+                popView,
+                RecyclerView.LayoutParams.MATCH_PARENT,
+                RecyclerView.LayoutParams.WRAP_CONTENT
+            )
 
             showPopupWindow {
 
@@ -120,9 +125,17 @@ class HotelResourceSearchFragment : BaseFragment<FragmentHotelResourceSearchBind
                             text = data.city
 
                             if (binding.hotelLocation.text == data.city) {
-                                setTextColor(ResourcesCompat.getColor(resources, R.color.text_color_blue, null))
+                                setTextColor(
+                                    ResourcesCompat.getColor(
+                                        resources, R.color.text_color_blue, null
+                                    )
+                                )
                             } else {
-                                setTextColor(ResourcesCompat.getColor(resources, R.color.text_color, null))
+                                setTextColor(
+                                    ResourcesCompat.getColor(
+                                        resources, R.color.text_color, null
+                                    )
+                                )
                             }
                         }
                     }

+ 72 - 0
app/src/main/java/com/pan_american/android/util/CommitButton.kt

@@ -0,0 +1,72 @@
+package com.pan_american.android.util
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.widget.LinearLayout
+import android.widget.ProgressBar
+import android.widget.TextView
+import com.pan_american.android.R
+
+class CommitButton(context: Context, attrs: AttributeSet?) : LinearLayout(context, attrs) {
+
+    private val view: View
+
+    private val commitButton: LinearLayout
+
+    private val commitText: TextView
+
+    private val commitLoading: ProgressBar
+
+    private var buttonStatus = 0
+
+    init {
+        view = LayoutInflater.from(context).inflate(R.layout.layout_commit_button, this)
+        commitButton = view.findViewById(R.id.commit_button)
+        commitText = view.findViewById(R.id.commit_text)
+        commitLoading = view.findViewById(R.id.commit_loading)
+    }
+
+    fun setText(text: String) {
+        commitText.text = text
+    }
+
+//    fun setTextSize(textSize: Int) {
+//        commitText.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize.toFloat())
+//    }
+//
+//    fun setTextStyle(style: Typeface) {
+//        commitText.typeface = style
+//    }
+
+    fun setButtonStatus(type: Int) {
+        when(type) {
+            1 -> {
+
+                if (buttonStatus == 0) {
+                    commitText.visibility = View.GONE
+
+                    commitLoading.visibility = View.VISIBLE
+
+                    commitButton.isEnabled = false
+                }
+
+            }
+
+            0 -> {
+
+                if (buttonStatus == 1) {
+                    commitText.visibility = View.VISIBLE
+
+                    commitLoading.visibility = View.GONE
+
+                    commitButton.isEnabled = true
+                }
+
+            }
+        }
+
+        buttonStatus = type
+    }
+}

+ 14 - 0
app/src/main/res/anim/popup_to_bottom.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <alpha
+        android:duration="100"
+        android:fromAlpha="1.0"
+        android:interpolator="@android:anim/decelerate_interpolator"
+        android:toAlpha="0.0"/>
+    <translate
+        android:duration="100"
+        android:fromYDelta="0%"
+        android:toYDelta="50"/>
+
+</set>

+ 2 - 7
app/src/main/res/layout/activity_add_daily_payment.xml

@@ -332,15 +332,10 @@
                 android:background="@drawable/shape_corner_solid_blue"
                 android:orientation="vertical">
 
-                <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/submit"
-                    android:textColor="@color/white"
-                    android:textSize="@dimen/text_size_large"
-                    android:textStyle="bold" />
+                    android:layout_height="match_parent"/>
 
                 <ProgressBar
                     android:id="@+id/update_loading"

+ 9 - 14
app/src/main/res/layout/activity_add_hotel_resource.xml

@@ -51,6 +51,7 @@
                     android:hint="@string/please_input"
                     android:importantForAutofill="no"
                     android:inputType="text"
+                    android:textColor="@color/text_color"
                     android:textColorHint="@color/hint_text_color"
                     android:textSize="@dimen/text_size_medium" />
             </LinearLayout>
@@ -87,6 +88,7 @@
                     android:importantForAutofill="no"
                     android:inputType="text"
                     android:singleLine="true"
+                    android:textColor="@color/text_color"
                     android:textColorHint="@color/hint_text_color"
                     android:textSize="@dimen/text_size_medium" />
             </LinearLayout>
@@ -116,11 +118,6 @@
                     android:id="@+id/hotel_address"
                     android:layout_width="match_parent"
                     android:layout_height="100dp"
-                    android:background="@color/white"
-                    android:gravity="end"
-                    android:hint="@string/please_input"
-                    android:inputType="text"
-                    android:textColorHint="@color/hint_text_color"
                     android:textSize="@dimen/text_size_medium" />
             </LinearLayout>
 
@@ -156,6 +153,7 @@
                     android:importantForAutofill="no"
                     android:inputType="phone"
                     android:singleLine="true"
+                    android:textColor="@color/text_color"
                     android:textColorHint="@color/hint_text_color"
                     android:textSize="@dimen/text_size_medium" />
             </LinearLayout>
@@ -192,6 +190,7 @@
                     android:importantForAutofill="no"
                     android:inputType="text"
                     android:singleLine="true"
+                    android:textColor="@color/text_color"
                     android:textColorHint="@color/hint_text_color"
                     android:textSize="@dimen/text_size_medium" />
             </LinearLayout>
@@ -263,6 +262,7 @@
                     android:importantForAutofill="no"
                     android:inputType="text"
                     android:singleLine="true"
+                    android:textColor="@color/text_color"
                     android:textColorHint="@color/hint_text_color"
                     android:textSize="@dimen/text_size_medium" />
             </LinearLayout>
@@ -298,6 +298,7 @@
                     android:hint="@string/please_input"
                     android:inputType="phone"
                     android:singleLine="true"
+                    android:textColor="@color/text_color"
                     android:textColorHint="@color/hint_text_color"
                     android:textSize="@dimen/text_size_medium" />
             </LinearLayout>
@@ -326,8 +327,7 @@
                 <com.pan_american.android.util.ScrollEditText
                     android:id="@+id/other_info"
                     android:layout_width="match_parent"
-                    android:layout_height="120dp"
-                    android:scrollbars="none" />
+                    android:layout_height="120dp" />
             </LinearLayout>
 
             <LinearLayout
@@ -338,15 +338,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" />
+                    android:layout_height="match_parent" />
 
                 <ProgressBar
                     android:id="@+id/update_loading"

+ 2 - 9
app/src/main/res/layout/activity_daliy_payment_list.xml

@@ -339,18 +339,11 @@
                 android:layout_marginBottom="@dimen/common_padding"
                 android:background="@color/line_color" />
 
-            <TextView
+            <com.pan_american.android.util.CommitButton
                 android:id="@+id/commit"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/button_height"
-                android:layout_gravity="center"
-                android:layout_margin="@dimen/common_padding"
-                android:background="@drawable/shape_corner_solid_blue"
-                android:gravity="center"
-                android:text="@string/sift"
-                android:textColor="@color/white"
-                android:textSize="@dimen/text_size_large"
-                android:textStyle="bold" />
+                android:layout_margin="@dimen/common_padding" />
 
         </LinearLayout>
 

+ 2 - 3
app/src/main/res/layout/activity_hotel_resource.xml

@@ -3,9 +3,8 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/white"
-    android:orientation="vertical"
-    tools:context=".ui.resource_management.hotel_resource.HotelResourceActivity">
+    android:background="@color/background_color"
+    android:orientation="vertical" >
 
     <include
         layout="@layout/layout_title"

+ 3 - 26
app/src/main/res/layout/activity_login.xml

@@ -75,34 +75,11 @@
                 android:textSize="@dimen/text_size_medium" />
         </LinearLayout>
 
-        <LinearLayout
+        <com.pan_american.android.util.CommitButton
             android:id="@+id/login_button"
             android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:layout_marginTop="@dimen/common_padding_large"
-            android:background="@drawable/shape_corner_solid_blue"
-            android:gravity="center"
-            android:orientation="horizontal">
-
-            <TextView
-                android:id="@+id/login"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:gravity="center"
-                android:text="@string/login"
-                android:textAllCaps="true"
-                android:textColor="@color/white"
-                android:textSize="@dimen/text_size_large"
-                android:textStyle="bold" />
-
-            <ProgressBar
-                android:id="@+id/login_loading"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:indeterminateTint="@color/white"
-                android:visibility="gone" />
-
-        </LinearLayout>
+            android:layout_height="@dimen/button_height"
+            android:layout_marginTop="@dimen/common_padding_large" />
 
         <TextView
             android:id="@+id/system_info"

+ 3 - 5
app/src/main/res/layout/fragment_hotel_resource_list.xml

@@ -7,11 +7,10 @@
     android:orientation="vertical">
 
     <com.scwang.smart.refresh.layout.SmartRefreshLayout
-        android:id="@+id/hotel_resource_container"
+        android:id="@+id/hotel_resource_list_container"
         android:layout_width="match_parent"
-        android:layout_height="0dp"
+        android:layout_height="match_parent"
         android:layout_margin="@dimen/common_padding"
-        android:layout_weight="1"
         app:srlEnablePreviewInEditMode="true">
 
         <com.scwang.smart.refresh.header.ClassicsHeader
@@ -21,8 +20,7 @@
         <androidx.recyclerview.widget.RecyclerView
             android:id="@+id/hotel_resource_list"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:overScrollMode="never" />
+            android:layout_height="match_parent" />
 
         <com.scwang.smart.refresh.footer.ClassicsFooter
             android:layout_width="match_parent"

+ 2 - 9
app/src/main/res/layout/fragment_hotel_resource_search.xml

@@ -169,17 +169,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>
 

+ 5 - 4
app/src/main/res/layout/item_hotel_list.xml

@@ -36,7 +36,8 @@
                 android:layout_width="@dimen/common_padding_heavy"
                 android:layout_height="@dimen/common_padding_heavy"
                 android:layout_marginEnd="@dimen/common_padding"
-                android:src="@mipmap/icon_delete" />
+                android:src="@mipmap/icon_delete"
+                tools:ignore="ContentDescription"/>
 
         </LinearLayout>
 
@@ -57,7 +58,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center"
-                android:text="所在城市"
+                android:text="@string/located_city"
                 android:textSize="@dimen/text_size_medium" />
 
             <TextView
@@ -89,7 +90,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center"
-                android:text="电话"
+                android:text="@string/phone"
                 android:textSize="@dimen/text_size_medium" />
 
             <TextView
@@ -154,7 +155,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center"
-                android:text="创建时间"
+                android:text="@string/create_time"
                 android:textSize="@dimen/text_size_medium" />
 
             <TextView

+ 29 - 0
app/src/main/res/layout/layout_commit_button.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/commit_button"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/shape_corner_solid_blue"
+    android:gravity="center"
+    android:orientation="horizontal"
+    tools:viewBindingIgnore="true">
+
+    <TextView
+        android:id="@+id/commit_text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:textAllCaps="true"
+        android:textColor="@color/white"
+        android:textSize="@dimen/text_size_large"
+        android:textStyle="bold" />
+
+    <ProgressBar
+        android:id="@+id/commit_loading"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:indeterminateTint="@color/white"
+        android:visibility="gone" />
+
+</LinearLayout>

+ 3 - 3
app/src/main/res/layout/layout_scroll_edit_text.xml

@@ -3,14 +3,14 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@drawable/shape_large_edit_text_background">
+    android:background="@drawable/shape_large_edit_text_background"
+    tools:viewBindingIgnore="true">
 
     <ScrollView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_margin="@dimen/common_padding_small"
-        android:scrollbars="none"
-        tools:viewBindingIgnore="true">
+        android:scrollbars="none">
 
         <LinearLayout
             android:layout_width="match_parent"

+ 2 - 1
app/src/main/res/values/styles.xml

@@ -12,8 +12,9 @@
         <item name="materialAlertDialogTheme">@style/DialogStyle</item>
     </style>
 
-    <style name="AnimationBottomIn">
+    <style name="AnimationBottomPopup">
         <item name="android:windowEnterAnimation">@anim/popup_form_bottom</item>
+        <item name="android:windowExitAnimation">@anim/popup_to_bottom</item>
     </style>
 
     <style name="DialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">