-
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.
Merge pull request #59 from Team-Notitime/feat/onboarding/57-onboardi…
…ng-ui Feat/onboarding/57 onboarding UI
- Loading branch information
Showing
22 changed files
with
354 additions
and
18 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
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
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/easyhz/noffice/navigation/home/screen/Onboarding.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,6 @@ | ||
package com.easyhz.noffice.navigation.home.screen | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
object Onboarding |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
13 changes: 13 additions & 0 deletions
13
...e/src/main/java/com/easyhz/noffice/domain/home/usecase/onboarding/SetIsFirstRunUseCase.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,13 @@ | ||
package com.easyhz.noffice.domain.home.usecase.onboarding | ||
|
||
import com.easyhz.noffice.core.common.base.BaseUseCase | ||
import com.easyhz.noffice.data.member.repository.user.UserRepository | ||
import javax.inject.Inject | ||
|
||
class SetIsFirstRunUseCase @Inject constructor( | ||
private val userRepository: UserRepository | ||
): BaseUseCase<Boolean, Unit>() { | ||
override suspend fun invoke(param: Boolean): Result<Unit> { | ||
return userRepository.setIsFirstRun(param) | ||
} | ||
} |
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
55 changes: 55 additions & 0 deletions
55
...home/src/main/java/com/easyhz/noffice/feature/home/component/onboarding/OnboardingItem.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,55 @@ | ||
package com.easyhz.noffice.feature.home.component.onboarding | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.heightIn | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
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 com.easyhz.noffice.core.design_system.theme.Grey300 | ||
import com.easyhz.noffice.core.design_system.theme.SubBody14 | ||
import com.easyhz.noffice.core.design_system.theme.Title3 | ||
import com.easyhz.noffice.core.design_system.theme.White | ||
import com.easyhz.noffice.feature.home.util.OnboardingStep | ||
|
||
@Composable | ||
internal fun OnboardingItem( | ||
modifier: Modifier = Modifier, | ||
item: OnboardingStep | ||
) { | ||
Column( | ||
modifier = modifier, | ||
verticalArrangement = Arrangement.spacedBy(16.dp) | ||
) { | ||
Column( | ||
modifier = Modifier.padding(horizontal = 12.dp), | ||
verticalArrangement = Arrangement.spacedBy(12.dp) | ||
) { | ||
Text( | ||
text = stringResource(id = item.titleId), | ||
style = Title3, | ||
color = White, | ||
lineHeight = (22 * 1.3).sp | ||
) | ||
Text( | ||
modifier = Modifier.heightIn(min= 56.dp), | ||
text = stringResource(id = item.contentId), | ||
style = SubBody14, | ||
color = Grey300, | ||
lineHeight = (14 * 1.4).sp | ||
) | ||
} | ||
Image( | ||
modifier = Modifier.fillMaxWidth().weight(1f), | ||
painter = painterResource(id = item.imageId), | ||
contentDescription = item.name | ||
) | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ome/src/main/java/com/easyhz/noffice/feature/home/contract/onboarding/OnboardingIntent.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,7 @@ | ||
package com.easyhz.noffice.feature.home.contract.onboarding | ||
|
||
import com.easyhz.noffice.core.common.base.UiIntent | ||
|
||
sealed class OnboardingIntent: UiIntent() { | ||
data class ClickButton(val index: Int): OnboardingIntent() | ||
} |
8 changes: 8 additions & 0 deletions
8
...src/main/java/com/easyhz/noffice/feature/home/contract/onboarding/OnboardingSideEffect.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,8 @@ | ||
package com.easyhz.noffice.feature.home.contract.onboarding | ||
|
||
import com.easyhz.noffice.core.common.base.UiSideEffect | ||
|
||
sealed class OnboardingSideEffect: UiSideEffect() { | ||
data class SlideNext(val page: Int): OnboardingSideEffect() | ||
data object NavigateToLogin: OnboardingSideEffect() | ||
} |
14 changes: 14 additions & 0 deletions
14
...home/src/main/java/com/easyhz/noffice/feature/home/contract/onboarding/OnboardingState.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,14 @@ | ||
package com.easyhz.noffice.feature.home.contract.onboarding | ||
|
||
import com.easyhz.noffice.core.common.base.UiState | ||
import com.easyhz.noffice.feature.home.util.OnboardingStep | ||
|
||
data class OnboardingState( | ||
val steps: List<OnboardingStep> | ||
): UiState() { | ||
companion object { | ||
fun init() = OnboardingState( | ||
steps = enumValues<OnboardingStep>().toList() | ||
) | ||
} | ||
} |
Oops, something went wrong.