-
-
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.
Bring CMP Android and Jetpack Compose code structure closer
Will make code copying easier
- Loading branch information
1 parent
7b1b61b
commit 67398e0
Showing
9 changed files
with
80 additions
and
66 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
36 changes: 36 additions & 0 deletions
36
haze-jetpack-compose/src/main/kotlin/dev/chrisbanes/haze/Platform.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,36 @@ | ||
// Copyright 2023, Christopher Banes and the Haze project contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package dev.chrisbanes.haze | ||
|
||
import android.os.Build | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.Dp | ||
|
||
internal fun createHazeNode( | ||
state: HazeState, | ||
backgroundColor: Color, | ||
tint: Color, | ||
blurRadius: Dp, | ||
noiseFactor: Float, | ||
): HazeNode = when { | ||
Build.VERSION.SDK_INT >= 31 -> { | ||
HazeNode31( | ||
state = state, | ||
backgroundColor = backgroundColor, | ||
tint = tint, | ||
blurRadius = blurRadius, | ||
noiseFactor = noiseFactor, | ||
) | ||
} | ||
|
||
else -> { | ||
HazeNodeBase( | ||
state = state, | ||
backgroundColor = backgroundColor, | ||
tint = tint, | ||
blurRadius = blurRadius, | ||
noiseFactor = noiseFactor, | ||
) | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
haze-jetpack-compose/src/main/kotlin/dev/chrisbanes/haze/RoundRectExt.kt
This file was deleted.
Oops, something went wrong.
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
15 changes: 15 additions & 0 deletions
15
haze/src/androidMain/kotlin/dev/chrisbanes/haze/Platform.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,15 @@ | ||
// Copyright 2023, Christopher Banes and the Haze project contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package dev.chrisbanes.haze | ||
|
||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.Dp | ||
|
||
internal actual fun createHazeNode( | ||
state: HazeState, | ||
backgroundColor: Color, | ||
tint: Color, | ||
blurRadius: Dp, | ||
noiseFactor: Float, | ||
): HazeNode = HazeNodeBase(state, backgroundColor, tint, blurRadius, noiseFactor) |
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
15 changes: 15 additions & 0 deletions
15
haze/src/commonMain/kotlin/dev/chrisbanes/haze/Platform.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,15 @@ | ||
// Copyright 2023, Christopher Banes and the Haze project contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package dev.chrisbanes.haze | ||
|
||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.Dp | ||
|
||
internal expect fun createHazeNode( | ||
state: HazeState, | ||
backgroundColor: Color, | ||
tint: Color, | ||
blurRadius: Dp, | ||
noiseFactor: Float, | ||
): HazeNode |