Enable the transaction direction filter, the user can apply the filter and see all transactions or just the sent or received.

master
Severiano Jaramillo 2018-12-26 19:40:56 -06:00
parent ddf7f16c2b
commit f279512c57
2 changed files with 8 additions and 8 deletions

View File

@ -282,12 +282,12 @@ class FilterOptionsDialog : DialogFragment() {
// }
private fun validateFields() {
val filterTransactionsDirection = 0 //when {
// rbTransactionAll.isChecked -> 0
// rbTransactionSent.isChecked -> 1
// rbTransactionReceived.isChecked -> 2
// else -> { 0 }
// }
val filterTransactionsDirection = when {
rbTransactionAll.isChecked -> 0
rbTransactionSent.isChecked -> 1
rbTransactionReceived.isChecked -> 2
else -> { 0 }
}
val filterDateRangeAll = cbDateRange.isChecked

View File

@ -147,11 +147,11 @@ class TransactionsFragment : Fragment(), FilterOptionsDialog.OnFilterOptionsSele
for (transferDetail in transfersDetails) {
// Filter by transfer direction
if (transferDetail.direction) { // Transfer sent
if (filterTransactionsDirection == 2)
if (filterTransactionsDirection == 1)
// Looking for received transfers only
continue
} else { // Transfer received
if (filterTransactionsDirection == 1)
if (filterTransactionsDirection == 2)
// Looking for sent transactions only
continue
}