Accounts transactions list item: Merge booking text and other party name, made them more prominent and remove unused usage2
This commit is contained in:
parent
f2bbff804d
commit
42aaadd5ae
|
@ -38,15 +38,10 @@ open class AccountTransactionAdapter(protected val presenter: BankingPresenter)
|
||||||
override fun bindItemToView(viewHolder: AccountTransactionViewHolder, item: AccountTransaction) {
|
override fun bindItemToView(viewHolder: AccountTransactionViewHolder, item: AccountTransaction) {
|
||||||
viewHolder.txtvwDate.text = ValueDateFormat.format(item.valueDate)
|
viewHolder.txtvwDate.text = ValueDateFormat.format(item.valueDate)
|
||||||
|
|
||||||
viewHolder.txtvwBookingText.text = item.bookingText ?: ""
|
val label = if (item.showOtherPartyName) item.otherPartyName else item.bookingText
|
||||||
|
viewHolder.txtvwTransactionLabel.text = label ?: item.bookingText ?: ""
|
||||||
|
|
||||||
viewHolder.txtvwOtherPartyName.visibility = if (item.showOtherPartyName) View.VISIBLE else View.GONE
|
viewHolder.txtvwUsage.text = item.usage
|
||||||
viewHolder.txtvwOtherPartyName.text = item.otherPartyName ?: ""
|
|
||||||
|
|
||||||
viewHolder.txtvwUsage1.text = item.usage
|
|
||||||
|
|
||||||
viewHolder.txtvwUsage2.visibility = View.GONE // TODO
|
|
||||||
viewHolder.txtvwUsage2.text = "" // TODO
|
|
||||||
|
|
||||||
viewHolder.txtvwAmount.text = presenter.formatAmount(item.amount)
|
viewHolder.txtvwAmount.text = presenter.formatAmount(item.amount)
|
||||||
viewHolder.txtvwAmount.setTextColorToColorResource(if (item.amount >= BigDecimal.ZERO) R.color.positiveAmount else R.color.negativeAmount)
|
viewHolder.txtvwAmount.setTextColorToColorResource(if (item.amount >= BigDecimal.ZERO) R.color.positiveAmount else R.color.negativeAmount)
|
||||||
|
|
|
@ -11,13 +11,9 @@ open class AccountTransactionViewHolder(itemView: View) : RecyclerView.ViewHolde
|
||||||
|
|
||||||
val txtvwDate: TextView = itemView.txtvwDate
|
val txtvwDate: TextView = itemView.txtvwDate
|
||||||
|
|
||||||
val txtvwBookingText: TextView = itemView.txtvwBookingText
|
val txtvwTransactionLabel: TextView = itemView.txtvwTransactionLabel
|
||||||
|
|
||||||
val txtvwOtherPartyName: TextView = itemView.txtvwOtherPartyName
|
val txtvwUsage: TextView = itemView.txtvwUsage
|
||||||
|
|
||||||
val txtvwUsage1: TextView = itemView.txtvwUsage1
|
|
||||||
|
|
||||||
val txtvwUsage2: TextView = itemView.txtvwUsage2
|
|
||||||
|
|
||||||
val txtvwAmount: TextView = itemView.txtvwAmount
|
val txtvwAmount: TextView = itemView.txtvwAmount
|
||||||
|
|
||||||
|
|
|
@ -24,31 +24,20 @@
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txtvwBookingText"
|
android:id="@+id/txtvwTransactionLabel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
android:layout_marginBottom="@dimen/list_item_account_transaction_space_between_label_and_usage"
|
||||||
|
android:textSize="@dimen/list_item_account_transaction_label_text_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/txtvwOtherPartyName"
|
android:id="@+id/txtvwUsage"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/list_item_account_transaction_other_party_name_margin_top_and_bottom"
|
android:textSize="@dimen/list_item_account_transaction_usage_text_size"
|
||||||
android:layout_marginBottom="@dimen/list_item_account_transaction_other_party_name_margin_top_and_bottom"
|
/>
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtvwUsage1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtvwUsage2"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="visible"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,18 @@
|
||||||
<dimen name="fab_margin_bottom_without_toolbar">16dp</dimen>
|
<dimen name="fab_margin_bottom_without_toolbar">16dp</dimen>
|
||||||
<dimen name="fab_margin_bottom_with_toolbar">42dp</dimen>
|
<dimen name="fab_margin_bottom_with_toolbar">42dp</dimen>
|
||||||
|
|
||||||
<dimen name="list_item_account_transaction_height">100dp</dimen>
|
<dimen name="list_item_account_transaction_height">80dp</dimen>
|
||||||
<dimen name="list_item_account_transaction_padding">4dp</dimen>
|
<dimen name="list_item_account_transaction_padding">4dp</dimen>
|
||||||
|
<dimen name="list_item_account_transaction_space_between_label_and_usage">2dp</dimen>
|
||||||
|
<dimen name="list_item_account_transaction_label_text_size">16sp</dimen>
|
||||||
|
<dimen name="list_item_account_transaction_usage_text_size">14sp</dimen>
|
||||||
<dimen name="list_item_account_transaction_bank_icon_width_and_height">16dp</dimen>
|
<dimen name="list_item_account_transaction_bank_icon_width_and_height">16dp</dimen>
|
||||||
<dimen name="list_item_account_transaction_bank_icon_margin_top">8dp</dimen>
|
<dimen name="list_item_account_transaction_bank_icon_margin_top">0dp</dimen>
|
||||||
<dimen name="list_item_account_transaction_bank_icon_margin_bottom">12dp</dimen>
|
<dimen name="list_item_account_transaction_bank_icon_margin_bottom">2dp</dimen>
|
||||||
<dimen name="list_item_account_transaction_amount_width">70dp</dimen>
|
<dimen name="list_item_account_transaction_amount_width">70dp</dimen>
|
||||||
<dimen name="list_item_account_transaction_date_margin_top">12dp</dimen>
|
<dimen name="list_item_account_transaction_date_margin_top">2dp</dimen>
|
||||||
<dimen name="list_item_account_transaction_date_margin_bottom">8dp</dimen>
|
<dimen name="list_item_account_transaction_date_margin_bottom">0dp</dimen>
|
||||||
<dimen name="list_item_account_transaction_transaction_text_margin_left_and_right">4dp</dimen>
|
<dimen name="list_item_account_transaction_transaction_text_margin_left_and_right">4dp</dimen>
|
||||||
<dimen name="list_item_account_transaction_other_party_name_margin_top_and_bottom">6dp</dimen>
|
|
||||||
|
|
||||||
<dimen name="dialog_add_account_padding">4dp</dimen>
|
<dimen name="dialog_add_account_padding">4dp</dimen>
|
||||||
<dimen name="dialog_add_account_label_height">24dp</dimen>
|
<dimen name="dialog_add_account_label_height">24dp</dimen>
|
||||||
|
|
Loading…
Reference in New Issue