diff --git a/.DS_Store b/.DS_Store index 8897a387..124ac2bc 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 24cfa792..65904229 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,5 @@ lint/generated/ lint/outputs/ lint/tmp/ # lint/reports/ + +.DS_Store \ No newline at end of file diff --git a/app/.DS_Store b/app/.DS_Store index 6bccae5c..dc92dc9d 100644 Binary files a/app/.DS_Store and b/app/.DS_Store differ diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 00000000..0eee6f00 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,133 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'kotlin-parcelize' + id 'com.google.gms.google-services' + id 'com.google.firebase.crashlytics' + id 'kotlin-android' + id 'kotlin-kapt' + id 'dagger.hilt.android.plugin' +} + + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + + +android { + namespace 'com.eatssu.android' + compileSdk 34 + + defaultConfig { + applicationId "com.eatssu.android" + minSdk 23 + targetSdk 34 + versionCode 16 + versionName "1.1.14" + + + buildConfigField("String", "KAKAO_NATIVE_APP_KEY", "\"${properties.get('KAKAO_NATIVE_APP_KEY')}\"") + manifestPlaceholders = [KAKAO_NATIVE_APP_KEY: properties.get('KAKAO_NATIVE_APP_KEY')] + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + viewBinding = true + dataBinding = true + } + + buildTypes { + debug { + buildConfigField("String", "BASE_URL", properties["DEV_BASE_URL"]) + } + release { + buildConfigField("String", "BASE_URL", properties["PROD_BASE_URL"]) + + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = '17' + } + splits { + abi { + enable true + reset() + universalApk true + } + } + lint{ + abortOnError = false + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.8.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.jakewharton.threetenabp:threetenabp:1.4.4' + implementation 'com.prolificinteractive:material-calendarview:1.4.3' + implementation 'androidx.recyclerview:recyclerview:1.3.2' + implementation 'com.google.android.datatransport:transport-runtime:3.1.2' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + implementation 'androidx.activity:activity-ktx:1.8.2' + implementation 'androidx.fragment:fragment-ktx:1.6.2' + annotationProcessor 'com.android.databinding:compiler:3.1.4' + + //retrofit2 - 서버통신 + implementation 'com.squareup.retrofit2:retrofit:2.9.0' + implementation 'com.squareup.retrofit2:converter-gson:2.9.0' + implementation 'com.google.code.gson:gson:2.10.1' // Gson + + //OkHttp: 통신 로그 확인하기 위함 + implementation 'com.squareup.okhttp3:okhttp:4.12.0' //포스팅 당시 4.9.0 버전 기준 + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + + //glide - 사진 업로드 + implementation 'com.github.bumptech.glide:glide:4.15.1' + annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' + + //이미지 압축 + implementation 'id.zelory:compressor:3.0.1' + + //coroutines + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' + implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.7.0" + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3' + + // 카카오 로그인 모듈 + implementation "com.kakao.sdk:v2-user:2.8.6" // 카카오 로그인 + + //hilt + implementation 'com.google.dagger:hilt-android:2.50' + kapt "com.google.dagger:hilt-android-compiler:2.50" + annotationProcessor 'com.google.dagger:hilt-compiler:2.50' + + // viewmodel과 livedata + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0" + implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.7.0" + + //firebase + implementation 'com.google.android.gms:play-services-base:18.0.1' + implementation 'com.google.firebase:firebase-config-ktx:21.4.1' + implementation platform('com.google.firebase:firebase-bom:32.2.2') + implementation 'com.google.firebase:firebase-analytics-ktx' + implementation 'com.google.firebase:firebase-crashlytics' + + //Timer + implementation "com.jakewharton.timber:timber:5.0.1" +} + +kapt { + correctErrorTypes true +} diff --git a/app/src/.DS_Store b/app/src/.DS_Store new file mode 100644 index 00000000..c8e96414 Binary files /dev/null and b/app/src/.DS_Store differ diff --git a/app/src/main/.DS_Store b/app/src/main/.DS_Store new file mode 100644 index 00000000..614a7a92 Binary files /dev/null and b/app/src/main/.DS_Store differ diff --git a/app/src/main/java/.DS_Store b/app/src/main/java/.DS_Store new file mode 100644 index 00000000..c5d57858 Binary files /dev/null and b/app/src/main/java/.DS_Store differ diff --git a/app/src/main/java/com/.DS_Store b/app/src/main/java/com/.DS_Store new file mode 100644 index 00000000..8d4f572f Binary files /dev/null and b/app/src/main/java/com/.DS_Store differ diff --git a/app/src/main/java/com/eatssu/android/data/model/RestaurantInfo.kt b/app/src/main/java/com/eatssu/android/data/model/RestaurantInfo.kt index bf2cbff8..401315d2 100644 --- a/app/src/main/java/com/eatssu/android/data/model/RestaurantInfo.kt +++ b/app/src/main/java/com/eatssu/android/data/model/RestaurantInfo.kt @@ -1,6 +1,9 @@ package com.eatssu.android.data.model +import com.eatssu.android.data.enums.Restaurant + data class RestaurantInfo( + val enum: Restaurant, val name: String, val location: String, val time: String, diff --git a/app/src/main/java/com/eatssu/android/data/repository/FirebaseRemoteConfigRepository.kt b/app/src/main/java/com/eatssu/android/data/repository/FirebaseRemoteConfigRepository.kt index f1b6a054..c21903b7 100644 --- a/app/src/main/java/com/eatssu/android/data/repository/FirebaseRemoteConfigRepository.kt +++ b/app/src/main/java/com/eatssu/android/data/repository/FirebaseRemoteConfigRepository.kt @@ -1,6 +1,7 @@ package com.eatssu.android.data.repository import com.eatssu.android.R +import com.eatssu.android.data.enums.Restaurant import com.eatssu.android.data.model.AndroidMessage import com.eatssu.android.data.model.RestaurantInfo import com.google.firebase.remoteconfig.FirebaseRemoteConfig @@ -65,7 +66,7 @@ class FirebaseRemoteConfigRepository { } fun getCafeteriaInfo(): ArrayList { - return parsingJson(instance.getString("cafeteria_info")) + return parsingJson(instance.getString("restraunt_info")) } private fun parsingJson(json: String): ArrayList { @@ -75,12 +76,14 @@ class FirebaseRemoteConfigRepository { for (index in 0 until jsonArray.length()) { val jsonObject = jsonArray.getJSONObject(index) + val enumString = jsonObject.optString("enum", "") + val enumValue = enumValues().find { it.name == enumString } ?: Restaurant.HAKSIK val name = jsonObject.optString("name", "") val location = jsonObject.optString("location", "") val time = jsonObject.optString("time", "") val etc = jsonObject.optString("etc", "") - val restaurantInfo = RestaurantInfo(name, location, time, etc) + val restaurantInfo = RestaurantInfo(enumValue, name, location, time, etc) Timber.d(restaurantInfo.toString()) list.add(restaurantInfo) } diff --git a/app/src/main/java/com/eatssu/android/ui/info/InfoViewModel.kt b/app/src/main/java/com/eatssu/android/ui/info/InfoViewModel.kt index e80b52ab..ba8ae8c3 100644 --- a/app/src/main/java/com/eatssu/android/ui/info/InfoViewModel.kt +++ b/app/src/main/java/com/eatssu/android/ui/info/InfoViewModel.kt @@ -3,6 +3,7 @@ package com.eatssu.android.ui.info import android.util.Log import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel +import com.eatssu.android.data.enums.Restaurant import com.eatssu.android.data.model.RestaurantInfo import com.eatssu.android.data.repository.FirebaseRemoteConfigRepository @@ -34,28 +35,28 @@ class InfoViewModel(firebaseRemoteConfigRepository: FirebaseRemoteConfigReposito infoList.value = firebaseRemoteConfigRepository.getCafeteriaInfo() Log.d("InfoViewModel",infoList.value.toString()) - val dodam = infoList.value!!.find { it.name == "숭실도담" } + val dodam = infoList.value!!.find { it.enum == Restaurant.DODAM } dodamTime.value = dodam?.time ?: "" dodamLocation.value = dodam?.location ?: "" dodamEtc.value = dodam?.etc ?: "" - val food = infoList.value!!.find { it.name == "FOOD COURT" } + val food = infoList.value!!.find { it.enum == Restaurant.FOOD_COURT } foodTime.value = food?.time ?: "" foodLocation.value = food?.location ?: "" foodEtc.value = food?.etc ?: "" - val dormitory = infoList.value!!.find { it.name == "기숙사 식당" } + val dormitory = infoList.value!!.find { it.enum == Restaurant.DORMITORY } dormitoryTime.value = dormitory?.time ?: "" dormitoryLocation.value = dormitory?.location ?: "" dormitoryEtc.value = dormitory?.etc ?: "" - val snack = infoList.value!!.find { it.name == "스낵코너" } + val snack = infoList.value!!.find { it.enum == Restaurant.SNACK_CORNER } snackTime.value = snack?.time ?: "" snackLocation.value = snack?.location ?: "" snackEtc.value = snack?.etc ?: "" - val haksik = infoList.value!!.find { it.name == "학생식당" } - haksikTime.value = haksik?.time ?: "tlqof" + val haksik = infoList.value!!.find { it.enum == Restaurant.HAKSIK } + haksikTime.value = haksik?.time ?: "" haksikLocation.value = haksik?.location ?: "" haksikEtc.value = haksik?.etc ?: "" } diff --git a/app/src/main/res/xml/firebase_remote_config.xml b/app/src/main/res/xml/firebase_remote_config.xml index fdcf13b9..bfae4308 100644 --- a/app/src/main/res/xml/firebase_remote_config.xml +++ b/app/src/main/res/xml/firebase_remote_config.xml @@ -4,52 +4,65 @@ force_update_required false + android_version_code 1 + latest_app_version 1.0.0 + - cafeteria_info - { - "name": "숭실도담", + restraunt_info + + { + "enum": "DODAM", + "name": "도담 식당", "location": "신양관 2층", - "time": "11:20~14:00\n17:00~18:30", - "etc": "대면 배식+웰빙코너\n토요일 11:30~13:30" + "time": "11:20~14:00(점심)\n17:00~18:30(저녁)", + "etc": "2개 코너 운영\n대면 배식,웰빙코너\n토요일 11:30~13:30" }, { - "name": "학생식당", + "enum": "HAKSIK", + "name": "학생 식당", "location": "학생회관 3층", - "time": "11:20~16:00\n(식사 14:00 마감)", + "time": "08:10~09:20(천원의 아침밥, 100개 한정, + 24.03.11~06.14)\n11:20~14:00\n(점심)\n14:00~17:00(공간 개방)", "etc": "3개 코너 운영\n뚝배기찌개, 덮밥, 양식" }, { - "name": "스낵코너", + "enum": "SNACK_CORNER", + "name": "스낵 코너", "location": "학생회관 3층", "time": "11:00~16:00", - "etc": "분식류, 옛날도시락, 컵밥 등" + "etc": "분식류, 옛날도시락, 컵밥 등. 주말 휴무" }, { - "name": "FOOD COURT", + "enum": "FOOD_COURT", + "name": "푸드 코트", "location": "학생회관 2층", - "time": "11:30~16:00", - "etc": "아시안푸드, 돈까스, 샐러드, 국밥 등 + 카페" + "time": "휴무", + "etc": "준비 중" }, { + "enum": "DORMITORY", "name": "기숙사 식당", "location": "레지던스홀 지하 1층", "time": "08:00~09:30\n11:00~14:00\n17:00~18:30", "etc": "주말 조식은 운영되지 않습니다." } - ] + android_message - {"dialog":false,"message":"지금은 서버 점검 중입니다. "} + { + "dialog":false, + "message":"지금은 서버 점검 중입니다. " + }