-
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 #88 from Nexters/feature/bottom-tab
하단 탭 바 구현
- Loading branch information
Showing
48 changed files
with
749 additions
and
202 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
9 changes: 9 additions & 0 deletions
9
core/designsystem/src/main/java/com/goalpanzi/mission_mate/core/designsystem/ext/TextUnit.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,9 @@ | ||
package com.goalpanzi.mission_mate.core.designsystem.ext | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.platform.LocalDensity | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.TextUnit | ||
|
||
@Composable | ||
fun dpToSp(dp: Dp) : TextUnit = with(LocalDensity.current) { dp.toSp() } |
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
1 change: 1 addition & 0 deletions
1
...on/src/main/java/com/goalpanzi/mission_mate/core/navigation/AuthNavigationEventHandler.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
1 change: 1 addition & 0 deletions
1
...gation/src/main/java/com/goalpanzi/mission_mate/core/navigation/NavigationEventHandler.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
20 changes: 20 additions & 0 deletions
20
...gation/src/main/java/com/goalpanzi/mission_mate/core/navigation/model/MainTabDataModel.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,20 @@ | ||
package com.goalpanzi.mission_mate.core.navigation.model | ||
|
||
import android.os.Parcelable | ||
import kotlinx.parcelize.Parcelize | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@Parcelize | ||
sealed class MainTabDataModel : Parcelable { | ||
@Serializable | ||
data class Mission( | ||
val isAfterProfileCreate: Boolean = false | ||
) : MainTabDataModel() | ||
@Serializable | ||
data object History : MainTabDataModel() | ||
@Serializable | ||
data object Setting : MainTabDataModel() | ||
@Serializable | ||
data object None : MainTabDataModel() | ||
} |
32 changes: 32 additions & 0 deletions
32
...on/src/main/java/com/goalpanzi/mission_mate/core/navigation/model/MainTabDataModelType.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,32 @@ | ||
package com.goalpanzi.mission_mate.core.navigation.model | ||
|
||
import android.os.Build | ||
import android.os.Bundle | ||
import androidx.navigation.NavType | ||
import kotlinx.serialization.encodeToString | ||
import kotlinx.serialization.json.Json | ||
|
||
val MainTabDataModelType = object : NavType<MainTabDataModel>( | ||
isNullableAllowed = false | ||
){ | ||
override fun get(bundle: Bundle, key: String): MainTabDataModel? { | ||
return if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){ | ||
bundle.getParcelable(key, MainTabDataModel::class.java) | ||
} else { | ||
@Suppress("DEPRECATION") | ||
bundle.getParcelable(key) | ||
} | ||
} | ||
|
||
override fun parseValue(value: String): MainTabDataModel { | ||
return Json.decodeFromString<MainTabDataModel>(value) | ||
} | ||
|
||
override fun serializeAsValue(value: MainTabDataModel): String { | ||
return Json.encodeToString(value) | ||
} | ||
|
||
override fun put(bundle: Bundle, key: String, value: MainTabDataModel) { | ||
bundle.putParcelable(key, value) | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
core/ui/src/main/java/com/goalpanzi/mission_mate/core/ui/util/AnimatedUtil.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,45 @@ | ||
package com.goalpanzi.mission_mate.core.ui.util | ||
|
||
import androidx.compose.animation.AnimatedContentTransitionScope | ||
import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection | ||
import androidx.compose.animation.EnterTransition | ||
import androidx.compose.animation.ExitTransition | ||
import androidx.compose.animation.core.tween | ||
import androidx.navigation.NavBackStackEntry | ||
|
||
fun AnimatedContentTransitionScope<NavBackStackEntry>.slideInFromEnd( | ||
durationMills: Int = 300 | ||
): EnterTransition { | ||
return slideIntoContainer( | ||
towards = SlideDirection.Left, | ||
animationSpec = tween(durationMills) | ||
) | ||
} | ||
|
||
fun AnimatedContentTransitionScope<NavBackStackEntry>.slideOutToEnd( | ||
durationMills: Int = 300 | ||
): ExitTransition { | ||
return slideOutOfContainer( | ||
towards = SlideDirection.End, | ||
animationSpec = tween(durationMills) | ||
) | ||
} | ||
|
||
fun AnimatedContentTransitionScope<NavBackStackEntry>.slideInFromBottom( | ||
durationMills: Int = 300 | ||
): EnterTransition { | ||
return slideIntoContainer( | ||
towards = SlideDirection.Up, | ||
animationSpec = tween(durationMills) | ||
) | ||
} | ||
|
||
fun AnimatedContentTransitionScope<NavBackStackEntry>.slideOutToBottom( | ||
durationMills: Int = 300 | ||
): ExitTransition { | ||
return slideOutOfContainer( | ||
towards = SlideDirection.Down, | ||
animationSpec = tween(durationMills) | ||
) | ||
} | ||
|
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
Oops, something went wrong.