mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-12 17:57:29 +00:00
close #1528
This commit is contained in:
parent
40907a8bc1
commit
7d1dca07c1
@ -139,7 +139,7 @@ public final class DirectItemsAdapter extends RecyclerView.Adapter<RecyclerView.
|
||||
return new HeaderViewHolder(LayoutDmHeaderBinding.inflate(layoutInflater, parent, false));
|
||||
}
|
||||
final LayoutDmBaseBinding baseBinding = LayoutDmBaseBinding.inflate(layoutInflater, parent, false);
|
||||
final DirectItemType directItemType = DirectItemType.Companion.getId(type);
|
||||
final DirectItemType directItemType = DirectItemType.Companion.getTypeFromId(type);
|
||||
final DirectItemViewHolder itemViewHolder = getItemViewHolder(layoutInflater, baseBinding, directItemType);
|
||||
itemViewHolder.setLongClickListener(longClickListener);
|
||||
return itemViewHolder;
|
||||
|
@ -64,8 +64,8 @@ enum class DirectItemType(val id: Int) : Serializable {
|
||||
private val map: MutableMap<Int, DirectItemType> = mutableMapOf()
|
||||
|
||||
@JvmStatic
|
||||
fun getId(id: Int): DirectItemType? {
|
||||
return map[id]
|
||||
fun getTypeFromId(id: Int): DirectItemType {
|
||||
return map[id] ?: UNKNOWN
|
||||
}
|
||||
|
||||
fun getName(directItemType: DirectItemType): String? {
|
||||
|
Loading…
Reference in New Issue
Block a user