Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Fix-316: Empty Payroll Indicator added #179

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class EditPayrollAllocationFragment : FineractBaseFragment(), Step,
payrollAllocationAdapter.setPayrollAllocations(payrollAllocations)
payrollAllocationAdapter.setOnClickEditDeleteListener(this)
rvPayrollAllocation.adapter = payrollAllocationAdapter
showRecyclerView(payrollAllocations.isNotEmpty())
}

override fun onSelected() {
Expand All @@ -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) {
Expand All @@ -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? {
Expand All @@ -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
}
}

}
10 changes: 10 additions & 0 deletions app/src/main/res/layout/fragment_edit_payroll_allocation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

<TextView
android:id="@+id/tv_no_payroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/no_payroll_txt"
android:gravity="center"
android:padding="@dimen/layout_padding_8dp"
android:background="@color/base10"
android:visibility="gone"/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabAddPayrollAllocation"
android:layout_width="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -542,4 +542,5 @@
<string name="please_wait_updating_group_status">"Updating group status, please wait... "</string>
<string name="error_while_updating_group_status">Error while updating group status</string>
<string name="error_while_creating_group">Error while creating group</string>
<string name="no_payroll_txt">No Payrolls Available. Tap \'+\' at bottom to create new Payroll</string>
</resources>