Skip to content

Commit

Permalink
[MERGE] #229 -> develop
Browse files Browse the repository at this point in the history
[UI/#229] 검색 λ·° / UI μˆ˜μ •
  • Loading branch information
boiledEgg-s authored Sep 9, 2024
2 parents 9f64413 + cbf900c commit 47cc383
Show file tree
Hide file tree
Showing 15 changed files with 346 additions and 846 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fun TerningBasicTextField(
decorationBox = { innerTextField ->
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(12.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.padding(vertical = 8.dp)
) {
leftIcon?.let {
Expand Down

This file was deleted.

13 changes: 10 additions & 3 deletions feature/src/main/java/com/terning/feature/main/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ fun MainScreen(
)
calendarNavGraph(
paddingValues = paddingValues,
navHostController = navigator.navController)
searchNavGraph(navHostController = navigator.navController)
navHostController = navigator.navController
)
searchNavGraph(
paddingValues = paddingValues,
navHostController = navigator.navController
)
signInNavGraph(
paddingValues = paddingValues,
navHostController = navigator.navController
Expand Down Expand Up @@ -159,7 +163,10 @@ fun MainScreen(
paddingValues = paddingValues,
navHostController = navigator.navController
)
searchProcessNavGraph(navHostController = navigator.navController)
searchProcessNavGraph(
paddingValues = paddingValues,
navHostController = navigator.navController
)
internNavGraph(navHostController = navigator.navController)
myPageNavGraph(
paddingValues = paddingValues,
Expand Down
110 changes: 51 additions & 59 deletions feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -20,10 +18,9 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.flowWithLifecycle
import com.terning.core.designsystem.component.image.TerningImage
import com.terning.core.designsystem.component.textfield.SearchTextField
import com.terning.core.designsystem.component.topappbar.LogoTopAppBar
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey100
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.extension.noRippleClickable
import com.terning.core.state.UiState
Expand All @@ -36,6 +33,7 @@ import okhttp3.internal.toImmutableList

@Composable
fun SearchRoute(
modifier: Modifier,
navigateToSearchProcess: () -> Unit,
navigateToIntern: (Long) -> Unit,
viewModel: SearchViewModel = hiltViewModel(),
Expand Down Expand Up @@ -72,6 +70,7 @@ fun SearchRoute(
}

SearchScreen(
modifier = modifier,
searchViewsList = searchViewsList,
searchScrapsList = searchScrapsList,
navigateToSearchProcess = navigateToSearchProcess,
Expand All @@ -94,66 +93,59 @@ fun SearchScreen(
R.drawable.img_ad_3,
)

Scaffold(
modifier = modifier,
topBar = {
LogoTopAppBar()
}
) { paddingValues ->
Column(
Column(
modifier = modifier
.fillMaxSize()
) {
TerningImage(
painter = com.terning.core.R.drawable.ic_terning_logo_typo,
modifier = Modifier
.fillMaxSize()
.padding(paddingValues)
) {
Box(
modifier = Modifier
.padding(
horizontal = 24.dp,
vertical = 16.dp
)
.noRippleClickable {
navigateToSearchProcess()
}
) {
SearchTextField(
hint = stringResource(R.string.search_text_field_hint),
leftIcon = R.drawable.ic_nav_search,
modifier = Modifier.fillMaxWidth(),
enabled = false,
readOnly = true,
.padding(start = 24.dp, top = 16.dp)
)

Box(
modifier = Modifier
.padding(
horizontal = 24.dp,
vertical = 16.dp
)
}
.noRippleClickable {
navigateToSearchProcess()
}
) {
SearchTextField(
hint = stringResource(R.string.search_text_field_hint),
leftIcon = R.drawable.ic_nav_search,
modifier = Modifier.fillMaxWidth(),
enabled = false,
readOnly = true,
)
}

LazyColumn {
item {
ImageSlider(images = images)
LazyColumn {
item {
ImageSlider(images = images)

Spacer(modifier = Modifier.padding(8.dp))
Spacer(modifier = Modifier.padding(top = 20.dp))

Text(
text = stringResource(id = R.string.search_today_popular),
modifier = Modifier.padding(horizontal = 24.dp, vertical = 4.dp),
style = TerningTheme.typography.title1,
color = Black
)
SearchInternList(
type = InternListType.VIEW,
searchViewsList = searchViewsList,
searchScrapsList = searchScrapsList,
navigateToIntern = navigateToIntern,
)
HorizontalDivider(
thickness = 4.dp,
modifier = Modifier.padding(vertical = 8.dp),
color = Grey100,
)
SearchInternList(
type = InternListType.SCRAP,
searchViewsList = searchViewsList,
searchScrapsList = searchScrapsList,
navigateToIntern = navigateToIntern,
)
}
Text(
text = stringResource(id = R.string.search_today_popular),
modifier = Modifier.padding(horizontal = 24.dp, vertical = 4.dp),
style = TerningTheme.typography.title1,
color = Black
)
SearchInternList(
type = InternListType.VIEW,
searchViewsList = searchViewsList,
searchScrapsList = searchScrapsList,
navigateToIntern = navigateToIntern,
)
SearchInternList(
type = InternListType.SCRAP,
searchViewsList = searchViewsList,
searchScrapsList = searchScrapsList,
navigateToIntern = navigateToIntern,
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.terning.feature.search.search.component

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.material3.Text
Expand All @@ -21,20 +22,22 @@ fun SearchInternList(
searchViewsList: List<SearchPopularAnnouncement>?,
navigateToIntern: (Long) -> Unit,
) {
Column(modifier = Modifier.padding(horizontal = 24.dp)) {
Column(
modifier = Modifier.padding(horizontal = 24.dp)
) {
Text(
text = stringResource(
id = when (type) {
InternListType.VIEW -> R.string.search_most_view_intern
InternListType.SCRAP -> R.string.search_most_scrap_intern
}
),
style = TerningTheme.typography.title5,
style = TerningTheme.typography.body3,
color = Grey400
)

LazyRow(
modifier = Modifier.padding(vertical = 8.dp),
modifier = Modifier.padding(vertical = 12.dp),
horizontalArrangement = Arrangement.spacedBy(12.dp),
) {
when (type) {
Expand All @@ -61,5 +64,6 @@ fun SearchInternList(
}
}
}
Spacer(modifier = Modifier.padding(top = 20.dp))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package com.terning.feature.search.search.navigation

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.ui.Modifier
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
Expand All @@ -22,6 +25,7 @@ fun NavController.navigateSearch(navOptions: NavOptions? = null) {

fun NavGraphBuilder.searchNavGraph(
navHostController: NavHostController,
paddingValues: PaddingValues,
) {
composable<Search>(
exitTransition = {
Expand All @@ -38,6 +42,7 @@ fun NavGraphBuilder.searchNavGraph(
}
) {
SearchRoute(
modifier = Modifier.padding(paddingValues),
navigateToSearchProcess = { navHostController.navigateSearchProcess() },
navigateToIntern = { announcementId -> navHostController.navigateIntern(announcementId) }
)
Expand Down
Loading

0 comments on commit 47cc383

Please sign in to comment.