Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import com.paw.key.R
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -48,7 +49,9 @@ fun CourseCard(
petName:String,
date: String,
onCLickItem : () -> Unit,
modifier: Modifier = Modifier
modifier: Modifier = Modifier,
isShared : Boolean = false, // true면 떠진거 false면 닫은거
isRecord : Boolean = false // 기록한 아이템 - true면 하트, false면 공유 아이콘
) {
Column(
modifier = modifier
Expand All @@ -65,30 +68,46 @@ fun CourseCard(
modifier = Modifier
.fillMaxWidth()
.aspectRatio(343f / 172f)
.clip(RoundedCornerShape(20.dp))
.clip(RoundedCornerShape(10.dp))
) {
// 지도 이미지
// 지도 이미지 Todo : 테스트용
Image(
painter = painterResource(id = R.drawable.dummy_map),
contentDescription = null,
modifier = Modifier.fillMaxSize(),
modifier = Modifier
.fillMaxSize()
.padding(start = 8.dp, end = 8.dp, top = 8.dp)
.clip(RoundedCornerShape(8.dp)),
contentScale = ContentScale.Crop
)

/*AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data("https://pawkey-server.com/image.jpg") // ← 서버에서 받은 이미지 URL 넣깅
.crossfade(true)
.build(),
contentDescription = null,
modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Crop
)*/

// 하단 그라데이션 오버레이
Box(
modifier = Modifier
.fillMaxWidth()
.height(LocalConfiguration.current.screenHeightDp.dp * 0.6f) // 높이 조절 가능
.padding(start = 8.dp, end = 8.dp, top = 8.dp)
.align(Alignment.BottomCenter)
.background(
brush = Brush.verticalGradient(
colors = listOf(
PawKeyTheme.colors.black.copy(0.05f),
PawKeyTheme.colors.black.copy(0.55f)
)
)
),
shape = RoundedCornerShape(8.dp)
)
.clip(RoundedCornerShape(8.dp))
)

// 프로필 + 제목
Expand Down Expand Up @@ -131,40 +150,67 @@ fun CourseCard(
)
}
}
Spacer(modifier = Modifier.weight(1f)) // 아이콘을 Row 끝으로 밀기 위한 Spacer
Spacer(modifier = Modifier.weight(1f))

val isLiked = remember { mutableStateOf(false) }
when {
isShared -> {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_eye_linear_valid),
contentDescription = "공유됨",
tint = PawKeyTheme.colors.gray200,
)
}
isRecord -> {
val isLiked = remember { mutableStateOf(false) }

Icon(
imageVector = if (isLiked.value) {
ImageVector.vectorResource(id = R.drawable.ic_heart_filled)
} else {
ImageVector.vectorResource(id = R.drawable.ic_heart_default)
},
contentDescription = "좋아요",
tint = Color.Unspecified,
modifier = Modifier.clickable {
isLiked.value = !isLiked.value
Icon(
imageVector = if (isLiked.value) {
ImageVector.vectorResource(id = R.drawable.ic_heart_filled)
} else {
ImageVector.vectorResource(id = R.drawable.ic_heart_default)
},
contentDescription = "좋아요",
tint = Color.Unspecified,
modifier = Modifier.clickable {
isLiked.value = !isLiked.value
}
)
}
)
else -> {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_eye_linear_invalid),
contentDescription = "공유 안됨",
tint = PawKeyTheme.colors.gray200,
)
}
}
}
}

Spacer(modifier = Modifier.height(12.dp))


ChipRow(tags = listOf(
ChipRow(
tags = listOf(
"이륜차 거의 없음",
"배변 쓰레기통",
"쉼터",
"CCTV 있음",
"물그릇 비치","이륜차 거의 없음",
"배변 쓰레기통",
"쉼터",
))
"쉼터",),
modifier = Modifier
.padding(start = 16.dp, end = 16.dp)
)

Spacer(modifier = Modifier.height(12.dp))
}

HorizontalDivider(
color = PawKeyTheme.colors.gray50,
thickness = 1.dp,
modifier = Modifier.padding(start = 16.dp, end = 16.dp)
)
}
@Preview(showBackground = true)
@Composable
Expand Down
55 changes: 35 additions & 20 deletions app/src/main/java/com/paw/key/core/designsystem/component/TopBar.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.paw.key.core.designsystem.component

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
Expand All @@ -14,38 +15,52 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.paw.key.R
import com.paw.key.core.designsystem.theme.PawKeyTheme

@Composable
fun TopBar(
title: String,
onBackClick: () -> Unit = {}
onBackClick: () -> Unit,
modifier: Modifier = Modifier,
isBackVisible: Boolean = true,
) {
Row(
modifier = Modifier
Box(
modifier = modifier
.fillMaxWidth()
.padding(vertical = 16.dp),
verticalAlignment = Alignment.CenterVertically
.padding(vertical = 12.dp, horizontal = 16.dp)
) {

Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_left_black),
contentDescription = "뒤로가기",
modifier = Modifier.clickable { onBackClick() }
)

Box(
modifier = Modifier.weight(1f),
contentAlignment = Alignment.Center
) {
Text(
text = title,
style = PawKeyTheme.typography.body16Sb
if (isBackVisible) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_left_black),
contentDescription = "뒤로가기",
modifier = Modifier
.align(Alignment.CenterStart)
.clickable { onBackClick() }
)
}

Spacer(modifier = Modifier.width(24.dp))
Text(
text = title,
style = PawKeyTheme.typography.head18Sb,
modifier = Modifier
.align(Alignment.Center)
)
}
}

@Preview(showBackground = true)
@Composable
private fun TopBarPreview() {
PawKeyTheme {
TopBar(
title = "산책 완료",
onBackClick = {},
isBackVisible = true,
modifier = Modifier
.fillMaxWidth()
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.paw.key.domain.model.entity.region.RegionDataEntity
import com.paw.key.domain.repository.RegionRepository
import javax.inject.Inject


class RegionRepositoryImpl @Inject constructor(
private val regionDataSource: RegionDataSource,
private val mapper: RegionMapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.core.content.ContextCompat
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand Down Expand Up @@ -159,7 +160,8 @@ fun EntireCourseScreen(
onTabSelected(it)
},
tabs = tabs,
modifier = Modifier,
modifier = Modifier
.padding(top = 8.dp),
)

when (currentPage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,18 @@ fun TabListScreen(
}

LazyColumn(
verticalArrangement = Arrangement.spacedBy(20.dp),
modifier = modifier
.fillMaxSize()
.background(PawKeyTheme.colors.white2)
.padding(bottom = 36.dp)

) {

item {
CourseCard(
title = "제목을 입력해주세요",
petName = "안녕꼬리",
date = "21/1/1",
isRecord = true,
onCLickItem = {}
)
}
Expand All @@ -107,6 +106,7 @@ fun TabListScreen(
title = "제목을 입력해주세요",
petName = "안녕꼬리",
date = "21/1/1",
isRecord = true,
onCLickItem = {}
)
}
Expand All @@ -115,6 +115,7 @@ fun TabListScreen(
title = "제목을 입력해주세요",
petName = "안녕꼬리",
date = "21/1/1",
isRecord = true,
onCLickItem = {}
)
}
Expand All @@ -123,6 +124,7 @@ fun TabListScreen(
title = "제목을 입력해주세요",
petName = "안녕꼬리",
date = "21/1/1",
isRecord = true,
onCLickItem = {}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import javax.inject.Inject
@HiltViewModel
class TapListViewModel @Inject constructor(

)
: ViewModel() {
) : ViewModel() {

private val _state = MutableStateFlow(TapListContract.TapListState())
val state: StateFlow<TapListContract.TapListState>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.FloatingActionButton
Expand Down Expand Up @@ -239,9 +240,10 @@ fun TapMapScreen(
FloatingActionButton(
onClick = onClickTracking,
shape = CircleShape,
containerColor = PawKeyTheme.colors.gray50,
containerColor = PawKeyTheme.colors.white1,
modifier = Modifier
.align(Alignment.BottomEnd)
.align(Alignment.CenterEnd)
.size(44.dp)
) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_course_map_tap_location_on),
Expand Down
Loading