Skip to content

Commit

Permalink
Release/v1.3.0
Browse files Browse the repository at this point in the history
Release/v1.3.0
  • Loading branch information
JunJaBoy authored Apr 20, 2024
2 parents 2d942c3 + 4c57abc commit 052a417
Show file tree
Hide file tree
Showing 81 changed files with 3,155 additions and 1,216 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ DMS는 기숙사를 위한 편의 시스템을 목표로 하고 있기 때문에
</br>
</br>

# Project structure
![image](https://github.com/team-aliens/DMS-Android/assets/101160207/f53fd04e-d29f-41d2-9cf3-60f16645ab4b)

# Contributors

</br>
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()

versionCode = 8
versionName = "v1.2.2"
versionCode = 11
versionName = "v1.3.2"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
59 changes: 15 additions & 44 deletions app/src/main/java/team/aliens/dms/android/app/DmsApp.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
package team.aliens.dms.android.app

import androidx.compose.animation.AnimatedContentTransitionScope
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeOut
import androidx.compose.material3.windowsizeclass.WindowSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand All @@ -14,23 +9,18 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavDestination
import androidx.navigation.NavDestination.Companion.hierarchy
import androidx.window.layout.DisplayFeature
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
import com.ramcosta.composedestinations.DestinationsNavHost
import com.ramcosta.composedestinations.animations.defaults.NestedNavGraphDefaultAnimations
import com.ramcosta.composedestinations.animations.defaults.RootNavGraphDefaultAnimations
import com.ramcosta.composedestinations.animations.rememberAnimatedNavHostEngine
import com.ramcosta.composedestinations.navigation.dependency
import com.ramcosta.composedestinations.scope.DestinationScopeWithNoDependencies
import com.ramcosta.composedestinations.spec.NavGraphSpec
import com.ramcosta.composedestinations.spec.NavHostEngine
import kotlinx.coroutines.flow.StateFlow
import team.aliens.dms.android.app.navigation.DmsNavGraph
import team.aliens.dms.android.app.navigation.DmsNavigator
import team.aliens.dms.android.app.navigation.authorized.AuthorizedNavGraph
import team.aliens.dms.android.app.navigation.unauthorized.UnauthorizedNavGraph
import team.aliens.dms.android.feature.destinations.TermsScreenDestination
import team.aliens.dms.android.feature.editpassword.EditPasswordViewModel
import team.aliens.dms.android.feature.editpassword.navigation.EditPasswordNavGraph
import team.aliens.dms.android.feature.outing.OutingViewModel
import team.aliens.dms.android.feature.outing.navigation.OutingNavGraph
import team.aliens.dms.android.feature.signup.SignUpViewModel
import team.aliens.dms.android.feature.signup.TermsUrl
import team.aliens.dms.android.feature.signup.navigation.SignUpNavGraph
Expand All @@ -40,16 +30,14 @@ import team.aliens.dms.android.network.BuildConfig
fun DmsApp(
windowSizeClass: WindowSizeClass,
displayFeatures: List<DisplayFeature>,
engine: NavHostEngine = rememberDmsNavHostEngine(),
isJwtAvailable: StateFlow<Boolean>,
appState: DmsAppState = rememberDmsAppState(
navController = engine.rememberNavController(),
isJwtAvailable = isJwtAvailable,
),
) {
val autoSignIn by appState.isJwtAvailable.collectAsStateWithLifecycle()
DestinationsNavHost(
engine = engine,
engine = appState.engine,
navGraph = DmsNavGraph.root(autoSignIn = autoSignIn),
navController = appState.navController,
dependenciesContainerBuilder = {
Expand All @@ -70,39 +58,22 @@ fun DmsApp(
}
hiltViewModel<EditPasswordViewModel>(parentEntry)
}

dependency(OutingNavGraph) {
val parentEntry = remember(navBackStackEntry) {
navController.getBackStackEntry(OutingNavGraph.route)
}
hiltViewModel<OutingViewModel>(parentEntry)
}
dependency(OutingNavGraph) {
val parentEntry = remember(navBackStackEntry) {
navController.getBackStackEntry(OutingNavGraph.route)
}
}
},
)
}

@OptIn(ExperimentalMaterialNavigationApi::class, ExperimentalAnimationApi::class)
@Composable
private fun rememberDmsNavHostEngine() = rememberAnimatedNavHostEngine(
rootDefaultAnimations = RootNavGraphDefaultAnimations.ACCOMPANIST_FADING,
defaultAnimationsForNestedNavGraph = mapOf(
AuthorizedNavGraph to NestedNavGraphDefaultAnimations(
enterTransition = { slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Start) },
exitTransition = { fadeOut(tween(delayMillis = 10)) },
popEnterTransition = { EnterTransition.None },
popExitTransition = {
slideOutOfContainer(
towards = AnimatedContentTransitionScope.SlideDirection.End,
animationSpec = tween(delayMillis = 10),
)
},
), UnauthorizedNavGraph to NestedNavGraphDefaultAnimations(
enterTransition = { slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Start) },
exitTransition = { fadeOut(tween(delayMillis = 10)) },
popEnterTransition = { EnterTransition.None },
popExitTransition = {
slideOutOfContainer(
towards = AnimatedContentTransitionScope.SlideDirection.End,
animationSpec = tween(delayMillis = 10),
)
},
)
),
)

private fun DestinationScopeWithNoDependencies<*>.currentNavigator(autoSignIn: Boolean): DmsNavigator =
DmsNavigator(
navGraph = navBackStackEntry.destination.navGraph(autoSignIn),
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/team/aliens/dms/android/app/DmsAppState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ fun rememberDmsAppState(
context: Context = LocalContext.current,
) = remember(navController, context) {
DmsAppState(
engine = engine,
navController = navController,
isJwtAvailable = isJwtAvailable,
context = context,
)
}

class DmsAppState(
val engine: NavHostEngine,
val navController: NavHostController,
val isJwtAvailable: StateFlow<Boolean>,
private val context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import team.aliens.dms.android.app.navigation.authorized.AuthorizedNavGraph
import team.aliens.dms.android.app.navigation.authorized.AuthorizedNavigator
import team.aliens.dms.android.app.navigation.unauthorized.UnauthorizedNavGraph
import team.aliens.dms.android.app.navigation.unauthorized.UnauthorizedNavigator
import team.aliens.dms.android.data.point.model.PointType
import team.aliens.dms.android.feature.destinations.EditPasswordSetPasswordScreenDestination
import team.aliens.dms.android.feature.destinations.EditProfileImageScreenDestination
import team.aliens.dms.android.feature.destinations.EnterEmailScreenDestination
Expand All @@ -21,6 +22,7 @@ import team.aliens.dms.android.feature.destinations.FindIdScreenDestination
import team.aliens.dms.android.feature.destinations.MainDestination
import team.aliens.dms.android.feature.destinations.NoticeDetailsScreenDestination
import team.aliens.dms.android.feature.destinations.NotificationBoxScreenDestination
import team.aliens.dms.android.feature.destinations.OutingApplicationScreenDestination
import team.aliens.dms.android.feature.destinations.PointHistoryScreenDestination
import team.aliens.dms.android.feature.destinations.RemainsApplicationScreenDestination
import team.aliens.dms.android.feature.destinations.ResetPasswordEnterEmailVerificationCodeScreenDestination
Expand All @@ -34,6 +36,7 @@ import team.aliens.dms.android.feature.destinations.StudyRoomDetailsScreenDestin
import team.aliens.dms.android.feature.destinations.StudyRoomListScreenDestination
import team.aliens.dms.android.feature.destinations.TermsScreenDestination
import team.aliens.dms.android.feature.editpassword.navigation.EditPasswordNavGraph
import team.aliens.dms.android.feature.outing.navigation.OutingNavGraph
import team.aliens.dms.android.feature.resetpassword.navigation.ResetPasswordNavGraph
import team.aliens.dms.android.feature.signup.navigation.SignUpNavGraph
import java.util.UUID
Expand Down Expand Up @@ -69,8 +72,8 @@ class DmsNavigator(
navController.navigateSingleTop(EditProfileImageScreenDestination() within AuthorizedNavGraph)
}

override fun openPointHistory() {
navController.navigateSingleTop(PointHistoryScreenDestination within navGraph)
override fun openPointHistory(pointType: PointType) {
navController.navigateSingleTop(PointHistoryScreenDestination(pointType) within navGraph)
}

override fun openEditPasswordNav() {
Expand All @@ -81,6 +84,12 @@ class DmsNavigator(
navController.navigateSingleTop(NoticeDetailsScreenDestination(noticeId) within navGraph)
}

override fun openOutingNav() {
navController.navigateSingleTop(OutingNavGraph) {
restoreState = true
}
}

override fun openEditPasswordSetPassword(currentPassword: String) {
navController.navigateSingleTop(EditPasswordSetPasswordScreenDestination within EditPasswordNavGraph)
}
Expand All @@ -104,11 +113,11 @@ class DmsNavigator(
}

override fun openResetPasswordEnterEmailVerificationCode() {
navController.navigateSingleTop(ResetPasswordEnterEmailVerificationCodeScreenDestination within navGraph)
navController.navigateSingleTop(ResetPasswordEnterEmailVerificationCodeScreenDestination within ResetPasswordNavGraph)
}

override fun openResetPasswordSetPassword() {
navController.navigateSingleTop(ResetPasswordSetPasswordScreenDestination within navGraph)
navController.navigateSingleTop(ResetPasswordSetPasswordScreenDestination within ResetPasswordNavGraph)
}

override fun openAuthorizedNav() {
Expand Down Expand Up @@ -217,6 +226,10 @@ class DmsNavigator(
) within navGraph,
)
}

override fun openOutingApplication() {
navController.navigateSingleTop(OutingApplicationScreenDestination within OutingNavGraph)
}
}

private fun NavController.navigateSingleTop(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import team.aliens.dms.android.feature.destinations.RemainsApplicationScreenDest
import team.aliens.dms.android.feature.destinations.StudyRoomDetailsScreenDestination
import team.aliens.dms.android.feature.destinations.StudyRoomListScreenDestination
import team.aliens.dms.android.feature.editpassword.navigation.EditPasswordNavGraph
import team.aliens.dms.android.feature.outing.navigation.OutingNavGraph
import team.aliens.dms.android.feature.studyroom.navigation.StudyRoomNavGraph

object AuthorizedNavGraph : NavGraphSpec {
Expand All @@ -23,6 +24,7 @@ object AuthorizedNavGraph : NavGraphSpec {
listOf(
EditPasswordNavGraph,
StudyRoomNavGraph,
OutingNavGraph,
)

override val destinationsByRoute: Map<String, DestinationSpec<*>> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import team.aliens.dms.android.feature.editprofile.navigation.EditProfileNavigat
import team.aliens.dms.android.feature.main.navigation.MainNavigator
import team.aliens.dms.android.feature.notice.navigation.NoticeNavigator
import team.aliens.dms.android.feature.notification.navigation.NotificationNavigation
import team.aliens.dms.android.feature.outing.navigation.OutingNavigator
import team.aliens.dms.android.feature.point.navigation.PointHistoryNavigator
import team.aliens.dms.android.feature.remains.navigator.RemainsNavigator
import team.aliens.dms.android.feature.studyroom.navigation.StudyRoomNavigator
Expand All @@ -17,4 +18,5 @@ interface AuthorizedNavigator :
NotificationNavigation,
PointHistoryNavigator,
RemainsNavigator,
StudyRoomNavigator
StudyRoomNavigator,
OutingNavigator
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package team.aliens.dms.android.core.designsystem

object DmsIcon {
val Applicate = R.drawable.ic_applicate
val Back = R.drawable.ic_back
val Backward = R.drawable.ic_backward
val Bell = R.drawable.ic_bell
val BlueBreakfast = R.drawable.ic_blue_breakfast
val BlueDinner = R.drawable.ic_blue_dinner
val BlueLaunch = R.drawable.ic_blue_lunch
val Breakfast = R.drawable.ic_breakfast
val Calender = R.drawable.ic_calender
val Camera = R.drawable.ic_camera
val Check = R.drawable.ic_check
val Close = R.drawable.ic_close
val Dinner = R.drawable.ic_dinner
val Up = R.drawable.ic_up
val Down = R.drawable.ic_down
val Forward = R.drawable.ic_forward
val Home = R.drawable.ic_home
val Information = R.drawable.ic_information
val LogoDark = R.drawable.ic_logo_dark
val LogoLight = R.drawable.ic_logo_light
val Lunch = R.drawable.ic_lunch
val MyPage = R.drawable.ic_my_page
val Notice = R.drawable.ic_notice
val Palette = R.drawable.ic_palette
val PasswordInvisible = R.drawable.ic_password_invisible
val PasswordVisible = R.drawable.ic_password_visible
val Photo = R.drawable.ic_photo
val PhotoClose = R.drawable.ic_photo_close
val Plus = R.drawable.ic_plus
val Sort = R.drawable.ic_sort
val Visible = R.drawable.ic_visible
val Warning = R.drawable.ic_warning
val BlueNotice = R.drawable.ic_blue_notice
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,25 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

private val topFadeBrush: Brush
@Composable inline get() = Brush.verticalGradient(
@Composable
fun VerticallyFadedColumn(
modifier: Modifier = Modifier,
topDisappearanceSize: Dp = 24.dp,
bottomDisappearanceSize: Dp = 24.dp,
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
topFadeBrush: Brush = Brush.verticalGradient(
colors = listOf(
DmsTheme.colorScheme.background,
Color.Transparent,
),
)

private val bottomFadeBrush: Brush
@Composable inline get() = Brush.verticalGradient(
),
bottomFadeBrush: Brush = Brush.verticalGradient(
colors = listOf(
Color.Transparent,
DmsTheme.colorScheme.background,
),
)

@Composable
fun VerticallyFadedColumn(
modifier: Modifier = Modifier,
topDisappearanceSize: Dp = 24.dp,
bottomDisappearanceSize: Dp = 24.dp,
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
),
content: @Composable ColumnScope.() -> Unit,
) {
Box(
Expand Down Expand Up @@ -91,6 +87,18 @@ fun VerticallyFadedLazyColumn(
bottomDisappearanceSize: Dp = 24.dp,
verticalArrangement: Arrangement.Vertical = if (!reverseLayout) Arrangement.Top else Arrangement.Bottom,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
topFadeBrush: Brush = Brush.verticalGradient(
colors = listOf(
DmsTheme.colorScheme.background,
Color.Transparent,
),
),
bottomFadeBrush: Brush = Brush.verticalGradient(
colors = listOf(
Color.Transparent,
DmsTheme.colorScheme.background,
),
),
content: LazyListScope.() -> Unit,
) {
Box(
Expand Down
Loading

0 comments on commit 052a417

Please sign in to comment.