Skip to content

Commit

Permalink
Merge pull request #162 from pknu-wap/feature/tgyuu/#161
Browse files Browse the repository at this point in the history
Feature/tgyuu/#161
  • Loading branch information
jeongjaino authored Mar 25, 2024
2 parents 2968f7a + a927f4d commit d9af2a9
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 126 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/closed-pr-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Closed PR Notification
on:
pull_request:
branches:
- dev
- main
- develop
- release
- main
types:
- closed

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/opened-pr-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- develop
- release
- main
types:
- opened
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/released-app-distribution.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Released-App-Distribution

on:
push:
branches:
- 'release'
- release

jobs:
build:
Expand Down
15 changes: 14 additions & 1 deletion .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ WAP 행사일정을 쉽게 알려드릴게요! 함께해요 와피
<img src="./image/icon.png"/ width="40%">
</p>

<br><br><br>

<img src="https://github.com/pknu-wap/WAPP/assets/116813010/aa89aa41-9406-42d8-b245-40bca847b63d" width="250"/>
<img src="https://github.com/pknu-wap/WAPP/assets/116813010/9e7ec50f-404e-436c-ab7a-7037da2873a7" width="250"/>
<img src="https://github.com/pknu-wap/WAPP/assets/116813010/4e973d3d-7f35-432e-b6e1-3ce36d070c1a" width="250"/>
<img src="https://github.com/pknu-wap/WAPP/assets/116813010/c9e92d35-f7e4-49ad-ac9a-a923dd6fca6b" width="250"/>
<img src="https://github.com/pknu-wap/WAPP/assets/116813010/6c8a85d3-7ca1-46fb-919b-55d4a7309a3e" width="250"/>

<br><br><br>

## 🌱 Feature Introduce

#### 인트로 화면
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ fun WappNavHost(
)
signInScreen(
signInUseCase = signInUseCase,
navigateToNotice = navController::navigateToNotice,
navigateToNotice = {
navController.navigateToNotice(
navOptions { popUpTo(signInNavigationRoute) { inclusive = true } },
)
},
navigateToSignUp = navController::navigateToSignUp,
)
signUpScreen(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
package com.wap.wapp.feature.splash

import android.app.Activity
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.tween
import androidx.compose.animation.scaleIn
import androidx.compose.animation.scaleOut
import androidx.compose.animation.togetherWith
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.wap.designsystem.WappTheme
import com.wap.wapp.core.commmon.extensions.showToast
import com.wap.wapp.core.commmon.extensions.toSupportingText
import com.wap.wapp.core.designresource.R
import com.wap.wapp.feature.splash.R.string

@Composable
Expand All @@ -43,8 +27,6 @@ internal fun SplashRoute(
navigateToNotice: () -> Unit,
) {
val context = LocalContext.current as Activity
val isIconLogoVisible by viewModel.isIconLogoVisible.collectAsStateWithLifecycle()
val isIconLogoGoUp by viewModel.isIconLogoGoUp.collectAsStateWithLifecycle()

LaunchedEffect(true) {
viewModel.splashUiEvent.collect { event ->
Expand All @@ -58,100 +40,23 @@ internal fun SplashRoute(
}
}
}
SplashScreen(
isIconLogoVisible = isIconLogoVisible,
isIconLogoGoUp = isIconLogoGoUp,
)

SplashScreen()
}

@Composable
internal fun SplashScreen(
isIconLogoVisible: Boolean,
isIconLogoGoUp: Boolean,
) {
val ANIMATION_MILLS = 400

Column(
internal fun SplashScreen() {
Box(
modifier = Modifier
.fillMaxSize()
.background(WappTheme.colors.backgroundBlack),
) {
AnimatedContent(
targetState = isIconLogoVisible,
transitionSpec = {
scaleIn(tween(ANIMATION_MILLS, ANIMATION_MILLS)) togetherWith
scaleOut(tween(ANIMATION_MILLS))
},
) { isIconLogoVisible ->
if (!isIconLogoVisible) {
SplashTypoLogo()
} else {
SplashIconLogo(isIconLogoGoUp)
}
}
}
}

@Composable
private fun SplashTypoLogo() {
Column(
verticalArrangement = Arrangement.Center,
modifier = Modifier
.fillMaxSize(),
) {
Image(
painter = painterResource(id = com.wap.wapp.feature.splash.R.drawable.ic_wapp_logo),
painter = painterResource(id = R.drawable.ic_wapp_logo),
modifier = Modifier
.align(Alignment.CenterHorizontally)
.align(Alignment.Center)
.size(width = 230.dp, height = 230.dp),
contentDescription = stringResource(id = string.wapp_icon_description),
)
}
}

@Composable
private fun SplashIconLogo(isIconLogoGoUp: Boolean) {
val animatedPadding by animateDpAsState(
targetValue = if (isIconLogoGoUp) 200.dp else 0.dp,
animationSpec = tween(1000),
)

Column(modifier = Modifier.fillMaxSize()) {
Column(
verticalArrangement = Arrangement.Center,
modifier = Modifier
.fillMaxSize()
.weight(1f)
.padding(bottom = animatedPadding),
) {
Image(
painter = painterResource(id = R.drawable.img_white_cat),
modifier = Modifier
.align(Alignment.CenterHorizontally)
.size(width = 230.dp, height = 230.dp),
contentDescription = stringResource(id = string.wapp_icon_description),
)

Row(
modifier = Modifier.align(Alignment.CenterHorizontally),
) {
Column {
Spacer(modifier = Modifier.height(40.dp))

Text(
text = stringResource(id = string.application_name),
style = WappTheme.typography.titleBold,
fontSize = 48.sp,
color = WappTheme.colors.white,
)
}
Text(
text = stringResource(id = string.application_name),
fontSize = 48.sp,
style = WappTheme.typography.titleBold,
color = WappTheme.colors.yellow34,
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wap.wapp.core.domain.usecase.auth.IsUserSignInUseCase
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import javax.inject.Inject

Expand All @@ -19,29 +16,16 @@ class SplashViewModel @Inject constructor(
private val _splashUiEvent = MutableSharedFlow<SplashEvent>()
val splashUiEvent = _splashUiEvent.asSharedFlow()

private var _isIconLogoVisible = MutableStateFlow<Boolean>(false)
var isIconLogoVisible = _isIconLogoVisible.asStateFlow()

private var _isIconLogoGoUp = MutableStateFlow<Boolean>(false)
var isIconLogoGoUp = _isIconLogoGoUp.asStateFlow()

init {
viewModelScope.launch {
delay(1500)
_isIconLogoVisible.value = true
delay(1000)
isUserSignIn()
}
isUserSignIn()
}

private suspend fun isUserSignIn() {
private fun isUserSignIn() = viewModelScope.launch {
isUserSignInUseCase()
.onSuccess { isSignIn ->
if (isSignIn) {
_splashUiEvent.emit(SplashEvent.SignInUser)
} else {
_isIconLogoGoUp.value = true
delay(1000)
_splashUiEvent.emit(SplashEvent.NonSignInUser)
}
}.onFailure { throwable ->
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down

0 comments on commit d9af2a9

Please sign in to comment.