-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Home] 후원사 카드 이미지 애니메이션(무한/자동 스크롤) #129
Conversation
@wisemuji listOf(
Sponsor(
name = "1",
imageUrl = "https://picsum.photos/200",
homepage = "",
Sponsor.Grade.PLATINUM
),
Sponsor(
name = "2",
imageUrl = "https://picsum.photos/201",
homepage = "",
Sponsor.Grade.PLATINUM
),
Sponsor(
name = "3",
imageUrl = "https://picsum.photos/202",
homepage = "",
Sponsor.Grade.GOLD
),
Sponsor(
name = "4",
imageUrl = "https://picsum.photos/203",
homepage = "",
Sponsor.Grade.GOLD
),
Sponsor(
name = "5",
imageUrl = "https://picsum.photos/204",
homepage = "",
Sponsor.Grade.GOLD
),
Sponsor(
name = "6",
imageUrl = "https://picsum.photos/205",
homepage = "",
Sponsor.Grade.GOLD
),
Sponsor(
name = "7",
imageUrl = "https://picsum.photos/206",
homepage = "",
Sponsor.Grade.GOLD
),
) 데이터 차기 전까지는 코드로 넣어도 괜찮을 것 같습니다. |
feature/home/src/main/java/com/droidknights/app2023/feature/home/SponsorCard.kt
Outdated
Show resolved
Hide resolved
feature/home/src/main/java/com/droidknights/app2023/feature/home/SponsorCard.kt
Outdated
Show resolved
Hide resolved
feature/home/src/main/java/com/droidknights/app2023/feature/home/SponsorCard.kt
Outdated
Show resolved
Hide resolved
LaunchedEffect(lifecycleState.value) { | ||
when (lifecycleState.value) { | ||
Lifecycle.Event.ON_RESUME -> { | ||
while (true) { | ||
autoScroll(scrollState) | ||
} | ||
} | ||
else -> {} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val lifecycleOwner = LocalLifecycleOwner.current
LaunchedEffect(Unit) {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
while (isActive) {
scrollState.scrollBy(SCROLL_PIXEL_UNIT)
delay(SCROLL_DELAY_MILLIS)
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
너무 어렵게 생각했군요... 542cedf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐈 👍🏻 🐕
Issue
Overview (Required)
Details
애니메이션 구현 상세
itemsState
값 후원사 목록으로 초기화3-1. 만약 앞으로(우측으로) 스크롤이 가능하지 않다면, 즉 Row의 끝에 도달했다면
itemsState
리스트에 후원사 목록 추가3-2. 만약 앞으로(우측으로) 스크롤이 가능하다면 별다른 동작 없음
LazyListState의
canScrollForward
,canScrollBackward
동작 상세canScrollForward
true,canScrollBackward
falsecanScrollForward false,
canScrollBackward` falsecanScrollForward
true,canScrollBackward
truecanScrollForward
false,canScrollBackward
trueScreenshot