aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/net/lacolaco/smileessence/view/adapter/UnorderedCustomListAdapter.kt
blob: ef123e55713575a1fbda8704cc7663d4b89f62b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package net.lacolaco.smileessence.view.adapter

import java.util.*

abstract class UnorderedCustomListAdapter<T> constructor(override val list: ArrayList<T> = ArrayList<T>()) : CustomListAdapter<T>() {
    init { update() }

    @Synchronized
    fun add(item: T) = list.add(item)

    @Synchronized
    fun addAll(items: Collection<T>) = list.addAll(items)

    @Synchronized
    fun clear() = list.clear()

    @Synchronized
    fun remove(item: T): Boolean = list.remove(item)
}