From d60b7b49d09bc98289503a73145025d19fab8597 Mon Sep 17 00:00:00 2001 From: PatelVatsalB21 Date: Sun, 28 Mar 2021 18:33:29 +0530 Subject: [PATCH] fix 316: Empty Payroll Indicator added --- .../EditPayrollAllocationFragment.kt | 13 +++++++++++++ .../res/layout/fragment_edit_payroll_allocation.xml | 10 ++++++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 24 insertions(+) diff --git a/app/src/main/java/org/apache/fineract/ui/online/customers/customerpayroll/editcustomerpayroll/EditPayrollAllocationFragment.kt b/app/src/main/java/org/apache/fineract/ui/online/customers/customerpayroll/editcustomerpayroll/EditPayrollAllocationFragment.kt index 3a034018..8523a735 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/customers/customerpayroll/editcustomerpayroll/EditPayrollAllocationFragment.kt +++ b/app/src/main/java/org/apache/fineract/ui/online/customers/customerpayroll/editcustomerpayroll/EditPayrollAllocationFragment.kt @@ -92,6 +92,7 @@ class EditPayrollAllocationFragment : FineractBaseFragment(), Step, payrollAllocationAdapter.setPayrollAllocations(payrollAllocations) payrollAllocationAdapter.setOnClickEditDeleteListener(this) rvPayrollAllocation.adapter = payrollAllocationAdapter + showRecyclerView(payrollAllocations.isNotEmpty()) } override fun onSelected() { @@ -109,6 +110,7 @@ class EditPayrollAllocationFragment : FineractBaseFragment(), Step, override fun onClickDelete(payrollAllocation: PayrollAllocation, position: Int) { payrollAllocations.removeAt(position) payrollAllocationAdapter.setPayrollAllocations(payrollAllocations) + showRecyclerView(payrollAllocations.isNotEmpty()) } override fun editPayrollAllocation(payrollAllocation: PayrollAllocation, position: Int) { @@ -120,6 +122,7 @@ class EditPayrollAllocationFragment : FineractBaseFragment(), Step, override fun addPayrollAllocation(payrollAllocation: PayrollAllocation) { payrollAllocations.add(payrollAllocation) payrollAllocationAdapter.setPayrollAllocations(payrollAllocations) + showRecyclerView(payrollAllocations.isNotEmpty()) } override fun verifyStep(): VerificationError? { @@ -131,4 +134,14 @@ class EditPayrollAllocationFragment : FineractBaseFragment(), Step, } + fun showRecyclerView(isShow: Boolean) { + if (isShow) { + rvPayrollAllocation.visibility = View.VISIBLE + tv_no_payroll.visibility = View.GONE + } else { + rvPayrollAllocation.visibility = View.GONE + tv_no_payroll.visibility = View.VISIBLE + } + } + } diff --git a/app/src/main/res/layout/fragment_edit_payroll_allocation.xml b/app/src/main/res/layout/fragment_edit_payroll_allocation.xml index 66b55fa0..23bad4ef 100644 --- a/app/src/main/res/layout/fragment_edit_payroll_allocation.xml +++ b/app/src/main/res/layout/fragment_edit_payroll_allocation.xml @@ -11,6 +11,16 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> + + "Updating group status, please wait... " Error while updating group status Error while creating group + No Payrolls Available. Tap \'+\' at bottom to create new Payroll