Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions .github/workflows/android_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ jobs:
run: |
echo '${{ secrets.GOOGLE_SERVICES }}' > app/google-services.json;

- name: Decode Keystore
run: |
mkdir -p keystore
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > keystore/onmi

- name: Create local.properties
run: |
cat > local.properties <<EOF
STORE_FILE=keystore/onmi
STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}
KEY_ALIAS=${{ secrets.KEY_ALIAS }}
KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}
EOF

- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand Down
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.

29 changes: 29 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 keyProperties = 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,28 @@ android {
versionName = "1.7.0"
}

signingConfigs {
create("release") {
storeFile = rootProject.file(keyProperties.getProperty("STORE_FILE"))
storePassword = keyProperties.getProperty("STORE_PASSWORD")
keyAlias = keyProperties.getProperty("KEY_ALIAS")
keyPassword = keyProperties.getProperty("KEY_PASSWORD")
}
}

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 = signingConfigs.getByName("release")
}
}

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
1 change: 0 additions & 1 deletion feature/root/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.OnmiAndroid">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
65 changes: 57 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,58 @@ 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(1f)
)
}
}
}
}
}
}
}

private val DebugRibbonBackgroundColor = Color(0xCCD32F2F)

@Composable
private fun DebugRibbon(modifier: Modifier = Modifier) {
Box(
modifier = modifier
.fillMaxWidth()
.background(DebugRibbonBackgroundColor)
.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