Created
July 16, 2021 10:50
-
-
Save TOrnelas/30d52b9484ed525974ade1591f0c9075 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | |
val holder = ViewHolder( | |
LayoutInflater.from(parent.context) | |
.inflate(R.layout.list_item_appointment, parent, false) | |
) | |
if (!itemWidthMatchParent && items.size > 1) { | |
val params = holder.itemView.layoutParams | |
params.width = | |
parent.measuredWidth - (4 * parent.context.resources.getDimensionPixelSize(R.dimen.margin_10)) | |
holder.itemView.layoutParams = params | |
} | |
return holder | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment