-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd68da6
commit c7c5d7e
Showing
14 changed files
with
95 additions
and
53 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
core/ui/src/main/kotlin/org/michaelbel/movies/ui/ktx/ConfigurationKtx.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,16 @@ | ||
package org.michaelbel.movies.ui.ktx | ||
|
||
import android.content.res.Configuration | ||
import androidx.compose.foundation.layout.WindowInsets | ||
import androidx.compose.foundation.layout.displayCutout | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.platform.LocalConfiguration | ||
|
||
val isPortrait: Boolean | ||
@Composable get() { | ||
val configuration = LocalConfiguration.current | ||
return configuration.orientation == Configuration.ORIENTATION_PORTRAIT | ||
} | ||
|
||
val displayCutoutWindowInsets: WindowInsets | ||
@Composable get() = if (isPortrait) WindowInsets(0, 0, 0, 0) else WindowInsets.displayCutout |
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
9 changes: 1 addition & 8 deletions
9
feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ktx/ConfigurationKtx.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 |
---|---|---|
@@ -1,17 +1,10 @@ | ||
package org.michaelbel.movies.feed.ktx | ||
|
||
import android.content.res.Configuration | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.platform.LocalConfiguration | ||
import org.michaelbel.movies.ui.ktx.isPortrait | ||
|
||
private const val FEED_GRID_PORTRAIT_COLUMNS_COUNT = 2 | ||
private const val FEED_GRID_LANDSCAPE_COLUMNS_COUNT = 4 | ||
|
||
val isPortrait: Boolean | ||
@Composable get() { | ||
val configuration = LocalConfiguration.current | ||
return configuration.orientation == Configuration.ORIENTATION_PORTRAIT | ||
} | ||
|
||
val gridColumnsCount: Int | ||
@Composable get() = if (isPortrait) FEED_GRID_PORTRAIT_COLUMNS_COUNT else FEED_GRID_LANDSCAPE_COLUMNS_COUNT |
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
Oops, something went wrong.