Skip to content

Commit

Permalink
Release for v1.2.1 (#9)
Browse files Browse the repository at this point in the history
- 전체 프로젝트 구조 변경
- MVVM + Usecase 구조로 변경
- 배틀 기능 개발
- 피드백(오류 신고) 기능 추가
- 코드 정리
- viewModel, useCase 구조 변경
  - Repository, Client 에서 전달되는 예외를 useCase 에서 받아서 feedback (오류신고) 를 위한 로그 저장 후, view 단에 오류 관련 화면 처리
  - Repository, Client : 각 레이어에 맞는 예외 (RepositoryException, ClientException) 발생하여 throw
  - useCase : Repository, Client 에서 발생하는 예외를 catch 하여 에러 로그 저장 후 useCaseException 발생하여 throw
  - viewModel : useCase에서 발생하는 예외를 catch 하여 각 상황에 맞는 화면 표시 (에러 화면)
- 포인트 관련 도움말 기능 추가
- 캐릭터 상호작용 관련 도움말 기능 추가
- 도움말 기능 추가
- 코드 정리
- 슬롯이 비었을 경우의 UI 수정
- 훈련 기능 개발
- ui 최적화
- 몽 생성 시, 이름 + 정기수면 시간 입력
  • Loading branch information
tableMinPark authored Jul 29, 2024
1 parent 297165e commit 1054f10
Show file tree
Hide file tree
Showing 774 changed files with 22,261 additions and 5,650 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
*.iml
.gradle
/local.properties
Expand Down
23 changes: 10 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ plugins {
}

android {
namespace 'com.paymong.wear'
namespace 'com.mongs.wear'
compileSdk 34

defaultConfig {
applicationId "com.paymong.wear"
applicationId "com.mongs.wear"
minSdk 30
targetSdk 34
versionCode 30
versionName "2.5"
versionCode 17
versionName "1.2.1"
vectorDrawables {
useSupportLibrary true
}
Expand All @@ -35,6 +35,7 @@ android {
}
buildFeatures {
compose true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.3'
Expand All @@ -47,20 +48,16 @@ android {
}

dependencies {
implementation project(":ui")
implementation project(':presentation')
implementation project(":domain")
implementation project(":data")

// dagger-hilt
implementation "com.google.dagger:hilt-android:2.48.1"
kapt 'com.google.dagger:hilt-compiler:2.48.1'
// inject
// dagger & hilt
implementation group: 'javax.inject', name: 'javax.inject', version: '1'
implementation "com.google.dagger:hilt-android:2.49"
kapt 'com.google.dagger:hilt-compiler:2.48.1'
// compose
implementation "androidx.activity:activity-compose:1.8.1"
// MQTT
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
implementation "androidx.activity:activity-compose:1.9.0"
}

kapt {
Expand Down
141 changes: 8 additions & 133 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,158 +1,33 @@
{
"project_info": {
"project_number": "561491513972",
"project_id": "paymong-7a7a5",
"storage_bucket": "paymong-7a7a5.appspot.com"
"project_number": "47490513860",
"project_id": "mongs-ccc23",
"storage_bucket": "mongs-ccc23.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:561491513972:android:34bef9680ba89094ec7721",
"mobilesdk_app_id": "1:47490513860:android:6989fe8e5bc4281bc10291",
"android_client_info": {
"package_name": "com.paymong"
"package_name": "com.mongs.wear"
}
},
"oauth_client": [
{
"client_id": "561491513972-6gi1efb185delnbio22d0mhan9tbpasi.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "00317650e1c7c9783ba0cd879c6f653818a38340"
}
},
{
"client_id": "561491513972-79jfk14dj168glbubp9ut7bo6u2cei6k.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "37e97b0d8accd02ed287875b4054be5b52624069"
}
},
{
"client_id": "561491513972-7a0adm1fdg15b5tv4lpmdjogqs5c1s2k.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "42a06d159b5b12d6fd5367d39edca1e26f420d6b"
}
},
{
"client_id": "561491513972-7n9e3ghnvhpl46rhjoli519nqhagpno7.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "b0cfa3be977391d2e80e6d59322526e914f0dfe9"
}
},
{
"client_id": "561491513972-aj7ckoun4clp072av4l9r4rfp7v1gn1b.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "9c9c178e67fb7f71894a6b50d2f2aabd7f20a709"
}
},
{
"client_id": "561491513972-f4k38tpq6fk04l2ecjd2bjbmh7bqkm1g.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "2a3a4050ac6100d36d659252ccef90bf4b5f4f3b"
}
},
{
"client_id": "561491513972-hbmshtmtgi5g3lc6fgniotmep9dtlmds.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "787fa849c358a3c71bd29728060994c78ac7270c"
}
},
{
"client_id": "561491513972-kou0jpcvgf48pho4i0k6kd940p3o2j33.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "3b7e2245d65353e73f291c7404b034d421a35ca1"
}
},
{
"client_id": "561491513972-mv30tqashuei89gkq0m96mutvr9vgjqu.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "7cf32302ad942f387345e67775e2ed688388bb18"
}
},
{
"client_id": "561491513972-uk2ds1qgtmofmem93r8is1ss5s8q5160.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "390cdeefb85bc56147b8cc7429f07146a72b2dce"
}
},
{
"client_id": "561491513972-uukbg0habltgui1ukqan6eum7v9m5baj.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "9051bf2a57bc75ef20e05c5897115717eeba6b1b"
}
},
{
"client_id": "561491513972-v5k6da9dftep808qa6k51hc246uao7vg.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.paymong",
"certificate_hash": "51de0a1075fa0f83ce1987998dd133b350f84e21"
}
},
{
"client_id": "561491513972-b5qe05f4k7bnb6ca5hns00470cvbmkak.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCnWfhJ96NJCgA5-ASnQOW2yNMW1KpU2Ro"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "561491513972-b5qe05f4k7bnb6ca5hns00470cvbmkak.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:561491513972:android:4e05bf231c39ba7cec7721",
"android_client_info": {
"package_name": "com.paymong.wear"
}
},
"oauth_client": [
{
"client_id": "561491513972-b5qe05f4k7bnb6ca5hns00470cvbmkak.apps.googleusercontent.com",
"client_id": "47490513860-lmo501flnou72fc7q5kq0ajfii6dpieb.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCnWfhJ96NJCgA5-ASnQOW2yNMW1KpU2Ro"
"current_key": "AIzaSyCFbI7ATEWiR-WNoJcIrp78ECvHS8I0N9Q"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "561491513972-b5qe05f4k7bnb6ca5hns00470cvbmkak.apps.googleusercontent.com",
"client_id": "47490513860-lmo501flnou72fc7q5kq0ajfii6dpieb.apps.googleusercontent.com",
"client_type": 3
}
]
Expand Down
Empty file added app/proguard-rules.pro
Empty file.
21 changes: 15 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paymong.wear">
xmlns:tools="http://schemas.android.com/tools"
package="com.mongs.wear">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>-->
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />-->
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />-->
<uses-feature android:name="android.hardware.type.watch" />

<application
android:enableOnBackInvokedCallback="true"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:name=".MainApplication"
android:name="com.mongs.wear.MainApplication"
android:theme="@android:style/Theme.DeviceDefault"
android:usesCleartextTraffic="true">
android:usesCleartextTraffic="true"
tools:targetApi="tiramisu">
<uses-library android:name="com.google.android.wearable" android:required="true" />
<meta-data android:name="com.google.android.wearable.standalone" android:value="true" />

<service android:name="org.eclipse.paho.android.service.MqttService" />
<activity
android:name=".MainActivity"
android:name="com.mongs.wear.MainActivity"
android:exported="true"
android:theme="@android:style/Theme.DeviceDefault">
android:theme="@android:style/Theme.DeviceDefault"
android:taskAffinity="">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

</manifest>
84 changes: 84 additions & 0 deletions app/src/main/java/com/mongs/wear/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package com.mongs.wear

import android.Manifest
import android.content.Context
import android.content.pm.PackageManager
import android.hardware.SensorManager
import android.net.ConnectivityManager
import android.net.NetworkCapabilities
import android.os.Bundle
import android.os.SystemClock
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import com.mongs.wear.presentation.global.theme.MongsTheme
import com.mongs.wear.presentation.view.main.MainView
import com.mongs.wear.presentation.viewModel.main.MainViewModel
import dagger.hilt.android.AndroidEntryPoint
import java.time.LocalDateTime
import java.util.concurrent.TimeUnit


@AndroidEntryPoint
class MainActivity : ComponentActivity() {
private val mainViewModel: MainViewModel by viewModels()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

if (
// ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED ||
// ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED ||
ContextCompat.checkSelfPermission(this, Manifest.permission.ACTIVITY_RECOGNITION) != PackageManager.PERMISSION_GRANTED
) {
val permissions = arrayOf(
// Manifest.permission.ACCESS_FINE_LOCATION,
// Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACTIVITY_RECOGNITION,
)
ActivityCompat.requestPermissions(this, permissions, 100)
}

val nowUpTime = LocalDateTime.now().minusSeconds(TimeUnit.MILLISECONDS.toSeconds(SystemClock.uptimeMillis()))
mainViewModel.init(
buildVersion = BuildConfig.VERSION_NAME,
isNetworkAvailable = isNetworkAvailable(this.applicationContext),
nowUpTime = nowUpTime
)

setContent {
MongsTheme {
MainView(
closeApp = { this.finish() }
)
}
}
}

override fun onResume() {
super.onResume()
mainViewModel.connectSensor(sensorManager = application.getSystemService(Context.SENSOR_SERVICE) as SensorManager)
mainViewModel.reconnectMqttEvent()
}

override fun onPause() {
super.onPause()
mainViewModel.disconnectSensor()
mainViewModel.pauseConnectMqttEvent()
}

override fun onDestroy() {
super.onDestroy()
mainViewModel.disconnectMqttEvent()
mainViewModel.disconnectMqttBattle()
}

private fun isNetworkAvailable(context: Context): Boolean {
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val network = connectivityManager.activeNetwork ?: return false
val networkCapabilities = connectivityManager.getNetworkCapabilities(network) ?: return false
return networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.paymong.wear
package com.mongs.wear

import android.app.Application
import dagger.hilt.android.HiltAndroidApp
Expand Down
Loading

0 comments on commit 1054f10

Please sign in to comment.