Implemented displaying bank icon if all accounts are selected
This commit is contained in:
parent
30cef4293a
commit
a656b0c7e5
|
@ -1,5 +1,6 @@
|
|||
package net.dankito.banking.ui.android.adapter
|
||||
|
||||
import android.net.Uri
|
||||
import android.view.ContextMenu
|
||||
import android.view.View
|
||||
import net.dankito.banking.ui.android.R
|
||||
|
@ -49,6 +50,15 @@ open class AccountTransactionAdapter(protected val presenter: BankingPresenter)
|
|||
|
||||
viewHolder.txtvwAmount.text = presenter.formatAmount(item.amount)
|
||||
viewHolder.txtvwAmount.setTextColorToColorResource(if (item.amount >= BigDecimal.ZERO) R.color.positiveAmount else R.color.negativeAmount)
|
||||
|
||||
val iconUrl = item.bankAccount.account.bank.iconUrl
|
||||
if (iconUrl != null && presenter.areAllAccountSelected) {
|
||||
viewHolder.imgvwBankIcon.visibility = View.VISIBLE
|
||||
viewHolder.imgvwBankIcon.setImageURI(Uri.parse(iconUrl))
|
||||
}
|
||||
else {
|
||||
viewHolder.imgvwBankIcon.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.dankito.banking.ui.android.adapter.viewholder
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kotlinx.android.synthetic.main.list_item_account_transaction.view.*
|
||||
|
@ -20,4 +21,6 @@ open class AccountTransactionViewHolder(itemView: View) : RecyclerView.ViewHolde
|
|||
|
||||
val txtvwAmount: TextView = itemView.txtvwAmount
|
||||
|
||||
val imgvwBankIcon: ImageView = itemView.imgvwBankIcon
|
||||
|
||||
}
|
|
@ -53,7 +53,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/lytAmountAndDate"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="@dimen/list_item_account_transaction_amount_width"
|
||||
|
@ -65,26 +65,32 @@
|
|||
android:gravity="center_vertical"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgvwBankIcon"
|
||||
android:layout_width="@dimen/list_item_account_transaction_bank_icon_width_and_height"
|
||||
android:layout_height="@dimen/list_item_account_transaction_bank_icon_width_and_height"
|
||||
android:layout_marginTop="@dimen/list_item_account_transaction_bank_icon_margin_top"
|
||||
android:layout_marginBottom="@dimen/list_item_account_transaction_bank_icon_margin_bottom"
|
||||
android:layout_gravity="end"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtvwAmount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:gravity="end"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtvwDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_below="@+id/txtvwAmount"
|
||||
android:layout_marginTop="@dimen/list_item_account_transaction_date_margin_top"
|
||||
android:layout_marginBottom="@dimen/list_item_account_transaction_date_margin_bottom"
|
||||
android:gravity="end"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -16,8 +16,12 @@
|
|||
|
||||
<dimen name="list_item_account_transaction_height">100dp</dimen>
|
||||
<dimen name="list_item_account_transaction_padding">4dp</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_bottom">12dp</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_bottom">8dp</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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue