Skip to content

Commit a967d9e

Browse files
committed
♻️ 0을 상수로 분리
1 parent 4afe25b commit a967d9e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

presentation/src/main/java/com/whyranoid/presentation/community/CommunityItemFragment.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ internal class CommunityItemFragment :
127127
binding.swipeRefreshLayout.apply {
128128
setOnRefreshListener {
129129
postAdapter.refresh()
130-
binding.rvCommunity.scrollToPosition(0)
130+
binding.rvCommunity.scrollToPosition(POSITION_TOP)
131131
binding.swipeRefreshLayout.isRefreshing = false
132132
}
133133

@@ -190,7 +190,7 @@ internal class CommunityItemFragment :
190190
binding.swipeRefreshLayout.apply {
191191
setOnRefreshListener {
192192
postAdapter.refresh()
193-
binding.rvCommunity.scrollToPosition(0)
193+
binding.rvCommunity.scrollToPosition(POSITION_TOP)
194194
binding.swipeRefreshLayout.isRefreshing = false
195195
}
196196

@@ -221,6 +221,7 @@ internal class CommunityItemFragment :
221221

222222
companion object {
223223
private const val COMMUNITY_CATEGORY_KEY = "communityCategoryKey"
224+
private const val POSITION_TOP = 0
224225

225226
fun newInstance(communityCategory: CommunityCategory): CommunityItemFragment {
226227
val fragment = CommunityItemFragment()

0 commit comments

Comments
 (0)