Skip to content
Snippets Groups Projects
Commit 201f5e33 authored by Farizki Kurniawan's avatar Farizki Kurniawan
Browse files

fix: text when no transaction

parent d12b42e0
No related merge requests found
......@@ -64,8 +64,12 @@ class TransactionMenuFragment : Fragment(), ListAction, MyBroadcastListener {
viewModel.transactions.observe(viewLifecycleOwner, Observer {transactionsList->
binding.loadingView.visibility = View.GONE
binding.transactionListView.visibility = View.VISIBLE
transactionMenuAdapter.updateTransactions(transactionsList.sortedBy { it.creationTime })
transactionMenuAdapter.updateTransactions(transactionsList.sortedBy { -it.creationTime })
if(transactionsList.isEmpty()) {
binding.textView2.visibility = View.VISIBLE
} else{
binding.textView2.visibility = View.INVISIBLE
}
})
}
......
......@@ -40,4 +40,15 @@
android:src="@drawable/ic_create"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No transactions yet."
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/transactionListView" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment