-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schedule): support adaptive layout.
- Loading branch information
1 parent
70ade8d
commit 2372919
Showing
27 changed files
with
263 additions
and
252 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
6 changes: 6 additions & 0 deletions
6
theme-m3/main/main/src/main/kotlin/org/gdglille/devfest/android/theme/ConfigurationExt.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 org.gdglille.devfest.android.theme | ||
|
||
import android.content.res.Configuration | ||
|
||
val Configuration.isPortrait: Boolean | ||
get() = orientation == Configuration.ORIENTATION_PORTRAIT |
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
19 changes: 19 additions & 0 deletions
19
theme-m3/main/main/src/main/kotlin/org/gdglille/devfest/android/theme/WindowSizeClassExt.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,19 @@ | ||
package org.gdglille.devfest.android.theme | ||
|
||
import androidx.compose.material3.windowsizeclass.WindowHeightSizeClass | ||
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass | ||
|
||
val WindowWidthSizeClass.isCompat: Boolean | ||
get() = this == WindowWidthSizeClass.Compact | ||
|
||
val WindowWidthSizeClass.isMedium: Boolean | ||
get() = this == WindowWidthSizeClass.Medium | ||
|
||
val WindowWidthSizeClass.isExpanded: Boolean | ||
get() = this == WindowWidthSizeClass.Expanded | ||
|
||
val WindowHeightSizeClass.isCompat: Boolean | ||
get() = this == WindowHeightSizeClass.Compact | ||
|
||
val WindowHeightSizeClass.isMedium: Boolean | ||
get() = this == WindowHeightSizeClass.Medium |
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
45 changes: 45 additions & 0 deletions
45
...in/kotlin/org/gdglille/devfest/android/theme/m3/schedules/feature/ScheduleGridAdaptive.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 org.gdglille.devfest.android.theme.m3.schedules.feature | ||
|
||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi | ||
import androidx.compose.material3.adaptive.SupportingPaneScaffold | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
import kotlinx.coroutines.FlowPreview | ||
|
||
@OptIn( | ||
ExperimentalMaterial3AdaptiveApi::class, | ||
ExperimentalCoroutinesApi::class, | ||
FlowPreview::class | ||
) | ||
@Composable | ||
fun ScheduleGridAdaptive( | ||
onScheduleStarted: () -> Unit, | ||
onFilterClicked: () -> Unit, | ||
onTalkClicked: (id: String) -> Unit, | ||
showFilterIcon: Boolean, | ||
modifier: Modifier = Modifier, | ||
columnCount: Int = 1, | ||
isSmallSize: Boolean = false, | ||
) { | ||
SupportingPaneScaffold( | ||
modifier = modifier, | ||
mainPane = { | ||
ScheduleGridVM( | ||
onScheduleStarted = onScheduleStarted, | ||
onFilterClicked = onFilterClicked, | ||
onTalkClicked = onTalkClicked, | ||
showFilterIcon = showFilterIcon, | ||
columnCount = columnCount, | ||
isSmallSize = isSmallSize | ||
) | ||
}, | ||
supportingPane = { | ||
AgendaFiltersCompactVM( | ||
containerColor = if (showFilterIcon) MaterialTheme.colorScheme.background | ||
else MaterialTheme.colorScheme.surfaceContainerHigh | ||
) | ||
} | ||
) | ||
} |
Oops, something went wrong.