Skip to content
14 changes: 1 addition & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/vcs.xml
/.idea/deploymentTargetDropDown.xml
/.idea/gradle.xml
/.idea/misc.xml
/.idea/inspectionProfiles/Project_Default.xml
/.idea/DtonatorPreferences.xml
/.idea/compiler.xml
.idea/
/keystore
/app/release
.DS_Store
Expand Down
9 changes: 0 additions & 9 deletions .idea/.gitignore

This file was deleted.

36 changes: 36 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import java.util.Properties

plugins {
id("khs.onmi.application")
id("khs.onmi.hilt")
id("com.google.gms.google-services")
}

val localProperties = Properties().apply {
val file = rootProject.file("local.properties")
if (file.exists()) file.inputStream().use { load(it) }
}

android {
namespace = "khs.onmi.aos"

Expand All @@ -12,6 +19,35 @@ android {
versionName = "1.7.0"
}

signingConfigs {
create("release") {
val storeFilePath = localProperties.getProperty("STORE_FILE")
if (storeFilePath != null) {
storeFile = rootProject.file(storeFilePath)
storePassword = localProperties.getProperty("STORE_PASSWORD")
keyAlias = localProperties.getProperty("KEY_ALIAS")
keyPassword = localProperties.getProperty("KEY_PASSWORD")
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
}

buildTypes {
debug {
applicationIdSuffix = ".dev"
buildConfigField("String", "AMPLITUDE_API_KEY", "\"dev_placeholder\"")
resValue("string", "app_name", "오늘 뭐임 (Dev)")
}
release {
buildConfigField("String", "AMPLITUDE_API_KEY", "\"prod_placeholder\"")
resValue("string", "app_name", "오늘 뭐임")
signingConfig = if (localProperties.getProperty("STORE_FILE") != null) {
signingConfigs.getByName("release")
} else {
signingConfigs.getByName("debug")
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Comment thread
khs3994 marked this conversation as resolved.
Outdated
}
}

packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<resources>
<string name="app_name">오늘 뭐임</string>
</resources>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {

extensions.configure<ApplicationExtension> {
configureKotlinAndroid(this)

buildFeatures {
buildConfig = true
}

defaultConfig {
applicationId = "com.onmi.aos"
minSdk = 24
Expand Down
63 changes: 55 additions & 8 deletions feature/root/src/main/java/khs/onmi/root/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
package khs.onmi.root

import android.content.pm.ApplicationInfo
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
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.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.zIndex
import androidx.core.view.WindowCompat
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.rememberNavController
Expand All @@ -25,25 +41,56 @@ class MainActivity : ComponentActivity() {

WindowCompat.setDecorFitsSystemWindows(window, false)

val isDebuggable = applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0

viewModel.checkUserAlreadyEnteredInfo { isEntered ->
setContent {
ONMITheme { color, _ ->
val navController = rememberNavController()

NavHost(
navController = navController,
startDestination = if (isEntered) ONMINavRoutes.MAIN else ONMINavRoutes.ENTERINFOMATION
) {
enterInformationNavGraph(navController = navController)
Box(modifier = Modifier.fillMaxSize()) {
NavHost(
navController = navController,
startDestination = if (isEntered) ONMINavRoutes.MAIN else ONMINavRoutes.ENTERINFOMATION
) {
enterInformationNavGraph(navController = navController)

mainNavGraph(navController = navController)

mainNavGraph(navController = navController)
settingNavGraph(navController = navController)

settingNavGraph(navController = navController)
allergiesNavGraph(navController = navController)
}

allergiesNavGraph(navController = navController)
if (isDebuggable) {
DebugRibbon(
modifier = Modifier
.align(Alignment.TopCenter)
.zIndex(Float.MAX_VALUE)
Comment thread
khs3994 marked this conversation as resolved.
Outdated
)
}
}
}
}
}
}
}

@Composable
private fun DebugRibbon(modifier: Modifier = Modifier) {
Box(
modifier = modifier
.fillMaxWidth()
.background(Color(0xCCD32F2F))
Comment thread
khs3994 marked this conversation as resolved.
Outdated
.statusBarsPadding()
.padding(vertical = 2.dp),
contentAlignment = Alignment.Center
) {
Text(
text = "DEBUG",
color = Color.White,
fontSize = 10.sp,
fontWeight = FontWeight.Bold
)
}
}
1 change: 0 additions & 1 deletion feature/root/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<resources>
<string name="title_activity_main">MainActivity</string>
<string name="app_name">오늘 뭐임 - 오늘 급식과 시간표를 한눈에</string>
</resources>
Loading