@ -38,6 +38,8 @@ sealed class InactiveTabViewHolder(itemView: View) : RecyclerView.ViewHolder(ite
itemView . apply {
itemView . apply {
isActivated = InactiveTabsState . isExpanded
isActivated = InactiveTabsState . isExpanded
correctHeaderBorder ( isActivated )
setOnClickListener {
setOnClickListener {
val newState = ! it . isActivated
val newState = ! it . isActivated
@ -46,10 +48,7 @@ sealed class InactiveTabViewHolder(itemView: View) : RecyclerView.ViewHolder(ite
it . isActivated = newState
it . isActivated = newState
binding . chevron . rotation = ROTATION _DEGREE
binding . chevron . rotation = ROTATION _DEGREE
// When the header is collapsed we use its bottom border instead of the footer's
correctHeaderBorder ( isActivated )
binding . inactiveHeaderBorder . updatePadding (
bottom = binding . root . context . dpToPx ( if ( it . isActivated ) 0f else 1f )
)
}
}
binding . delete . setOnClickListener {
binding . delete . setOnClickListener {
@ -58,6 +57,15 @@ sealed class InactiveTabViewHolder(itemView: View) : RecyclerView.ViewHolder(ite
}
}
}
}
/ * *
* When the header is collapsed we use its bottom border instead of the footer ' s
* /
private fun correctHeaderBorder ( isActivated : Boolean ) {
binding . inactiveHeaderBorder . updatePadding (
bottom = binding . root . context . dpToPx ( if ( isActivated ) 0f else 1f )
)
}
companion object {
companion object {
const val LAYOUT _ID = R . layout . inactive _header _item
const val LAYOUT _ID = R . layout . inactive _header _item
private const val ROTATION _DEGREE = 180F
private const val ROTATION _DEGREE = 180F