-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 전체 프로젝트 구조 변경 - 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
1 parent
297165e
commit 1054f10
Showing
774 changed files
with
22,261 additions
and
5,650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
*.iml | ||
.gradle | ||
/local.properties | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../java/com/paymong/wear/MainApplication.kt → ...in/java/com/mongs/wear/MainApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.