Created
May 15, 2018 09:19
-
-
Save alorma/7eb1d2c29125a0afe0de140819aa3807 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fun RecyclerView.divider(orientation: Int = DividerItemDecoration.VERTICAL, | |
@DrawableRes drawable : Int = R.drawable.list_divider) { | |
val itemDecoration = DividerItemDecoration(context, orientation).apply { | |
ContextCompat.getDrawable(context, drawable)?.let { | |
setDrawable(it) | |
} | |
} | |
addItemDecoration(itemDecoration) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment