generated from AND-SOPT-ANDROID/and-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[WEEK7] 7차 필수과제 구현 #14
Open
HAJIEUN02
wants to merge
4
commits into
develop
Choose a base branch
from
feat-week7
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,13 @@ import androidx.compose.foundation.layout.width | |
import androidx.compose.foundation.lazy.LazyRow | ||
import androidx.compose.foundation.lazy.itemsIndexed | ||
import androidx.compose.foundation.pager.HorizontalPager | ||
import androidx.compose.foundation.pager.PagerState | ||
import androidx.compose.foundation.pager.rememberPagerState | ||
import androidx.compose.foundation.rememberScrollState | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.foundation.verticalScroll | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
|
@@ -33,8 +33,8 @@ import androidx.compose.ui.tooling.preview.Preview | |
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import org.sopt.and.R | ||
import org.sopt.and.presentation.ui.home.component.TextWithNavigateButton | ||
import org.sopt.and.presentation.ui.home.component.HomeAsyncImage | ||
import org.sopt.and.presentation.ui.home.component.TextWithNavigateButton | ||
import org.sopt.and.ui.theme.ANDANDROIDTheme | ||
import org.sopt.and.ui.theme.Gray100 | ||
import org.sopt.and.ui.theme.GrayBlack | ||
|
@@ -44,26 +44,20 @@ import org.sopt.and.ui.theme.White | |
fun HomeScreen( | ||
bannerImgList: List<String>, | ||
numPages: String, | ||
onCurrentPageChanged: (Int) -> Unit, | ||
editorRecommendedImgList: List<String>, | ||
todayTopRankingImgList: List<String>, | ||
modifier: Modifier = Modifier | ||
modifier: Modifier = Modifier, | ||
pagerState: PagerState = rememberPagerState(pageCount = { 0 }), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HomeScreen에서 rememberPagerState는 어떻게 사용되는건가요?? |
||
) { | ||
Column( | ||
modifier = modifier | ||
.fillMaxSize() | ||
.background(GrayBlack) | ||
.verticalScroll(rememberScrollState()) | ||
) { | ||
val pagerState = rememberPagerState(pageCount = { bannerImgList.size }) | ||
val horizontalContentPadding = | ||
((LocalConfiguration.current).screenWidthDp * (1F - 0.85F) / 2).dp | ||
|
||
// TODO PagerState 자체를 인자로 받고 아래 LaunchedEffect를 HomeRoute로 옮기기 | ||
LaunchedEffect(pagerState.currentPage) { | ||
onCurrentPageChanged(pagerState.currentPage) | ||
} | ||
|
||
HorizontalPager( | ||
state = pagerState, | ||
contentPadding = PaddingValues(horizontal = horizontalContentPadding), | ||
|
@@ -214,7 +208,6 @@ fun HomePreview() { | |
HomeScreen( | ||
bannerImgList = listOf(""), | ||
numPages = "6", | ||
onCurrentPageChanged = { }, | ||
editorRecommendedImgList = listOf(""), | ||
todayTopRankingImgList = listOf("") | ||
) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
snapshotFlow는 혹시 사용하신 이유가 있나요??