Added horizontal divider to remittee list items
This commit is contained in:
parent
4afa18b336
commit
67b282beb2
|
@ -6,6 +6,7 @@ import com.otaliastudios.autocomplete.RecyclerViewPresenter
|
|||
import kotlinx.coroutines.*
|
||||
import net.dankito.banking.ui.android.adapter.RemitteeListAdapter
|
||||
import net.dankito.banking.search.Remittee
|
||||
import net.dankito.banking.ui.android.extensions.addHorizontalItemDivider
|
||||
import net.dankito.banking.ui.presenter.BankingPresenter
|
||||
|
||||
|
||||
|
@ -17,6 +18,8 @@ open class RemitteePresenter(protected val bankingPresenter: BankingPresenter, c
|
|||
|
||||
|
||||
override fun instantiateAdapter(): RecyclerView.Adapter<*> {
|
||||
recyclerView?.addHorizontalItemDivider()
|
||||
|
||||
return adapter
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package net.dankito.banking.ui.android.extensions
|
||||
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
|
||||
fun RecyclerView.addHorizontalItemDivider() {
|
||||
this.addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL))
|
||||
}
|
|
@ -18,6 +18,7 @@ import kotlinx.android.synthetic.main.fragment_home.view.*
|
|||
import net.dankito.banking.ui.android.R
|
||||
import net.dankito.banking.ui.android.adapter.AccountTransactionAdapter
|
||||
import net.dankito.banking.ui.android.di.BankingComponent
|
||||
import net.dankito.banking.ui.android.extensions.addHorizontalItemDivider
|
||||
import net.dankito.banking.ui.android.extensions.showAmount
|
||||
import net.dankito.banking.ui.model.TypedBankAccount
|
||||
import net.dankito.banking.ui.model.parameters.TransferMoneyData
|
||||
|
@ -79,7 +80,7 @@ class HomeFragment : Fragment() {
|
|||
val rcyvwAccountTransactions: RecyclerView = rootView.findViewById(R.id.rcyvwAccountTransactions)
|
||||
rcyvwAccountTransactions.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rcyvwAccountTransactions.adapter = transactionAdapter
|
||||
rcyvwAccountTransactions.addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL))
|
||||
rcyvwAccountTransactions.addHorizontalItemDivider()
|
||||
rcyvwAccountTransactions.isNestedScrollingEnabled = false
|
||||
|
||||
registerForContextMenu(rcyvwAccountTransactions) // this is actually bad, splits code as context menu is created in AccountTransactionAdapter
|
||||
|
|
Loading…
Reference in New Issue