Skip to content

Commit

Permalink
fix/ktlint: ktlint formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkim1019 committed Nov 10, 2023
1 parent a53b019 commit 3f96266
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ interface HomeRepository {
suspend fun getAnnouncementList(): List<Announcement>

suspend fun getReviewList(): List<Review>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ internal class HomeRepositoryImpl @Inject constructor(
override suspend fun getReviewList(): List<Review> {
TODO("Not yet implemented")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fun Content(
titleRes3: Int,
t1Value: String,
t2Value: String,
t3Value: String,
t3Value: String
) {
Column(modifier = modifier) {
TitleValue(title = stringResource(id = titleRes1), value = t1Value, style = textStyle)
Expand All @@ -46,13 +46,13 @@ fun TitleValue(
text = title,
style = style,
color = Gray3,
modifier = Modifier.defaultMinSize(minWidth = 35.dp),
modifier = Modifier.defaultMinSize(minWidth = 35.dp)
)
Spacer(modifier = Modifier.width(12.dp))
Text(
text = value,
style = style,
color = Gray2,
color = Gray2
)
}
}
Expand All @@ -63,4 +63,4 @@ fun ContentPreview() {
ConnectDogTheme {
TitleValue(title = "일정", value = "23.10.19(목)", style = MaterialTheme.typography.labelLarge)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.kusitms.connectdog.core.designsystem.R
@Composable
fun AnnouncementContent(
date: String,
organization : String,
organization: String,
hasKennel: Boolean,
style: TextStyle = MaterialTheme.typography.labelLarge
) {
Expand All @@ -20,14 +20,14 @@ fun AnnouncementContent(
titleRes3 = R.string.need_kennel,
t1Value = date,
t2Value = organization,
t3Value = if (hasKennel) stringResource(id = R.string.has_kennel) else stringResource(id = R.string.has_not_kennel),
t3Value = if (hasKennel) stringResource(id = R.string.has_kennel) else stringResource(id = R.string.has_not_kennel)
)
}

@Composable
fun ReviewContent(
date: String,
location : String,
location: String,
organization: String,
style: TextStyle = MaterialTheme.typography.labelLarge
) {
Expand All @@ -38,7 +38,7 @@ fun ReviewContent(
titleRes3 = R.string.organization,
t1Value = date,
t2Value = location,
t3Value = organization,
t3Value = organization
)
}

Expand All @@ -58,4 +58,4 @@ fun RecentContent(
t2Value = location,
t3Value = volunteer
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun NetworkImage(
modifier: Modifier = Modifier,
placeholder: Painter? = null,
contentScale: ContentScale = ContentScale.Crop,
contentDescription: String? = null,
contentDescription: String? = null
) {
CoilImage(
imageModel = { imageUrl },
Expand All @@ -32,7 +32,7 @@ fun NetworkImage(
imageOptions = ImageOptions(
contentScale = contentScale,
alignment = Alignment.Center,
contentDescription = contentDescription,
contentDescription = contentDescription
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.ui.unit.dp
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -23,12 +22,12 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.kusitms.connectdog.core.designsystem.R
import com.kusitms.connectdog.core.designsystem.theme.Gray2
import com.kusitms.connectdog.core.model.Recent
import com.kusitms.connectdog.core.model.Review


@Composable
fun ConnectDogCommunityContent(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -133,7 +132,8 @@ fun ProfileContent(
) {
Row(verticalAlignment = Alignment.CenterVertically) {
NetworkImage(
imageUrl = profileUrl, modifier = Modifier
imageUrl = profileUrl,
modifier = Modifier
.size(30.dp)
.clip(CircleShape),
placeholder = ColorPainter(MaterialTheme.colorScheme.primary)
Expand Down Expand Up @@ -178,4 +178,4 @@ private fun ReviewContentPreview() {
content = "진짜 천사같은 아기와 하루를 함께해서 행복했습니다 너무 감사드려요 봉사 또 해야징 ><"
)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ data class Announcement(
val date: String,
val organization: String,
val hasKennel: Boolean
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ constructor(
flow {
emit(homeRepository.getAnnouncementList())
}.map {
if (it.isNotEmpty()) AnnouncementUiState.Announcements(it)
else AnnouncementUiState.Empty
if (it.isNotEmpty()) {
AnnouncementUiState.Announcements(it)
} else {
AnnouncementUiState.Empty
}
}.catch {
_errorFlow.emit(it)
}.stateIn(
Expand All @@ -63,8 +66,11 @@ constructor(
flow {
emit(homeRepository.getReviewList())
}.map {
if (it.isNotEmpty()) ReviewUiState.Reviews(it)
else ReviewUiState.Empty
if (it.isNotEmpty()) {
ReviewUiState.Reviews(it)
} else {
ReviewUiState.Empty
}
}.catch {
_errorFlow.emit(it)
}.stateIn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ fun NavController.navigateSearch() {
navigate(HomeRoute.search)
}

fun NavController.navigateReview(){
fun NavController.navigateReview() {
navigate(HomeRoute.review)
}

fun NavController.navigateDetail(){
fun NavController.navigateDetail() {
navigate(HomeRoute.detail)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ import com.kusitms.connectdog.core.designsystem.theme.Gray2
import com.kusitms.connectdog.core.designsystem.theme.Gray3
import com.kusitms.connectdog.core.model.Announcement
import com.kusitms.connectdog.core.model.Review
import com.kusitms.connectdog.feature.home.state.ExampleUiState
import com.kusitms.connectdog.feature.home.HomeViewModel
import com.kusitms.connectdog.feature.home.R
import com.kusitms.connectdog.feature.home.state.AnnouncementUiState
import com.kusitms.connectdog.feature.home.state.ExampleUiState
import com.kusitms.connectdog.feature.home.state.ReviewUiState
import kotlinx.coroutines.flow.collectLatest

Expand Down Expand Up @@ -107,7 +107,7 @@ private fun HomeScreen(
onBackClick: () -> Unit,
onNavigateToSearch: () -> Unit,
onNavigateToReview: () -> Unit,
onNavigateToDetail: () -> Unit,
onNavigateToDetail: () -> Unit
) {
val scrollState = rememberScrollState()
Column(
Expand Down Expand Up @@ -293,7 +293,7 @@ private fun MoveContent(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.padding(horizontal = 20.dp, vertical = 20.dp)
.fillMaxWidth(),
.fillMaxWidth()
) {
Text(
text = stringResource(id = titleRes),
Expand Down Expand Up @@ -383,7 +383,7 @@ private fun ReviewListContent(

@Composable
private fun ReviewLoading(modifier: Modifier, arrangement: Arrangement.Horizontal) {
val list = List(4){
val list = List(4) {
Review(
profileUrl = "",
dogName = "멍멍이",
Expand All @@ -395,7 +395,7 @@ private fun ReviewLoading(modifier: Modifier, arrangement: Arrangement.Horizonta
content = "진짜 천사같은 아기와 하루를 함께해서 행복했습니다 너무 감사드려요 봉사 또 해야징 ><"
)
}
LazyRow(horizontalArrangement = arrangement, modifier = modifier){
LazyRow(horizontalArrangement = arrangement, modifier = modifier) {
items(list) {
ReviewCardContent(review = it)
}
Expand Down Expand Up @@ -430,7 +430,6 @@ private fun AnnouncementCardContent(
hasKennel = announcement.hasKennel,
style = MaterialTheme.typography.labelMedium
)

}
}

Expand Down Expand Up @@ -461,7 +460,8 @@ private fun HomeScreenPreview() {
{},
{},
{},
{})
{}
)
}
}
}
Expand All @@ -480,4 +480,4 @@ private fun AnnouncementPreview() {
)
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ private fun TopAppBar(
}

@Composable
private fun ReviewContent(uiState: ReviewUiState){
private fun ReviewContent(uiState: ReviewUiState) {
val modifier = Modifier.padding(horizontal = 0.dp)
when (uiState) {
is ReviewUiState.Reviews -> {
ReviewListContent(
list = uiState.reviews,
modifier = modifier,
modifier = modifier
)
}

Expand All @@ -72,18 +72,18 @@ private fun ReviewContent(uiState: ReviewUiState){
@Composable
private fun ReviewListContent(
list: List<Review>,
modifier: Modifier,
){
LazyColumn(modifier = modifier){
items(list.take(30)){
modifier: Modifier
) {
LazyColumn(modifier = modifier) {
items(list.take(30)) {
ReviewItemContent(review = it)
}
}
}

@Composable
private fun ReviewLoading(modifier: Modifier) {
val list = List(10){
val list = List(10) {
Review(
profileUrl = "",
dogName = "멍멍이",
Expand All @@ -95,7 +95,7 @@ private fun ReviewLoading(modifier: Modifier) {
content = "진짜 천사같은 아기와 하루를 함께해서 행복했습니다 너무 감사드려요 봉사 또 해야징 ><"
)
}
LazyColumn(modifier = modifier){
LazyColumn(modifier = modifier) {
items(list) {
ReviewItemContent(review = it)
}
Expand All @@ -115,8 +115,8 @@ private fun ReviewItemContent(

@Preview
@Composable
private fun ReviewScreenPreview(){
private fun ReviewScreenPreview() {
ConnectDogTheme {
ReviewContent(uiState = ReviewUiState.Empty)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package com.kusitms.connectdog.feature.home.state
import com.kusitms.connectdog.core.model.Announcement

sealed interface AnnouncementUiState {
object Loading: AnnouncementUiState
object Empty: AnnouncementUiState
object Loading : AnnouncementUiState
object Empty : AnnouncementUiState
data class Announcements(
val announcements: List<Announcement>
): AnnouncementUiState
}
) : AnnouncementUiState
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package com.kusitms.connectdog.feature.home.state
import com.kusitms.connectdog.core.model.Review

sealed interface ReviewUiState {
object Loading: ReviewUiState
object Empty: ReviewUiState
object Loading : ReviewUiState
object Empty : ReviewUiState
data class Reviews(
val reviews: List<Review>
): ReviewUiState
}
) : ReviewUiState
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.kusitms.connectdog.feature.login

import android.content.Context
import android.util.Log
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ internal class MainNavigator(
navController.navigateSearch()
}

fun navigateHomeReview(){
fun navigateHomeReview() {
navController.navigateReview()
}

fun navigateHomeDetail(){
fun navigateHomeDetail() {
navController.navigateDetail()
}

Expand Down

0 comments on commit 3f96266

Please sign in to comment.