-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI/#11] ํ์ ๋ทฐ / ํ์ ๊ธฐ๋ณธ ํ๋ฉด ๊ตฌํ
- Loading branch information
Showing
12 changed files
with
307 additions
and
59 deletions.
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
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
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
29 changes: 29 additions & 0 deletions
29
feature/src/main/java/com/terning/feature/search/component/DotsIndicator.kt
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.terning.feature.search.component | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun DotsIndicator( | ||
modifier: Modifier = Modifier, | ||
pageCount: Int, | ||
currentPage: Int, | ||
) { | ||
Row( | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
verticalAlignment = Alignment.CenterVertically, | ||
modifier = Modifier.padding(8.dp) | ||
) { | ||
repeat(pageCount) { index -> | ||
IndicatorDots( | ||
isSelected = index == currentPage, | ||
modifier = modifier | ||
) | ||
} | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
feature/src/main/java/com/terning/feature/search/component/ImageSlider.kt
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.terning.feature.search.component | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.wrapContentSize | ||
import androidx.compose.foundation.pager.HorizontalPager | ||
import androidx.compose.foundation.pager.rememberPagerState | ||
import androidx.compose.material3.Card | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.unit.dp | ||
import com.terning.core.designsystem.theme.Grey200 | ||
import kotlinx.coroutines.delay | ||
|
||
@Composable | ||
fun ImageSlider( | ||
modifier: Modifier = Modifier, | ||
images: List<Int>, | ||
) { | ||
val pagerState = rememberPagerState(pageCount = { images.size }) | ||
|
||
LaunchedEffect(Unit) { | ||
while (true) { | ||
delay(3000) | ||
val nextPage = (pagerState.currentPage + 1) % pagerState.pageCount | ||
pagerState.scrollToPage(nextPage) | ||
} | ||
} | ||
Column( | ||
modifier | ||
.fillMaxWidth() | ||
.background(Grey200), | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Box( | ||
modifier = modifier | ||
.wrapContentSize(), | ||
contentAlignment = Alignment.BottomCenter | ||
) { | ||
HorizontalPager( | ||
state = pagerState, | ||
modifier = modifier.wrapContentSize() | ||
) { currentPage -> | ||
Card( | ||
modifier | ||
.wrapContentSize() | ||
) { | ||
Image( | ||
painter = painterResource(id = images[currentPage]), | ||
contentDescription = null, | ||
modifier = modifier | ||
.fillMaxWidth() | ||
.height(112.dp) | ||
.padding(16.dp) | ||
) | ||
} | ||
} | ||
DotsIndicator( | ||
pageCount = images.size, | ||
currentPage = pagerState.currentPage | ||
) | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
feature/src/main/java/com/terning/feature/search/component/IndicatorDots.kt
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.terning.feature.search.component | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.unit.dp | ||
import com.terning.core.designsystem.theme.TerningMain | ||
import com.terning.core.designsystem.theme.White | ||
|
||
@Composable | ||
fun IndicatorDots( | ||
isSelected: Boolean, modifier: Modifier, | ||
) { | ||
Box( | ||
modifier = modifier | ||
.padding(2.dp) | ||
.clip(CircleShape) | ||
.size(6.dp) | ||
.background(if (isSelected) TerningMain else White) | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
feature/src/main/java/com/terning/feature/search/component/InternListType.kt
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.terning.feature.search.component | ||
|
||
enum class InternListType(val type: String) { | ||
VIEW("view"), | ||
SCRAP("scrap"); | ||
} |
Oops, something went wrong.