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
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ android {
buildConfigField("String", "BASE_URL", properties["base.url"].toString())
buildConfigField("String", "KAKAO_NATIVE_KEY", properties["kakao.native.key"].toString())
buildConfigField("String", "KAKAO_REST_API_KEY", properties["kakao.rest.api"].toString())
buildConfigField("String", "NAVERMAP_CLIENT_SECRET", properties["NAVERMAP_CLIENT_SECRET"].toString())
buildConfigField("String", "NAVERMAP_CLIENT_ID", properties["NAVERMAP_CLIENT_ID"].toString())

manifestPlaceholders["KAKAO_NATIVE_KEY"] = properties["kakao.native.key"].toString()
}
Expand Down Expand Up @@ -103,4 +105,7 @@ dependencies {

//로띠 - 애니메이션
implementation(libs.lottie.compose)

// 네이버
implementation(libs.bundles.naverMaps)
}
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<activity
android:name=".presentation.ui.main.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.PawKey">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/paw/key/PawKeyApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.paw.key
import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import com.kakao.vectormap.KakaoMapSdk
import com.naver.maps.map.NaverMapSdk
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber
import javax.inject.Inject
Expand All @@ -12,7 +13,7 @@ import javax.inject.Named
class PawKeyApplication : Application() {
@Inject
@Named("kakao.native.key")
lateinit var kakaoNativeKey: String
lateinit var kakaoNativeKey: String // BuildConfig는 컴파일 타임에 생성되는 정적 클래스이기 때문에 Mocking이 불가능 = 테스트 용이성

override fun onCreate() {
super.onCreate()
Expand All @@ -21,6 +22,8 @@ class PawKeyApplication : Application() {
setDarkMode()

KakaoMapSdk.init(this, kakaoNativeKey)
NaverMapSdk.getInstance(this).client =
NaverMapSdk.NcpKeyClient(BuildConfig.NAVERMAP_CLIENT_ID)
}

private fun setTimber() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.paw.key.R
import com.paw.key.core.designsystem.theme.PawKeyTheme
import com.paw.key.core.util.noRippleClickable
import com.paw.key.core.extension.noRippleClickable

@Composable
fun CourseCard(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import com.paw.key.core.designsystem.theme.PawKeyTheme
import com.paw.key.core.util.noRippleClickable
import com.paw.key.core.extension.noRippleClickable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 이거 패키지 옮겼군요

Copy link
Member Author

@sonms sonms Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extension과 util의 관계를 명확히 해야할 것 같아서용 ㅠㅠ ㅎㅎ;


@Composable
fun FeedbackItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.paw.key.core.designsystem.theme.PawKeyTheme
import com.paw.key.core.util.noRippleClickable
import com.paw.key.core.extension.noRippleClickable


@Preview(showBackground = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.paw.key.core.designsystem.component

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
Expand All @@ -11,7 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.paw.key.core.designsystem.theme.PawKeyTheme
import com.paw.key.core.util.noRippleClickable
import com.paw.key.core.extension.noRippleClickable

@Preview
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ 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
import com.paw.key.core.util.noRippleClickable
import com.paw.key.core.extension.noRippleClickable

@Composable
fun TopBar(
title: String,
onBackClick: () -> Unit,
modifier: Modifier = Modifier,
onClickTitle : () -> Unit = {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피그마에 컴포넌트가 없어서 잘은 모르겠는데, 선택적으로 콜백 할라고 한건가용

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 이거 회원가입 플로우를 건너뛰고 바로 홈으로 이동하기 위해 만든 일종의 이스터에그 입니다 ㅎㅎ 나중에 플로우 확립되면 제거 예정 지금은 테스트용!

isBackVisible: Boolean = true,
) {
Box(
Expand All @@ -45,6 +46,7 @@ fun TopBar(
style = PawKeyTheme.typography.head18Sb,
modifier = Modifier
.align(Alignment.Center)
.noRippleClickable(onClickTitle)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.paw.key.core.extension

import android.location.Location
import com.naver.maps.geometry.LatLng

fun Location.toLatLng(): LatLng {
return LatLng(this.latitude, this.longitude)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.paw.key.core.util
package com.paw.key.core.extension

import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
Expand Down
17 changes: 2 additions & 15 deletions app/src/main/java/com/paw/key/core/util/PreferenceDataStore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.datastore.preferences.core.intPreferencesKey
import androidx.datastore.preferences.core.longPreferencesKey
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.preferencesDataStore
import com.kakao.vectormap.LatLng
import com.naver.maps.geometry.LatLng
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map

Expand Down Expand Up @@ -35,15 +35,6 @@ private val ACTIVE_REGION_KEY = stringPreferencesKey("active_region")
private fun List<LatLng>.toPreferenceString(): String =
joinToString(";") { "${it.latitude},${it.longitude}" }

private fun String.toLatLngList(): List<LatLng> =
split(";").mapNotNull {
val parts = it.split(",")
if (parts.size == 2) {
LatLng.from(parts[0].toDoubleOrNull() ?: return@mapNotNull null, parts[1].toDoubleOrNull() ?: return@mapNotNull null)
}
else null
}

object PreferenceDataStore {

private lateinit var appContext: Context
Expand All @@ -70,10 +61,6 @@ object PreferenceDataStore {
}
}

fun getPoints(): Flow<List<LatLng>> = summaryStore.data.map {
it[POINTS_KEY]?.toLatLngList() ?: emptyList()
}

fun getTotalDistance(): Flow<Float> = summaryStore.data.map {
it[TOTAL_DISTANCE_KEY] ?: 0f
}
Expand Down Expand Up @@ -141,7 +128,7 @@ object PreferenceDataStore {
}

fun getUserId(): Flow<Int> = summaryStore.data.map {
it[USER_ID_KEY] ?: 41
it[USER_ID_KEY] ?: 43
}

fun getUserName(): Flow<String> = summaryStore.data.map {
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/com/paw/key/core/util/UiState.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.paw.key.core.util

sealed class UiState<out T> {
data object Empty : UiState<Nothing>()
sealed interface UiState<out T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

util 쪽 코드를 잘 안짜봐서 모르긴한데, class -> interface로 변경한 이유가 있을까요?(순수 궁금)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우선 UiState의 역할을 저는 그 자체로 동작을 갖지않고 상태만 구분하기 위한 것이라 생각해서 interface로 의도를 명확히 하고 또 class로 사용 시 class 자체의 기본적으로 상속받는 equals, hashcode, toString이런 것들을 자동 상속 받지 않게해서 조금 더 경량화하는 방향을 생각했습니다~!

data object Empty : UiState<Nothing>

data object Loading : UiState<Nothing>()
data object Loading : UiState<Nothing>

data class Success<T>(
val data: T,
) : UiState<T>()
) : UiState<T>

data class Failure(
val message: String,
) : UiState<Nothing>()
) : UiState<Nothing>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ package com.paw.key.data.repositoryimpl

import android.graphics.Bitmap
import android.util.Log
import com.kakao.vectormap.LatLng
import com.naver.maps.geometry.LatLng
import com.paw.key.domain.model.entity.sharedresult.WalkResult
import com.paw.key.domain.repository.WalkSharedResultRepository
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import javax.inject.Inject
import javax.inject.Singleton
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.paw.key.domain.model.entity.sharedresult

import android.graphics.Bitmap
import com.kakao.vectormap.LatLng
import com.naver.maps.geometry.LatLng

data class WalkResult(
val bitmap: Bitmap?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.paw.key.domain.repository

import android.graphics.Bitmap
import com.kakao.vectormap.LatLng
import com.naver.maps.geometry.LatLng
import com.paw.key.domain.model.entity.sharedresult.WalkResult
import kotlinx.coroutines.flow.Flow

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Icon
Expand All @@ -35,7 +34,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.paw.key.R
import com.paw.key.core.designsystem.component.CourseCard
import com.paw.key.core.designsystem.theme.PawKeyTheme
import com.paw.key.core.util.noRippleClickable
import com.paw.key.core.extension.noRippleClickable
import com.paw.key.presentation.ui.course.entire.tab.map.List.viewmodel.TapListViewModel

@Preview(showBackground = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,21 @@ class TapListViewModel @Inject constructor(
}

fun updateSortTime(option: String) {
Log.e("updateSortTime", option)
when (option) {
"21분 이내" -> {
"20분 이내" -> {
_state.update {
it.copy(
selectedSortTimeStart = 0,
selectedSortTimeEnd = 21
selectedSortTimeEnd = 20
)
}
}

"21~40분" -> {
_state.update {
it.copy(
selectedSortTimeStart = 21,
selectedSortTimeStart = 20,
selectedSortTimeEnd = 40
)
}
Expand All @@ -132,7 +133,7 @@ class TapListViewModel @Inject constructor(
"41~60분" -> {
_state.update {
it.copy(
selectedSortTimeStart = 41,
selectedSortTimeStart = 40,
selectedSortTimeEnd = 60
)
}
Expand All @@ -141,7 +142,7 @@ class TapListViewModel @Inject constructor(
"1시간 이상" -> {
_state.update {
it.copy(
selectedSortTimeStart = 61,
selectedSortTimeStart = 60,
selectedSortTimeEnd = null
)
}
Expand Down Expand Up @@ -321,6 +322,8 @@ class TapListViewModel @Inject constructor(
selectedOptions = selectedOptions.ifEmpty { null }
)

Log.e("TapListViewModel", "요청 데이터: $request")

postsListRepository.postList(
userId = userId.first(),
request = request
Expand Down
Loading