-
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 #10 from taetae98coding/develop
1.3.3
- Loading branch information
Showing
144 changed files
with
3,249 additions
and
2,393 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
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
79 changes: 79 additions & 0 deletions
79
...n/kotlin/io/github/taetae98coding/diary/core/compose/memo/add/MemoAddMultiPaneScaffold.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,79 @@ | ||
package io.github.taetae98coding.diary.core.compose.memo.add | ||
|
||
import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi | ||
import androidx.compose.material3.adaptive.layout.AnimatedPane | ||
import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffold | ||
import androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole | ||
import androidx.compose.material3.adaptive.navigation.rememberListDetailPaneScaffoldNavigator | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import io.github.taetae98coding.diary.core.compose.adaptive.isListVisible | ||
import io.github.taetae98coding.diary.core.compose.memo.detail.MemoDetailScaffold | ||
import io.github.taetae98coding.diary.core.compose.memo.detail.MemoDetailScaffoldFloatingButton | ||
import io.github.taetae98coding.diary.core.compose.memo.detail.MemoDetailScaffoldNavigationIcon | ||
import io.github.taetae98coding.diary.core.compose.memo.detail.MemoDetailScaffoldUiState | ||
import io.github.taetae98coding.diary.core.compose.memo.tag.MemoTagNavigationIcon | ||
import io.github.taetae98coding.diary.core.compose.memo.tag.MemoTagScaffold | ||
import io.github.taetae98coding.diary.core.compose.tag.card.TagCardUiState | ||
import kotlinx.datetime.LocalDate | ||
|
||
@OptIn(ExperimentalMaterial3AdaptiveApi::class) | ||
@Composable | ||
public fun MemoAddMultiPaneScaffold( | ||
navigateUp: () -> Unit, | ||
navigateToTagAdd: () -> Unit, | ||
navigateToTagDetail: (String) -> Unit, | ||
initialAddDateRange: ClosedRange<LocalDate>?, | ||
detailUiStateProvider: () -> MemoDetailScaffoldUiState.Add, | ||
primaryTagUiStateProvider: () -> TagCardUiState, | ||
tagUiStateProvider: () -> TagCardUiState, | ||
modifier: Modifier = Modifier, | ||
) { | ||
val navigator = rememberListDetailPaneScaffoldNavigator() | ||
|
||
ListDetailPaneScaffold( | ||
directive = navigator.scaffoldDirective.copy(defaultPanePreferredWidth = 500.dp), | ||
value = navigator.scaffoldValue, | ||
listPane = { | ||
val state = rememberMemoDetailScaffoldAddState(initialDateRange = initialAddDateRange) | ||
|
||
AnimatedPane { | ||
MemoDetailScaffold( | ||
state = state, | ||
uiStateProvider = detailUiStateProvider, | ||
primaryTagUiStateProvider = primaryTagUiStateProvider, | ||
onTagTitle = { navigator.navigateTo(ThreePaneScaffoldRole.Primary) }, | ||
onTag = navigateToTagDetail, | ||
titleProvider = { "메모 추가" }, | ||
navigationIconProvider = { MemoDetailScaffoldNavigationIcon.NavigateUp(navigateUp) }, | ||
floatingButtonProvider = { | ||
val uiState = detailUiStateProvider() | ||
|
||
MemoDetailScaffoldFloatingButton.Add( | ||
isInProgress = uiState.isAddInProgress, | ||
add = { uiState.add(state.detail) }, | ||
) | ||
}, | ||
) | ||
} | ||
}, | ||
detailPane = { | ||
AnimatedPane { | ||
MemoTagScaffold( | ||
onTagAdd = navigateToTagAdd, | ||
primaryTagUiStateProvider = primaryTagUiStateProvider, | ||
tagUiStateProvider = tagUiStateProvider, | ||
navigationIcon = { | ||
if (navigator.isListVisible()) { | ||
MemoTagNavigationIcon.None | ||
} else { | ||
MemoTagNavigationIcon.NavigateUp(navigator::navigateBack) | ||
} | ||
}, | ||
) | ||
} | ||
}, | ||
modifier = modifier, | ||
) | ||
} |
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.