24 lines
710 B
Kotlin
24 lines
710 B
Kotlin
package com.gamedog.vididin.beans
|
|
|
|
import com.ama.core.common.util.asUnsafe
|
|
import com.ama.core.model.BaseFragmentStateDiffItem
|
|
import com.gamedog.vididin.repository.MainTabType
|
|
|
|
|
|
data class MainTabsItem(
|
|
val titleResId: Int,
|
|
val type: MainTabType,
|
|
val tabIconNormal: Int,
|
|
val tabIconSelected: Int,
|
|
val updateMainTabShopOrFriend: (Boolean) -> Unit,
|
|
) : BaseFragmentStateDiffItem {
|
|
|
|
override fun getPrimaryKey() = type
|
|
|
|
override fun <T> areContentsTheSame(newItem: T): Boolean {
|
|
val mainTabsItem = newItem.asUnsafe<MainTabsItem>()
|
|
return titleResId == mainTabsItem.titleResId && type == mainTabsItem.type
|
|
}
|
|
|
|
override fun getItemId() = type.ordinal.toLong()
|
|
} |