Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
243d1b0
setting/#11: 카카오맵 관련 gradle, toml, permission 세팅
sonms Jul 9, 2025
3527e61
feat/#11: 산책하기 메인 탭의 상위 탭 표시를 위한 contract, viewmodel 구성
sonms Jul 9, 2025
c9a5afa
feat/#11: 산책하기 전체의 TabRow 구현
sonms Jul 9, 2025
c3130df
feat/#11: 산책하기 메인 탭 뷰 구성 - 퍼미션 체크
sonms Jul 9, 2025
9288cfc
feat/#11: 지도 탭 contract, viewmodel 구현
sonms Jul 9, 2025
094ea0d
feat/#11: 지도 탭 네비게이션 구현
sonms Jul 9, 2025
ee2b21f
feat/#11: 지도 탭용 지도 구현 - 실시간 위치 확인
sonms Jul 9, 2025
4522f46
feat/#11: 지도 탭 전체 뷰 구현
sonms Jul 9, 2025
e2260fd
feat/#11: 지도 탭에서 산책하기 contract, viewmodel 구현
sonms Jul 9, 2025
a8e60bf
feat/#11: 산책하기 record 컴포넌트 구현 - 거리, 시간, 걸음수
sonms Jul 9, 2025
0fc283c
feat/#11: 산책하기용 지도 구현
sonms Jul 9, 2025
8e9dd4e
feat/#11: 산책하기 뷰 구현
sonms Jul 9, 2025
847528c
feat/#11: 산책 완료 후 뷰모델 구현 - 데이터 스토어 di 구현 및 비트맵 저장 구현
sonms Jul 9, 2025
84c2b54
feat/#11: 전체코스 루트 네비게이션
sonms Jul 9, 2025
31a9e7c
delete/#11: 전체 루트로 변경
sonms Jul 9, 2025
bc6c6ef
feat/#11: 로딩 스크린 구현
sonms Jul 9, 2025
a4d8300
feat/#11: 산책 완료 후 헤더 - 프로필 사진, 시간, 날짜
sonms Jul 9, 2025
2a89453
feat/#11: 산책 완료 네비게이션
sonms Jul 9, 2025
2729091
feat/#11: 산책 완료 뷰 구현
sonms Jul 9, 2025
f7a975b
chore/#11: 메인 바텀 visible 수정
sonms Jul 9, 2025
b226db2
chore/#11: 메인 네비게이터 숨김 분기 추가로 수정
sonms Jul 9, 2025
cf61a1b
chore/#11: Main 버전 관련 수정
sonms Jul 9, 2025
2b3f0fd
chore/#11: Application 수준에서 카카오 sdk
sonms Jul 9, 2025
4db6fc7
feat/#11: 데이터 스토어 레포지토리 모듈 구현
sonms Jul 9, 2025
5bbbb1a
feat/#11: 산책하기 화면 이동 navhost 세팅
sonms Jul 9, 2025
eaed79f
setting/#11: 산책하기 관련 strings 세팅
sonms Jul 9, 2025
719ac83
setting/#11: centerLabel - 유저 세팅
sonms Jul 9, 2025
bd33cab
Merge branch 'develop' into feat/#11-course-screen
sonms Jul 10, 2025
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
13 changes: 13 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ android {

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
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())

manifestPlaceholders["KAKAO_NATIVE_KEY"] = properties["kakao.native.key"].toString()
}

buildTypes {
Expand Down Expand Up @@ -79,4 +83,13 @@ dependencies {
implementation(libs.timber)

implementation(libs.accompanist.systemuicontroller)

implementation(libs.androidx.datastore.preferences)

//카카오
implementation(libs.kakaoMaps)
implementation(libs.v2.all)

//실시간 위치
implementation(libs.play.services.location)
}
10 changes: 10 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH"/>

<application
android:name="com.paw.key.PawKeyApplication"
Expand All @@ -27,6 +33,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="com.kakao.vectormap.AppKey"
android:value="${KAKAO_NATIVE_KEY}"/>
</application>

</manifest>
9 changes: 9 additions & 0 deletions app/src/main/java/com/paw/key/PawKeyApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@ package com.paw.key

import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import com.kakao.vectormap.KakaoMapSdk
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber
import javax.inject.Inject
import javax.inject.Named

@HiltAndroidApp
class PawKeyApplication : Application() {
@Inject
@Named("kakao.native.key")
lateinit var kakaoNativeKey: String

override fun onCreate() {
super.onCreate()

setTimber()
setDarkMode()

KakaoMapSdk.init(this, kakaoNativeKey)
}

private fun setTimber() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.paw.key.core.designsystem.component

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
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

@Composable
fun LoadingScreen() {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally
) {
CircularProgressIndicator(
color = Color.Green
)

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

Text("현재 위치를 가져오는 중...")
}
}
}

@Preview
@Composable
private fun LoadingScreenPreview() {
PawKeyTheme {
LoadingScreen()
}
}
33 changes: 33 additions & 0 deletions app/src/main/java/com/paw/key/data/di/AppModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.paw.key.data.di

import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStore
import com.paw.key.BuildConfig
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Named
import javax.inject.Singleton

val Context.bitmapDataStore: DataStore<Preferences> by preferencesDataStore(name = "captured_bitmap_prefs")

@Module
@InstallIn(SingletonComponent::class)
object AppModule {

@Provides
@Named("kakao.native.key")
fun provideKakaoNativeKey(): String {
return BuildConfig.KAKAO_NATIVE_KEY
}

@Singleton
@Provides
fun provideBitmapDataStore(@ApplicationContext context: Context): DataStore<Preferences> {
return context.bitmapDataStore
}
}
7 changes: 7 additions & 0 deletions app/src/main/java/com/paw/key/data/di/RepositoryModule.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.paw.key.data.di

import com.paw.key.data.repositoryimpl.BitmapRepositoryImpl
import com.paw.key.data.repositoryimpl.DummyRepositoryImpl
import com.paw.key.domain.repository.BitmapRepository
import com.paw.key.domain.repository.DummyRepository
import dagger.Binds
import dagger.Module
Expand All @@ -16,4 +18,9 @@ interface RepositoryModule {
dummyRepositoryImpl: DummyRepositoryImpl
): DummyRepository

@Binds
fun bindsBitmapRepository(
bitmapRepositoryImpl: BitmapRepositoryImpl
): BitmapRepository

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.paw.key.data.repositoryimpl

import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.util.Base64
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.stringPreferencesKey
import com.paw.key.domain.repository.BitmapRepository
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import java.io.ByteArrayOutputStream
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class BitmapRepositoryImpl @Inject constructor(
private val dataStore: DataStore<Preferences>
) : BitmapRepository {
private object PreferencesKeys {
val CAPTURED_BITMAP_BASE64 = stringPreferencesKey("captured_bitmap_base64")
}

override suspend fun saveBitmap(bitmap: Bitmap) {
dataStore.edit { preferences ->
val outputStream = ByteArrayOutputStream()
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream)

val byteArray = outputStream.toByteArray()
val base64String = Base64.encodeToString(byteArray, Base64.DEFAULT)

preferences[PreferencesKeys.CAPTURED_BITMAP_BASE64] = base64String
}
}

override fun getSavedBitmap(): Flow<Bitmap?> {
return dataStore.data.map { preferences ->
val base64String = preferences[PreferencesKeys.CAPTURED_BITMAP_BASE64]

if (!base64String.isNullOrEmpty()) {
try {
val byteArray = Base64.decode(base64String, Base64.DEFAULT)
BitmapFactory.decodeByteArray(byteArray, 0, byteArray.size)
} catch (e: IllegalArgumentException) {
null
}
} else {
null
}
}
}

override suspend fun clearSavedBitmap() {
dataStore.edit { preferences ->
preferences.remove(PreferencesKeys.CAPTURED_BITMAP_BASE64)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.paw.key.domain.repository

import android.graphics.Bitmap
import kotlinx.coroutines.flow.Flow

interface BitmapRepository {
suspend fun saveBitmap(bitmap: Bitmap)
fun getSavedBitmap(): Flow<Bitmap?>
suspend fun clearSavedBitmap()
}

This file was deleted.

Loading