|
|
|
@ -43,7 +43,7 @@ class TransactionDataFragment : EditableDataFragment(), StaticRowRepresentableDa |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
return transaction.adapterRows() |
|
|
|
return this.transaction.adapterRows() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun stringForRow(row: RowRepresentable): String { |
|
|
|
override fun stringForRow(row: RowRepresentable): String { |
|
|
|
@ -93,12 +93,19 @@ class TransactionDataFragment : EditableDataFragment(), StaticRowRepresentableDa |
|
|
|
|
|
|
|
|
|
|
|
override fun onRowValueChanged(value: Any?, row: RowRepresentable) { |
|
|
|
override fun onRowValueChanged(value: Any?, row: RowRepresentable) { |
|
|
|
super.onRowValueChanged(value, row) |
|
|
|
super.onRowValueChanged(value, row) |
|
|
|
rowRepresentableAdapter.refreshRow(row) |
|
|
|
this.rowRepresentableAdapter.refreshRow(row) |
|
|
|
|
|
|
|
this.selectNextRow(row) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
|
|
|
* Selects the next row to ease the data capture |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private fun selectNextRow(currentRow: RowRepresentable) { |
|
|
|
|
|
|
|
|
|
|
|
if (viewModel.primaryKey == null) { // automatically change the row for new data |
|
|
|
if (this.viewModel.primaryKey == null) { |
|
|
|
GlobalScope.launch(Dispatchers.Main) { |
|
|
|
GlobalScope.launch(Dispatchers.Main) { |
|
|
|
delay(200) |
|
|
|
delay(200) |
|
|
|
when (row) { |
|
|
|
when (currentRow) { |
|
|
|
TransactionRow.BANKROLL -> onRowSelected(0, TransactionRow.TYPE) |
|
|
|
TransactionRow.BANKROLL -> onRowSelected(0, TransactionRow.TYPE) |
|
|
|
TransactionRow.TYPE -> onRowSelected(0, TransactionRow.AMOUNT) |
|
|
|
TransactionRow.TYPE -> onRowSelected(0, TransactionRow.AMOUNT) |
|
|
|
// TransactionRow.AMOUNT -> onRowSelected(0, TransactionRow.DATE) |
|
|
|
// TransactionRow.AMOUNT -> onRowSelected(0, TransactionRow.DATE) |
|
|
|
@ -106,6 +113,7 @@ class TransactionDataFragment : EditableDataFragment(), StaticRowRepresentableDa |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun willSaveData() { |
|
|
|
override fun willSaveData() { |
|
|
|
|