Skip to content

Commit

Permalink
Refactor packages
Browse files Browse the repository at this point in the history
  • Loading branch information
cl3m committed Jan 25, 2021
1 parent 8064c3b commit 89159c1
Show file tree
Hide file tree
Showing 236 changed files with 2,515 additions and 1,784 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ You did not read the requirements. Install cocoapods-generate "gem install cocoa
- Better images/resources support
- UI Test with Github Actions
- Performance improvement/optimisation
- Use Compose compiler and runtime on iOS

## Sponsors

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.rouge41.kmm.compose.foundation

import com.rouge41.kmm.compose.ui.unit.Dp
import com.rouge41.kmm.compose.ui.graphics.Color
import androidx.compose.foundation.BorderStroke as _BorderStroke

actual typealias BorderStroke = androidx.compose.foundation.BorderStroke

actual fun BorderStroke(width: Dp, color: Color) = _BorderStroke(width = width, color = color)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.rouge41.kmm.compose.foundation

import androidx.compose.ui.graphics.ImageBitmap
import com.rouge41.kmm.compose.ui.Modifier
import com.rouge41.kmm.compose.runtime.Composable
import com.rouge41.kmm.compose.ui.Alignment
import com.rouge41.kmm.compose.ui.AlignmentVerticalAndHorizontal
import com.rouge41.kmm.compose.ui.layout.ContentScale
import androidx.compose.foundation.Image as _Image

@Composable
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
actual inline fun Image(bitmap: ImageBitmap,
modifier: Modifier = Modifier,
alignment: AlignmentVerticalAndHorizontal = Alignment.Center,
contentScale: ContentScale = ContentScale.Fit,
alpha: Float = 1.0f) = _Image(
bitmap = bitmap,
modifier = modifier,
alignment = alignment,
contentScale = contentScale,
alpha = alpha
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.rouge41.kmm.compose.foundation

actual typealias InteractionState = androidx.compose.foundation.InteractionState
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.rouge41.kmm.compose.foundation

import com.rouge41.kmm.compose.runtime.Composable
import androidx.compose.foundation.isSystemInDarkTheme as _isSystemInDarkTheme

@Composable
actual fun isSystemInDarkTheme(): Boolean = _isSystemInDarkTheme()
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.rouge41.kmm.compose.foundation

import com.rouge41.kmm.compose.foundation.layout.Arrangement
import com.rouge41.kmm.compose.foundation.layout.ArrangementVertical
import com.rouge41.kmm.compose.foundation.layout.ColumnScope
import com.rouge41.kmm.compose.foundation.layout.PaddingValues
import com.rouge41.kmm.compose.runtime.Composable
import com.rouge41.kmm.compose.ui.Alignment
import com.rouge41.kmm.compose.ui.AlignmentHorizontal
import com.rouge41.kmm.compose.ui.Modifier
import com.rouge41.kmm.compose.ui.unit.dp
import androidx.compose.foundation.rememberScrollState as _rememberScrollState
import androidx.compose.foundation.ScrollableColumn as _ScrollableColumn

actual typealias ScrollState = androidx.compose.foundation.ScrollState

@Composable
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
actual fun ScrollableColumn(
modifier: Modifier = Modifier,
scrollState: ScrollState = rememberScrollState(0f),
verticalArrangement: ArrangementVertical = Arrangement.Top,
horizontalAlignment: AlignmentHorizontal = Alignment.Start,
reverseScrollDirection: Boolean = false,
isScrollEnabled: Boolean = true,
contentPadding: PaddingValues = PaddingValues(0.dp),
content: @Composable ColumnScope.() -> Unit
) {
_ScrollableColumn(modifier = modifier, scrollState = scrollState, verticalArrangement = verticalArrangement, horizontalAlignment = horizontalAlignment,
reverseScrollDirection = reverseScrollDirection, isScrollEnabled = isScrollEnabled, contentPadding = contentPadding, content = content)
}

@Composable
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
actual fun rememberScrollState(
initial: Float = 0f,
interactionState: InteractionState? = null
): ScrollState = _rememberScrollState(initial = initial, interactionState = interactionState)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.rouge41.kmm.compose
package com.rouge41.kmm.compose.foundation.layout

import androidx.compose.foundation.layout.InternalLayoutApi

Expand Down
Loading

0 comments on commit 89159c1

Please sign in to comment.