-
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.
๐ :: (#47) ์๋ฆผ ํ์ด์ง ํผ๋ธ๋ฆฌ์ฑ
๐ :: (#47) ์๋ฆผ ํ์ด์ง ํผ๋ธ๋ฆฌ์ฑ
- Loading branch information
Showing
18 changed files
with
211 additions
and
15 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
7 changes: 5 additions & 2 deletions
7
app/src/main/java/team/retum/jobisandroidv2/navigation/MainNavigation.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
package team.retum.jobisandroidv2.navigation | ||
|
||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavHostController | ||
import androidx.navigation.navigation | ||
import team.retum.alarm.navigation.alarm | ||
import team.retum.jobisandroidv2.root.NAVIGATION_ROOT | ||
import team.retum.jobisandroidv2.root.root | ||
|
||
const val NAVIGATION_MAIN = "main" | ||
|
||
fun NavGraphBuilder.mainNavigation() { | ||
fun NavGraphBuilder.mainNavigation(navHostController: NavHostController) { | ||
navigation( | ||
route = NAVIGATION_MAIN, | ||
startDestination = NAVIGATION_ROOT, | ||
) { | ||
root() | ||
root(navHostController = navHostController) | ||
alarm(onBackPressed = navHostController::popBackStack) | ||
} | ||
} |
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
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
Binary file not shown.
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 @@ | ||
/build |
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,20 @@ | ||
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed | ||
plugins { | ||
id(libs.plugins.android.library.get().pluginId) | ||
id(libs.plugins.kotlin.android.get().pluginId) | ||
id(libs.plugins.hilt.android.get().pluginId) | ||
id(libs.plugins.kotlin.kapt.get().pluginId) | ||
} | ||
|
||
apply<CommonGradlePlugin>() | ||
apply<ComposeGradlePlugin>() | ||
|
||
android { | ||
namespace = "team.retum.alarm" | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(project(":core:common")) | ||
implementation(project(":core:domain")) | ||
} |
22 changes: 22 additions & 0 deletions
22
feature/alarm/src/androidTest/java/team/retum/alarm/ExampleInstrumentedTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package team.retum.alarm | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import junit.framework.TestCase.assertEquals | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("team.retum.alarm.test", appContext.packageName) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
feature/alarm/src/main/java/team/retum/alarm/navigation/AlarmNavigation.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package team.retum.alarm.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
import team.retum.alarm.ui.Alarm | ||
|
||
const val NAVIGATION_ALARM = "alarm" | ||
|
||
fun NavGraphBuilder.alarm(onBackPressed: () -> Unit) { | ||
composable(NAVIGATION_ALARM) { | ||
Alarm(onBackPressed = onBackPressed) | ||
} | ||
} | ||
|
||
fun NavController.navigateToAlarm() { | ||
navigate(NAVIGATION_ALARM) | ||
} |
99 changes: 99 additions & 0 deletions
99
feature/alarm/src/main/java/team/retum/alarm/ui/AlarmScreen.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package team.retum.alarm.ui | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxHeight | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.rememberScrollState | ||
import androidx.compose.foundation.verticalScroll | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import team.retum.alarm.R | ||
import team.returm.jobisdesignsystemv2.appbar.JobisSmallTopAppBar | ||
import team.returm.jobisdesignsystemv2.foundation.JobisTheme | ||
import team.returm.jobisdesignsystemv2.foundation.JobisTypography | ||
|
||
// TODO ์๋ฒ ์ฐ๋ ์ ์ ๊ฑฐ | ||
private data class AlarmData( | ||
val companyName: String, | ||
val content: String, | ||
val date: String, | ||
) | ||
|
||
@Composable | ||
internal fun Alarm( | ||
onBackPressed: () -> Unit, | ||
) { | ||
val alarmList = emptyList<AlarmData>() | ||
AlarmScreen( | ||
onBackPressed = onBackPressed, | ||
alarmList = alarmList, | ||
) | ||
} | ||
|
||
@Composable | ||
private fun AlarmScreen( | ||
onBackPressed: () -> Unit, | ||
alarmList: List<AlarmData>, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(JobisTheme.colors.background) | ||
.padding(horizontal = 24.dp), | ||
) { | ||
JobisSmallTopAppBar( | ||
title = stringResource(id = R.string.alarm), | ||
onBackPressed = onBackPressed, | ||
) | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.verticalScroll(rememberScrollState()), | ||
) { | ||
alarmList.forEach { | ||
AlarmContent( | ||
companyName = it.companyName, | ||
content = it.content, | ||
date = it.date, | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
fun AlarmContent( | ||
companyName: String, | ||
content: String, | ||
date: String, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxHeight(0.14f) | ||
.padding(vertical = 16.dp), | ||
) { | ||
Text( | ||
text = companyName, | ||
style = JobisTypography.Description, | ||
color = JobisTheme.colors.onPrimary, | ||
) | ||
Text( | ||
text = content, | ||
style = JobisTypography.HeadLine, | ||
color = JobisTheme.colors.onBackground, | ||
) | ||
Spacer(modifier = Modifier.height(4.dp)) | ||
Text( | ||
text = date, | ||
style = JobisTypography.Description, | ||
color = JobisTheme.colors.onSurfaceVariant, | ||
) | ||
} | ||
} |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="alarm">์๋ฆผ</string> | ||
</resources> |
16 changes: 16 additions & 0 deletions
16
feature/alarm/src/test/java/team/retum/alarm/ExampleUnitTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package team.retum.alarm | ||
|
||
import junit.framework.TestCase.assertEquals | ||
import org.junit.Test | ||
|
||
/** | ||
* Example local unit test, which will execute on the development machine (host). | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
class ExampleUnitTest { | ||
@Test | ||
fun addition_isCorrect() { | ||
assertEquals(4, 2 + 2) | ||
} | ||
} |
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
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
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