Created
June 6, 2020 20:17
-
-
Save bigstark/dadc7a5b3871857e5cf5833b5f8ad253 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 getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { | |
super.getItemOffsets(outRect, view, parent, state) | |
outRect.setEmpty() | |
val position = parent.getChildAdapterPosition(view).takeIf { it != RecyclerView.NO_POSITION } ?: run { | |
return | |
} | |
val space = 20.dp | |
outRect.left = space / 2 | |
outRect.right = space / 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment