mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 06:37:30 +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));
|
return new HeaderViewHolder(LayoutDmHeaderBinding.inflate(layoutInflater, parent, false));
|
||||||
}
|
}
|
||||||
final LayoutDmBaseBinding baseBinding = LayoutDmBaseBinding.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);
|
final DirectItemViewHolder itemViewHolder = getItemViewHolder(layoutInflater, baseBinding, directItemType);
|
||||||
itemViewHolder.setLongClickListener(longClickListener);
|
itemViewHolder.setLongClickListener(longClickListener);
|
||||||
return itemViewHolder;
|
return itemViewHolder;
|
||||||
|
@ -64,8 +64,8 @@ enum class DirectItemType(val id: Int) : Serializable {
|
|||||||
private val map: MutableMap<Int, DirectItemType> = mutableMapOf()
|
private val map: MutableMap<Int, DirectItemType> = mutableMapOf()
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun getId(id: Int): DirectItemType? {
|
fun getTypeFromId(id: Int): DirectItemType {
|
||||||
return map[id]
|
return map[id] ?: UNKNOWN
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getName(directItemType: DirectItemType): String? {
|
fun getName(directItemType: DirectItemType): String? {
|
||||||
|
Loading…
Reference in New Issue
Block a user