diff --git a/library/adaptive/.gitignore b/library/compose/.gitignore similarity index 100% rename from library/adaptive/.gitignore rename to library/compose/.gitignore diff --git a/library/adaptive/build.gradle.kts b/library/compose/build.gradle.kts similarity index 100% rename from library/adaptive/build.gradle.kts rename to library/compose/build.gradle.kts diff --git a/library/adaptive/proguard-rules.pro b/library/compose/proguard-rules.pro similarity index 100% rename from library/adaptive/proguard-rules.pro rename to library/compose/proguard-rules.pro diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavHost.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavHost.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavHost.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavHost.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavHostConfiguration.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavHostConfiguration.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavHostConfiguration.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavHostConfiguration.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavigationState.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavigationState.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavigationState.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptiveNavigationState.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptivePaneScope.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptivePaneScope.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptivePaneScope.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptivePaneScope.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptivePaneStrategy.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptivePaneStrategy.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptivePaneStrategy.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/AdaptivePaneStrategy.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/SavedStateAdaptiveNavHostState.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/SavedStateAdaptiveNavHostState.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/SavedStateAdaptiveNavHostState.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/SavedStateAdaptiveNavHostState.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/SlotBasedAdaptiveNavigationState.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/SlotBasedAdaptiveNavigationState.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/SlotBasedAdaptiveNavigationState.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/SlotBasedAdaptiveNavigationState.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/lifecycle/DestinationLifecycleOwner.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/lifecycle/DestinationLifecycleOwner.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/lifecycle/DestinationLifecycleOwner.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/lifecycle/DestinationLifecycleOwner.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/lifecycle/DestinationViewModelStoreCreator.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/lifecycle/DestinationViewModelStoreCreator.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/lifecycle/DestinationViewModelStoreCreator.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/lifecycle/DestinationViewModelStoreCreator.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/BoundsTransformDeferredAnimation.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/BoundsTransformDeferredAnimation.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/BoundsTransformDeferredAnimation.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/BoundsTransformDeferredAnimation.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/MovableSharedElementState.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/MovableSharedElementState.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/MovableSharedElementState.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/MovableSharedElementState.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/MovableSharedElements.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/MovableSharedElements.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/MovableSharedElements.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/moveablesharedelement/MovableSharedElements.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/ThreePane.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/ThreePane.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/ThreePane.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/ThreePane.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/configurations/MovableSharedElementConfiguration.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/configurations/MovableSharedElementConfiguration.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/configurations/MovableSharedElementConfiguration.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/configurations/MovableSharedElementConfiguration.kt diff --git a/library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/configurations/ThreePaneAdaptiveConfiguration.kt b/library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/configurations/ThreePaneAdaptiveConfiguration.kt similarity index 100% rename from library/adaptive/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/configurations/ThreePaneAdaptiveConfiguration.kt rename to library/compose/src/commonMain/kotlin/com/tunjid/treenav/adaptive/threepane/configurations/ThreePaneAdaptiveConfiguration.kt diff --git a/library/adaptive/src/commonTest/kotlin/com/tunjid/treenav/adaptive/SlotBasedAdaptiveNavigationStateTest.kt b/library/compose/src/commonTest/kotlin/com/tunjid/treenav/adaptive/SlotBasedAdaptiveNavigationStateTest.kt similarity index 100% rename from library/adaptive/src/commonTest/kotlin/com/tunjid/treenav/adaptive/SlotBasedAdaptiveNavigationStateTest.kt rename to library/compose/src/commonTest/kotlin/com/tunjid/treenav/adaptive/SlotBasedAdaptiveNavigationStateTest.kt diff --git a/libraryVersion.properties b/libraryVersion.properties index 8c7d675..f499a74 100644 --- a/libraryVersion.properties +++ b/libraryVersion.properties @@ -17,4 +17,4 @@ groupId=com.tunjid.treenav treenav_version=0.0.7 strings_version=0.0.7 -adaptive_version=0.0.7 \ No newline at end of file +compose_version=0.0.7 \ No newline at end of file diff --git a/sample/android/src/main/java/com/tunjid/tyler/MainActivity.kt b/sample/android/src/main/java/com/tunjid/tyler/MainActivity.kt index 807c1b6..fe88935 100644 --- a/sample/android/src/main/java/com/tunjid/tyler/MainActivity.kt +++ b/sample/android/src/main/java/com/tunjid/tyler/MainActivity.kt @@ -21,7 +21,7 @@ import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.appcompat.app.AppCompatActivity import com.tunjid.demo.common.ui.AppTheme -import com.tunjid.demo.common.ui.App +import com.tunjid.demo.common.ui.SampleApp class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { @@ -29,7 +29,7 @@ class MainActivity : AppCompatActivity() { enableEdgeToEdge() setContent { AppTheme { - App() + SampleApp() } } } diff --git a/sample/common/build.gradle.kts b/sample/common/build.gradle.kts index 6f294e9..09d7a3c 100755 --- a/sample/common/build.gradle.kts +++ b/sample/common/build.gradle.kts @@ -37,7 +37,7 @@ kotlin { dependencies { implementation(project(":library:treenav")) implementation(project(":library:strings")) - implementation(project(":library:adaptive")) + implementation(project(":library:compose")) implementation(compose.components.resources) diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/CollapsingHeader.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/AppBars.kt similarity index 55% rename from sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/CollapsingHeader.kt rename to sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/AppBars.kt index 8366040..d1d71f4 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/CollapsingHeader.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/AppBars.kt @@ -17,18 +17,9 @@ package com.tunjid.demo.common.ui -import androidx.compose.animation.animateColorAsState import androidx.compose.animation.splineBasedDecay -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.statusBars -import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.ExperimentalMaterial3Api @@ -38,70 +29,30 @@ import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.platform.LocalDensity -import androidx.compose.ui.unit.IntOffset +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp -import com.tunjid.composables.collapsingheader.CollapsingHeader import com.tunjid.composables.collapsingheader.CollapsingHeaderState -import kotlin.math.max -import kotlin.math.roundToInt @Composable -internal fun SampleCollapsingHeader( - title: String, - headerColor: Color, - onBackPressed: () -> Unit, - body: @Composable (collapsedHeight: Float) -> Unit, -) { +fun rememberAppBarCollapsingHeaderState( + expandedHeight: Dp +): CollapsingHeaderState { val density = LocalDensity.current val collapsedHeight = with(density) { 56.dp.toPx() } + WindowInsets.statusBars.getTop(density).toFloat() + WindowInsets.statusBars.getBottom(density).toFloat() - val headerState = remember { + + return remember { CollapsingHeaderState( collapsedHeight = collapsedHeight, - initialExpandedHeight = with(density) { 400.dp.toPx() }, + initialExpandedHeight = with(density) { expandedHeight.toPx() }, decayAnimationSpec = splineBasedDecay(density) ) } - val animatedColor by animateColorAsState( - headerColor.copy(alpha = max(1f - headerState.progress, 0.6f)) - ) - CollapsingHeader( - state = headerState, - headerContent = { - Box { - Column( - modifier = Modifier.fillMaxWidth() - .offset { - IntOffset( - x = 0, - y = -headerState.translation.roundToInt() - ) - } - .background(animatedColor) - ) { - Spacer(Modifier.windowInsetsPadding(WindowInsets.statusBars)) - Spacer(Modifier.height(200.dp)) - } - SampleTopAppBar( - title = title, - onBackPressed = onBackPressed, - modifier = Modifier.onSizeChanged { - headerState.collapsedHeight = it.height.toFloat() - } - ) - } - }, - body = { - body(collapsedHeight) - } - ) } @OptIn(ExperimentalMaterial3Api::class) diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/App.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/DemoApp.kt similarity index 93% rename from sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/App.kt rename to sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/DemoApp.kt index 057f3f3..d367e66 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/App.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/DemoApp.kt @@ -65,19 +65,14 @@ import kotlin.math.roundToInt @OptIn(ExperimentalSharedTransitionApi::class, ExperimentalMaterial3AdaptiveApi::class) @Composable -fun App( +fun SampleApp( appState: SampleAppState = remember { SampleAppState() }, ) { NavigationSuiteScaffold( navigationSuiteItems = { SampleDestination.NavTabs.entries.forEach { item( - icon = { - Icon( - it.icon, - contentDescription = it.title - ) - }, + icon = { Icon(it.icon, contentDescription = it.title) }, label = { Text(it.title) }, selected = it == appState.currentNavigation.current, onClick = { } @@ -109,7 +104,6 @@ fun App( .onSizeChanged { windowWidthDp.value = (it.width / density.density).roundToInt() } - then sharedTransitionModifier ) { ListDetailPaneScaffold( modifier = Modifier @@ -123,13 +117,16 @@ fun App( tertiary = if (nodeFor(ThreePane.Tertiary) == null) PaneAdaptedValue.Hidden else PaneAdaptedValue.Expanded, ), listPane = { - Destination(ThreePane.Secondary) + if (nodeFor(ThreePane.Tertiary) == null) Destination(ThreePane.Secondary) + else Destination(ThreePane.Tertiary) }, detailPane = { - Destination(ThreePane.Primary) + if (nodeFor(ThreePane.Tertiary) == null) Destination(ThreePane.Primary) + else Destination(ThreePane.Secondary) }, extraPane = { - Destination(ThreePane.Tertiary) + if (nodeFor(ThreePane.Tertiary) == null) Destination(ThreePane.Tertiary) + else Destination(ThreePane.Primary) } ) } @@ -137,7 +134,6 @@ fun App( } } - @Stable class SampleAppState( private val navigationRepository: NavigationRepository = NavigationRepository diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/ChatScreen.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/ChatScreen.kt index 39cfef4..1db6bd8 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/ChatScreen.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/ChatScreen.kt @@ -39,6 +39,7 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip @@ -68,12 +69,17 @@ fun ChatScreen( ) { SampleTopAppBar( title = state.room?.name ?: "", - onBackPressed = { onAction(Action.Navigation.Pop) }, + onBackPressed = remember(state.isInPrimaryPane) { + if (state.isInPrimaryPane) return@remember { + onAction(Action.Navigation.Pop) + } else null + }, ) Messages( me = state.me, roomName = state.room?.name, messages = state.chats, + isInPrimaryPane = state.isInPrimaryPane, navigateToProfile = onAction, modifier = Modifier.weight(1f), scrollState = scrollState, @@ -87,6 +93,7 @@ fun ChatScreen( fun Messages( me: Profile?, roomName: String?, + isInPrimaryPane: Boolean, messages: List, navigateToProfile: (Action.Navigation.GoToProfile) -> Unit, scrollState: LazyListState, @@ -113,6 +120,7 @@ fun Messages( roomName = roomName, item = content, isUserMe = content.sender.name == me?.name, + isInPrimaryPane = isInPrimaryPane, isFirstMessageByAuthor = isFirstMessageByAuthor, isLastMessageByAuthor = isLastMessageByAuthor, movableSharedElementScope = movableSharedElementScope, @@ -129,6 +137,7 @@ fun Message( item: MessageItem, roomName: String?, isUserMe: Boolean, + isInPrimaryPane: Boolean, isFirstMessageByAuthor: Boolean, isLastMessageByAuthor: Boolean, movableSharedElementScope: MovableSharedElementScope @@ -162,8 +171,9 @@ fun Message( roomName?.let { onAuthorClick( Action.Navigation.GoToProfile( + roomName = it, profileName = item.sender.name, - roomName = it + isInPrimaryPane = isInPrimaryPane, ) ) } diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/ChatViewModel.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/ChatViewModel.kt index cf2527b..3223a55 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/ChatViewModel.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/ChatViewModel.kt @@ -35,6 +35,7 @@ import com.tunjid.mutator.coroutines.toMutationStream import com.tunjid.treenav.MultiStackNav import com.tunjid.treenav.pop import com.tunjid.treenav.push +import com.tunjid.treenav.swap import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.flatMapLatest @@ -62,6 +63,7 @@ class ChatViewModel( keySelector = Action::key ) { when (val type = type()) { + is Action.UpdateInPrimaryPane -> type.flow.updateInPrimaryPaneMutations() is Action.Navigation -> navigationRepository.navigationMutations( type.flow ) @@ -106,9 +108,13 @@ private fun chatLoadMutations( copy(chats = it) } +private fun Flow.updateInPrimaryPaneMutations(): Flow> = + mapToMutation { copy(isInPrimaryPane = it.isInPrimaryPane) } + data class State( val me: Profile? = null, val room: ChatRoom? = null, + val isInPrimaryPane: Boolean = true, val chats: List = emptyList() ) @@ -120,6 +126,11 @@ data class MessageItem( sealed class Action( val key: String ) { + + data class UpdateInPrimaryPane( + val isInPrimaryPane: Boolean + ) : Action("UpdateInPrimaryPane") + sealed class Navigation : Action("Navigation"), NavigationAction { data object Pop : Navigation(), NavigationAction by navigationAction( MultiStackNav::pop @@ -128,14 +139,15 @@ sealed class Action( data class GoToProfile( val profileName: String, val roomName: String, + val isInPrimaryPane: Boolean, ) : Navigation(), NavigationAction by navigationAction( { - push( - SampleDestination.Profile( - profileName = profileName, - roomName = roomName, - ) + val profileDestination = SampleDestination.Profile( + profileName = profileName, + roomName = roomName, ) + if (isInPrimaryPane) push(profileDestination) + else swap(profileDestination) } ) } diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/Configuration.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/Configuration.kt index e58153e..98455ad 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/Configuration.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chat/Configuration.kt @@ -16,6 +16,7 @@ package com.tunjid.demo.common.ui.chat +import androidx.compose.runtime.LaunchedEffect import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.coroutineScope @@ -46,6 +47,13 @@ fun chatAdaptiveConfiguration( state = viewModel.state.collectAsStateWithLifecycle().value, onAction = viewModel.accept ) + LaunchedEffect(paneState.pane) { + viewModel.accept( + Action.UpdateInPrimaryPane( + isInPrimaryPane = paneState.pane == ThreePane.Primary + ) + ) + } }, paneMapping = { mapOf( diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chatrooms/ChatRoomsScreen.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chatrooms/ChatRoomsScreen.kt index 393bc95..fc8360c 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chatrooms/ChatRoomsScreen.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/chatrooms/ChatRoomsScreen.kt @@ -16,42 +16,112 @@ package com.tunjid.demo.common.ui.chatrooms -import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items +import androidx.compose.material3.Card import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.tunjid.demo.common.ui.SampleCollapsingHeader +import androidx.compose.ui.unit.IntOffset +import androidx.compose.ui.unit.dp +import com.tunjid.composables.collapsingheader.CollapsingHeader +import com.tunjid.composables.collapsingheader.CollapsingHeaderState +import com.tunjid.demo.common.ui.SampleTopAppBar import com.tunjid.demo.common.ui.data.ChatRoom +import com.tunjid.demo.common.ui.rememberAppBarCollapsingHeaderState +import kotlin.math.roundToInt @Composable fun ChatRoomsScreen( state: State, onAction: (Action) -> Unit, ) { - SampleCollapsingHeader( - title = "Chat Rooms", - headerColor = MaterialTheme.colorScheme.primaryContainer, - onBackPressed = {} + val headerState = rememberAppBarCollapsingHeaderState(200.dp) + + CollapsingHeader( + state = headerState, + headerContent = { + Header(headerState) + }, + body = { + ChatRooms(state, onAction) + } + ) +} + +@Composable +private fun Header(headerState: CollapsingHeaderState) { + Box( + modifier = Modifier + .fillMaxWidth() + .height(200.dp) + .offset { + IntOffset( + x = 0, + y = -headerState.translation.roundToInt() + ) + } + ) { + SampleTopAppBar( + title = "Chat Rooms", + onBackPressed = null + ) + } +} + +@Composable +private fun ChatRooms( + state: State, + onAction: (Action) -> Unit +) { + LazyColumn( + modifier = Modifier.fillMaxSize() + ) { + items( + items = state.chatRooms, + key = ChatRoom::name, + itemContent = { room -> + ChatRoomListItem( + roomName = room.name, + onRoomClicked = { + onAction(Action.Navigation.ToRoom(roomName = it)) + } + ) + } + ) + } +} + +@Composable +fun ChatRoomListItem( + roomName: String, + modifier: Modifier = Modifier, + onRoomClicked: (String) -> Unit, +) { + Card( + modifier = modifier + .fillMaxWidth() + .padding(8.dp), + onClick = { onRoomClicked(roomName) } ) { - LazyColumn( - modifier = Modifier.fillMaxSize() + Row( + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + verticalAlignment = Alignment.CenterVertically ) { - items( - items = state.chatRooms, - key = ChatRoom::name, - itemContent = { room -> - Text( - text = room.name, - modifier = Modifier - .clickable { - onAction(Action.Navigation.ToRoom(roomName = room.name)) - } - ) - } + Text( + text = roomName, + style = MaterialTheme.typography.bodyLarge ) } } diff --git a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/profile/ProfileScreen.kt b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/profile/ProfileScreen.kt index d6f1d6a..19ff986 100644 --- a/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/profile/ProfileScreen.kt +++ b/sample/common/src/commonMain/kotlin/com/tunjid/demo/common/ui/profile/ProfileScreen.kt @@ -17,106 +17,145 @@ package com.tunjid.demo.common.ui.profile import androidx.compose.animation.ExperimentalSharedTransitionApi -import androidx.compose.animation.animateColorAsState -import androidx.compose.animation.splineBasedDecay -import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.offset -import androidx.compose.foundation.layout.statusBars +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale -import androidx.compose.ui.layout.onSizeChanged -import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp import com.tunjid.composables.collapsingheader.CollapsingHeader -import com.tunjid.composables.collapsingheader.CollapsingHeaderState import com.tunjid.demo.common.ui.ProfilePhoto import com.tunjid.demo.common.ui.ProfilePhotoArgs import com.tunjid.demo.common.ui.SampleTopAppBar +import com.tunjid.demo.common.ui.rememberAppBarCollapsingHeaderState import com.tunjid.scaffold.treenav.adaptive.moveablesharedelement.MovableSharedElementScope -import kotlin.math.max import kotlin.math.roundToInt -@OptIn(ExperimentalSharedTransitionApi::class) @Composable fun ProfileScreen( movableSharedElementScope: MovableSharedElementScope, state: State, onAction: (Action) -> Unit, ) { - val density = LocalDensity.current - val collapsedHeight = with(density) { 56.dp.toPx() } + - WindowInsets.statusBars.getTop(density).toFloat() + - WindowInsets.statusBars.getBottom(density).toFloat() - val headerState = remember { - CollapsingHeaderState( - collapsedHeight = collapsedHeight, - initialExpandedHeight = with(density) { 400.dp.toPx() }, - decayAnimationSpec = splineBasedDecay(density) - ) - } - val animatedColor by animateColorAsState( - MaterialTheme.colorScheme.primaryContainer.copy( - alpha = max( - 1f - headerState.progress, - 0.6f - ) - ) - ) + val headerState = rememberAppBarCollapsingHeaderState(400.dp) + CollapsingHeader( state = headerState, headerContent = { - Box { - Column( - modifier = Modifier - .fillMaxWidth() - .height(400.dp) - .offset { - IntOffset( - x = 0, - y = -headerState.translation.roundToInt() - ) - } - .background(animatedColor) - ) { - val profileName = state.profileName ?: state.profile?.name - if (profileName != null) { - val sharedImage = movableSharedElementScope.movableSharedElementOf( - key = profileName, - sharedElement = { args: ProfilePhotoArgs, innerModifier: Modifier -> - ProfilePhoto(args, innerModifier) - } - ) - sharedImage( - ProfilePhotoArgs( - profileName = profileName, - contentScale = ContentScale.Crop, - contentDescription = null, - ), - Modifier.fillMaxSize(), + ProfileHeader( + state = state, + movableSharedElementScope = movableSharedElementScope, + onBackPressed = { + onAction(Action.Navigation.Pop) + }, + modifier = Modifier + .fillMaxWidth() + .height(400.dp) + .offset { + IntOffset( + x = 0, + y = -headerState.translation.roundToInt() ) } - } - SampleTopAppBar( - title = state.profile?.name ?: "", - onBackPressed = { onAction(Action.Navigation.Pop) }, - modifier = Modifier.onSizeChanged { - headerState.collapsedHeight = it.height.toFloat() - } - ) - } + ) }, body = { + ProfileDetails(state) } ) -} \ No newline at end of file +} + +@Composable +private fun ProfileHeader( + state: State, + movableSharedElementScope: MovableSharedElementScope, + modifier: Modifier = Modifier, + onBackPressed: () -> Unit +) { + Box { + Box( + modifier = modifier + ) { + ProfilePhoto( + state = state, + movableSharedElementScope = movableSharedElementScope, + modifier = Modifier.fillMaxSize() + ) + } + SampleTopAppBar( + title = "Profile", + onBackPressed = onBackPressed, + ) + } +} + +@OptIn(ExperimentalSharedTransitionApi::class) +@Composable +private fun ProfilePhoto( + state: State, + movableSharedElementScope: MovableSharedElementScope, + modifier: Modifier = Modifier, +) { + val profileName = state.profileName ?: state.profile?.name + if (profileName != null) { + val sharedImage = movableSharedElementScope.movableSharedElementOf( + key = profileName, + sharedElement = { args: ProfilePhotoArgs, innerModifier: Modifier -> + ProfilePhoto(args, innerModifier) + } + ) + sharedImage( + ProfilePhotoArgs( + profileName = profileName, + contentScale = ContentScale.Crop, + contentDescription = null, + ), + modifier, + ) + } +} + +@Composable +private fun ProfileDetails(state: State) { + Column( + modifier = Modifier + .padding(horizontal = 16.dp) + .verticalScroll(rememberScrollState()) + ) { + Spacer(modifier = Modifier.height(16.dp)) + Text( + text = state.profile?.name ?: "", + style = MaterialTheme.typography.headlineSmall, + fontWeight = FontWeight.Bold + ) + Spacer(modifier = Modifier.height(4.dp)) + Text( + text = state.profile?.jobTitle ?: "", + style = MaterialTheme.typography.bodyLarge, + fontWeight = FontWeight.Medium + ) + Spacer(modifier = Modifier.height(4.dp)) + Text( + text = state.profile?.location ?: "", + style = MaterialTheme.typography.bodyLarge, + fontWeight = FontWeight.Medium + ) + Spacer(modifier = Modifier.height(4.dp)) + Text( + text = state.profile?.selfDescription ?: "", + style = MaterialTheme.typography.bodyMedium + ) + } +} diff --git a/sample/common/src/iosMain/kotlin/main.ios.kt b/sample/common/src/iosMain/kotlin/main.ios.kt index 52228e6..836268c 100644 --- a/sample/common/src/iosMain/kotlin/main.ios.kt +++ b/sample/common/src/iosMain/kotlin/main.ios.kt @@ -1,9 +1,9 @@ import androidx.compose.ui.window.ComposeUIViewController import com.tunjid.demo.common.ui.AppTheme -import com.tunjid.demo.common.ui.App +import com.tunjid.demo.common.ui.SampleApp fun MainViewController() = ComposeUIViewController { AppTheme { - App() + SampleApp() } } diff --git a/sample/desktop/.gitignore b/sample/desktop/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/sample/desktop/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/sample/desktop/build/classes/kotlin/jvm/main/META-INF/desktop.kotlin_module b/sample/desktop/build/classes/kotlin/jvm/main/META-INF/desktop.kotlin_module deleted file mode 100644 index a805767..0000000 Binary files a/sample/desktop/build/classes/kotlin/jvm/main/META-INF/desktop.kotlin_module and /dev/null differ diff --git a/sample/desktop/build/classes/kotlin/jvm/main/com/tunjid/demo/MainKt.class b/sample/desktop/build/classes/kotlin/jvm/main/com/tunjid/demo/MainKt.class deleted file mode 100644 index cd1bf36..0000000 Binary files a/sample/desktop/build/classes/kotlin/jvm/main/com/tunjid/demo/MainKt.class and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab deleted file mode 100644 index bdf584a..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.keystream b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.keystream deleted file mode 100644 index 931dcf0..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.keystream and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len deleted file mode 100644 index d06c17e..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.len deleted file mode 100644 index 2a17e6e..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.values.at b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.values.at deleted file mode 100644 index 2871190..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab.values.at and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab_i b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab_i deleted file mode 100644 index bce0089..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab_i and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab_i.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab_i.len deleted file mode 100644 index 131e265..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/inputs/source-to-output.tab_i.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab deleted file mode 100644 index fb77ab0..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream deleted file mode 100644 index 8a97e0c..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len deleted file mode 100644 index 80eee97..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len deleted file mode 100644 index 9e27f73..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at deleted file mode 100644 index fd1772f..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i deleted file mode 100644 index 6807685..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len deleted file mode 100644 index 131e265..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab deleted file mode 100644 index bdf584a..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream deleted file mode 100644 index e7acecf..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len deleted file mode 100644 index 7274ac0..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len deleted file mode 100644 index 2a17e6e..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at deleted file mode 100644 index 46d6744..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i deleted file mode 100644 index 21b6db2..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len deleted file mode 100644 index 131e265..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab deleted file mode 100644 index 979c874..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream deleted file mode 100644 index 56bde15..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len deleted file mode 100644 index c259288..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.len deleted file mode 100644 index 01bdaa1..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at deleted file mode 100644 index 67fb84c..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab_i b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab_i deleted file mode 100644 index 6bca597..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab_i and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len deleted file mode 100644 index 131e265..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab deleted file mode 100644 index bdf584a..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream deleted file mode 100644 index 931dcf0..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len deleted file mode 100644 index d06c17e..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len deleted file mode 100644 index 2a17e6e..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at deleted file mode 100644 index c0418c1..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i deleted file mode 100644 index bce0089..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len deleted file mode 100644 index 131e265..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/counters.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/counters.tab deleted file mode 100644 index 166c057..0000000 --- a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/counters.tab +++ /dev/null @@ -1,2 +0,0 @@ -1 -0 \ No newline at end of file diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab deleted file mode 100644 index bdf584a..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.keystream b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.keystream deleted file mode 100644 index 931dcf0..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.keystream and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len deleted file mode 100644 index d06c17e..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.len deleted file mode 100644 index 2a17e6e..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.values.at b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.values.at deleted file mode 100644 index 5875372..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab.values.at and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab_i b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab_i deleted file mode 100644 index bce0089..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab_i and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab_i.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab_i.len deleted file mode 100644 index 131e265..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/file-to-id.tab_i.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab deleted file mode 100644 index 8aad32b..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.keystream b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.keystream deleted file mode 100644 index 08e7df1..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.keystream and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len deleted file mode 100644 index b7da01d..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.len deleted file mode 100644 index 2a17e6e..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.values.at b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.values.at deleted file mode 100644 index fd1e6b6..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab.values.at and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab_i.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab_i.len deleted file mode 100644 index 1b1cb4d..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/id-to-file.tab_i.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab deleted file mode 100644 index 75e4ef7..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.keystream b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.keystream deleted file mode 100644 index f8e2957..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.keystream and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.keystream.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.keystream.len deleted file mode 100644 index aab62cd..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.keystream.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.len deleted file mode 100644 index 575d132..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.values.at b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.values.at deleted file mode 100644 index a9f08da..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab.values.at and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab_i b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab_i deleted file mode 100644 index 1faf477..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab_i and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab_i.len b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab_i.len deleted file mode 100644 index 131e265..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/caches-jvm/lookups/lookups.tab_i.len and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/last-build.bin b/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/last-build.bin deleted file mode 100644 index d80288d..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/cacheable/last-build.bin and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/classpath-snapshot/shrunk-classpath-snapshot.bin b/sample/desktop/build/kotlin/compileKotlinJvm/classpath-snapshot/shrunk-classpath-snapshot.bin deleted file mode 100644 index aeb5c0c..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/classpath-snapshot/shrunk-classpath-snapshot.bin and /dev/null differ diff --git a/sample/desktop/build/kotlin/compileKotlinJvm/local-state/build-history.bin b/sample/desktop/build/kotlin/compileKotlinJvm/local-state/build-history.bin deleted file mode 100644 index 6cfb852..0000000 Binary files a/sample/desktop/build/kotlin/compileKotlinJvm/local-state/build-history.bin and /dev/null differ diff --git a/sample/desktop/build/libs/desktop-jvm.jar b/sample/desktop/build/libs/desktop-jvm.jar deleted file mode 100644 index f6c4e65..0000000 Binary files a/sample/desktop/build/libs/desktop-jvm.jar and /dev/null differ diff --git a/sample/desktop/build/tmp/jvmJar/MANIFEST.MF b/sample/desktop/build/tmp/jvmJar/MANIFEST.MF deleted file mode 100644 index 58630c0..0000000 --- a/sample/desktop/build/tmp/jvmJar/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/sample/desktop/src/jvmMain/kotlin/com/tunjid/demo/Main.kt b/sample/desktop/src/jvmMain/kotlin/com/tunjid/demo/Main.kt index ab8762a..d19c188 100644 --- a/sample/desktop/src/jvmMain/kotlin/com/tunjid/demo/Main.kt +++ b/sample/desktop/src/jvmMain/kotlin/com/tunjid/demo/Main.kt @@ -22,7 +22,7 @@ import androidx.compose.ui.window.Window import androidx.compose.ui.window.application import androidx.compose.ui.window.rememberWindowState import com.tunjid.demo.common.ui.AppTheme -import com.tunjid.demo.common.ui.App +import com.tunjid.demo.common.ui.SampleApp fun main() { application { @@ -35,7 +35,7 @@ fun main() { title = "Tiling Demo" ) { AppTheme { - App() + SampleApp() } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 8b5c097..6504b4a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -39,7 +39,7 @@ rootProject.name = "TreeNavigation" include( ":library:treenav", ":library:strings", - ":library:adaptive", + ":library:compose", ":sample:android", ":sample:common", ":sample:desktop",