mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
Remove internal from common public @Composable as it is not required for 1.4.0-rc03 (#3008)
This commit is contained in:
@@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
|
||||
kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
# Enable kotlin/native experimental memory model
|
||||
kotlin.native.binary.memoryModel=experimental
|
||||
kotlin.version=1.8.0
|
||||
kotlin.version=1.8.20
|
||||
agp.version=7.1.3
|
||||
compose.version=1.4.0-rc01
|
||||
compose.version=1.4.0-rc03
|
||||
|
||||
@@ -18,7 +18,7 @@ val friendMessages = listOf(
|
||||
val store = CoroutineScope(SupervisorJob()).createStore()
|
||||
|
||||
@Composable
|
||||
internal fun ChatAppWithScaffold(displayTextField: Boolean = true) {
|
||||
fun ChatAppWithScaffold(displayTextField: Boolean = true) {
|
||||
Theme {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
@@ -33,7 +33,7 @@ internal fun ChatAppWithScaffold(displayTextField: Boolean = true) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun ChatApp(displayTextField: Boolean = true) {
|
||||
fun ChatApp(displayTextField: Boolean = true) {
|
||||
val state by store.stateFlow.collectAsState()
|
||||
Theme {
|
||||
Surface {
|
||||
@@ -74,7 +74,7 @@ internal fun ChatApp(displayTextField: Boolean = true) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Theme(content: @Composable () -> Unit) {
|
||||
fun Theme(content: @Composable () -> Unit) {
|
||||
MaterialTheme(
|
||||
colors = darkColors(
|
||||
surface = Color(ChatColors.SURFACE),
|
||||
|
||||
@@ -17,7 +17,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
internal fun SendMessage(sendMessage: (String) -> Unit) {
|
||||
fun SendMessage(sendMessage: (String) -> Unit) {
|
||||
var inputText by remember { mutableStateOf("") }
|
||||
TextField(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
|
||||
@@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
|
||||
kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
# Enable kotlin/native experimental memory model
|
||||
kotlin.native.binary.memoryModel=experimental
|
||||
kotlin.version=1.8.0
|
||||
kotlin.version=1.8.20
|
||||
agp.version=7.1.3
|
||||
compose.version=1.4.0-rc01
|
||||
compose.version=1.4.0-rc03
|
||||
|
||||
@@ -6,4 +6,4 @@ import androidx.compose.ui.text.font.FontStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
|
||||
@Composable
|
||||
internal expect fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font
|
||||
expect fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font
|
||||
@@ -7,13 +7,13 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.Dp
|
||||
|
||||
@Composable
|
||||
internal expect fun VerticalScrollbar(
|
||||
expect fun VerticalScrollbar(
|
||||
modifier: Modifier,
|
||||
scrollState: ScrollState
|
||||
)
|
||||
|
||||
@Composable
|
||||
internal expect fun VerticalScrollbar(
|
||||
expect fun VerticalScrollbar(
|
||||
modifier: Modifier,
|
||||
scrollState: LazyListState
|
||||
)
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.codeviewer.util.SplitterState
|
||||
import org.jetbrains.codeviewer.util.VerticalSplittable
|
||||
|
||||
@Composable
|
||||
internal fun CodeViewerView(model: CodeViewer) {
|
||||
fun CodeViewerView(model: CodeViewer) {
|
||||
val panelState = remember { PanelState() }
|
||||
|
||||
val animatedSize = if (panelState.splitter.isResizing) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.jetbrains.codeviewer.ui.editor.Editors
|
||||
import org.jetbrains.codeviewer.ui.filetree.FileTree
|
||||
|
||||
@Composable
|
||||
internal fun MainView() {
|
||||
fun MainView() {
|
||||
val codeViewer = remember {
|
||||
val editors = Editors()
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.jetbrains.codeviewer.platform.font
|
||||
|
||||
object Fonts {
|
||||
@Composable
|
||||
internal fun jetbrainsMono() = FontFamily(
|
||||
fun jetbrainsMono() = FontFamily(
|
||||
font(
|
||||
"JetBrains Mono",
|
||||
"jetbrainsmono_regular",
|
||||
|
||||
@@ -16,7 +16,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
@Composable
|
||||
internal fun EditorEmptyView() = Box(Modifier.fillMaxSize()) {
|
||||
fun EditorEmptyView() = Box(Modifier.fillMaxSize()) {
|
||||
Column(Modifier.align(Alignment.Center)) {
|
||||
Icon(
|
||||
Icons.Default.Code,
|
||||
|
||||
@@ -24,14 +24,14 @@ import androidx.compose.ui.unit.sp
|
||||
import org.jetbrains.codeviewer.ui.common.AppTheme
|
||||
|
||||
@Composable
|
||||
internal fun EditorTabsView(model: Editors) = Row(Modifier.horizontalScroll(rememberScrollState())) {
|
||||
fun EditorTabsView(model: Editors) = Row(Modifier.horizontalScroll(rememberScrollState())) {
|
||||
for (editor in model.editors) {
|
||||
EditorTabView(editor)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun EditorTabView(model: Editor) = Surface(
|
||||
fun EditorTabView(model: Editor) = Surface(
|
||||
color = if (model.isActive) {
|
||||
AppTheme.colors.backgroundDark
|
||||
} else {
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.jetbrains.codeviewer.util.withoutWidthConstraints
|
||||
import kotlin.text.Regex.Companion.fromLiteral
|
||||
|
||||
@Composable
|
||||
internal fun EditorView(model: Editor, settings: Settings) = key(model) {
|
||||
fun EditorView(model: Editor, settings: Settings) = key(model) {
|
||||
with (LocalDensity.current) {
|
||||
SelectionContainer {
|
||||
Surface(
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.codeviewer.platform.VerticalScrollbar
|
||||
import org.jetbrains.codeviewer.util.withoutWidthConstraints
|
||||
|
||||
@Composable
|
||||
internal fun FileTreeViewTabView() = Surface {
|
||||
fun FileTreeViewTabView() = Surface {
|
||||
Row(
|
||||
Modifier.padding(8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
@@ -46,7 +46,7 @@ internal fun FileTreeViewTabView() = Surface {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun FileTreeView(model: FileTree) = Surface(
|
||||
fun FileTreeView(model: FileTree) = Surface(
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
with(LocalDensity.current) {
|
||||
|
||||
@@ -16,7 +16,7 @@ private val MinFontSize = 6.sp
|
||||
private val MaxFontSize = 40.sp
|
||||
|
||||
@Composable
|
||||
internal fun StatusBar(settings: Settings) = Box(
|
||||
fun StatusBar(settings: Settings) = Box(
|
||||
Modifier
|
||||
.height(32.dp)
|
||||
.fillMaxWidth()
|
||||
|
||||
@@ -5,14 +5,14 @@ import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
||||
@Composable
|
||||
internal fun <T : Any> loadable(load: () -> T): MutableState<T?> {
|
||||
fun <T : Any> loadable(load: () -> T): MutableState<T?> {
|
||||
return loadableScoped { load() }
|
||||
}
|
||||
|
||||
private val loadingKey = Any()
|
||||
|
||||
@Composable
|
||||
internal fun <T : Any> loadableScoped(load: CoroutineScope.() -> T): MutableState<T?> {
|
||||
fun <T : Any> loadableScoped(load: CoroutineScope.() -> T): MutableState<T?> {
|
||||
val state: MutableState<T?> = remember { mutableStateOf(null) }
|
||||
LaunchedEffect(loadingKey) {
|
||||
try {
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.jetbrains.codeviewer.platform.cursorForHorizontalResize
|
||||
import org.jetbrains.codeviewer.ui.common.AppTheme
|
||||
|
||||
@Composable
|
||||
internal fun VerticalSplittable(
|
||||
fun VerticalSplittable(
|
||||
modifier: Modifier,
|
||||
splitterState: SplitterState,
|
||||
onResize: (delta: Dp) -> Unit,
|
||||
@@ -57,7 +57,7 @@ class SplitterState {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun VerticalSplitter(
|
||||
fun VerticalSplitter(
|
||||
splitterState: SplitterState,
|
||||
onResize: (delta: Dp) -> Unit,
|
||||
color: Color = AppTheme.colors.backgroundDark
|
||||
|
||||
@@ -13,7 +13,7 @@ private val cache: MutableMap<String, Font> = mutableMapOf()
|
||||
|
||||
@OptIn(ExperimentalResourceApi::class)
|
||||
@Composable
|
||||
internal actual fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font {
|
||||
actual fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font {
|
||||
return cache.getOrPut(res) {
|
||||
val byteArray = runBlocking {
|
||||
resource("font/$res.ttf").readBytes()
|
||||
|
||||
@@ -6,13 +6,13 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
@Composable
|
||||
internal actual fun VerticalScrollbar(
|
||||
actual fun VerticalScrollbar(
|
||||
modifier: Modifier,
|
||||
scrollState: ScrollState
|
||||
) = Unit
|
||||
|
||||
@Composable
|
||||
internal actual fun VerticalScrollbar(
|
||||
actual fun VerticalScrollbar(
|
||||
modifier: Modifier,
|
||||
scrollState: LazyListState
|
||||
) = Unit
|
||||
@@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
|
||||
kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
# Enable kotlin/native experimental memory model
|
||||
kotlin.native.binary.memoryModel=experimental
|
||||
kotlin.version=1.8.0
|
||||
kotlin.version=1.8.20
|
||||
agp.version=7.1.3
|
||||
compose.version=1.4.0-rc01
|
||||
compose.version=1.4.0-rc03
|
||||
|
||||
@@ -43,7 +43,7 @@ private var areaWidth = 0
|
||||
private var areaHeight = 0
|
||||
|
||||
@Composable
|
||||
internal fun BouncingBallsApp(initialBallsCount: Int = 5) {
|
||||
fun BouncingBallsApp(initialBallsCount: Int = 5) {
|
||||
val items = remember {
|
||||
val list = mutableStateListOf<BouncingBall>()
|
||||
list.addAll(generateSequence {
|
||||
|
||||
@@ -15,7 +15,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
@Composable
|
||||
internal fun FallingBalls(game: Game) {
|
||||
fun FallingBalls(game: Game) {
|
||||
val density = LocalDensity.current
|
||||
Column {
|
||||
Text(
|
||||
|
||||
@@ -20,7 +20,7 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
internal fun Piece(index: Int, piece: PieceData) {
|
||||
fun Piece(index: Int, piece: PieceData) {
|
||||
val boxSize = 40.dp
|
||||
Box(
|
||||
Modifier
|
||||
|
||||
@@ -11,6 +11,6 @@ kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
kotlin.native.useEmbeddableCompilerJar=true
|
||||
# Enable kotlin/native experimental memory model
|
||||
kotlin.native.binary.memoryModel=experimental
|
||||
kotlin.version=1.8.10
|
||||
kotlin.version=1.8.20
|
||||
agp.version=7.1.3
|
||||
compose.version=1.4.0-rc01
|
||||
compose.version=1.4.0-rc03
|
||||
|
||||
@@ -27,7 +27,7 @@ actual fun blurFilter(bitmap: ImageBitmap, context: PlatformContext): ImageBitma
|
||||
actual class PlatformContext(val androidContext: Context)
|
||||
|
||||
@Composable
|
||||
internal actual fun getPlatformContext(): PlatformContext = PlatformContext(LocalContext.current)
|
||||
actual fun getPlatformContext(): PlatformContext = PlatformContext(LocalContext.current)
|
||||
|
||||
|
||||
private fun applyBlurFilter(bitmap: Bitmap, context: Context): Bitmap {
|
||||
|
||||
@@ -48,7 +48,7 @@ private val executor = Executors.newSingleThreadExecutor()
|
||||
|
||||
@OptIn(ExperimentalPermissionsApi::class)
|
||||
@Composable
|
||||
internal actual fun CameraView(
|
||||
actual fun CameraView(
|
||||
modifier: Modifier,
|
||||
onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit
|
||||
) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
@Composable
|
||||
internal actual fun BoxScope.EditMemoryDialog(
|
||||
actual fun BoxScope.EditMemoryDialog(
|
||||
previousName: String,
|
||||
previousDescription: String,
|
||||
save: (name: String, description: String) -> Unit
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.google.maps.android.compose.rememberCameraPositionState
|
||||
import example.imageviewer.model.GpsPosition
|
||||
|
||||
@Composable
|
||||
internal actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
|
||||
actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
|
||||
val currentLocation = LatLng(gps.latitude, gps.longitude)
|
||||
val cameraPositionState = rememberCameraPositionState {
|
||||
position = CameraPosition.fromLatLngZoom(currentLocation, 10f)
|
||||
|
||||
@@ -4,5 +4,5 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
@Composable
|
||||
internal actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) =
|
||||
actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) =
|
||||
TouchScrollableColumn(modifier, content)
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
@Composable
|
||||
internal actual fun Tooltip(
|
||||
actual fun Tooltip(
|
||||
text: String,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
|
||||
@@ -6,6 +6,6 @@ import example.imageviewer.model.ScalableState
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
@Composable
|
||||
internal actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
|
||||
actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
|
||||
// No need for additional ZoomControllerView for Android
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ enum class ExternalImageViewerEvent {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun ImageViewerCommon(
|
||||
fun ImageViewerCommon(
|
||||
dependencies: Dependencies
|
||||
) {
|
||||
CompositionLocalProvider(
|
||||
@@ -30,7 +30,7 @@ internal fun ImageViewerCommon(
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
internal fun ImageViewerWithProvidedDependencies(
|
||||
fun ImageViewerWithProvidedDependencies(
|
||||
pictures: SnapshotStateList<PictureData>
|
||||
) {
|
||||
val selectedPictureIndex = remember { mutableStateOf(0) }
|
||||
|
||||
@@ -10,7 +10,7 @@ class NameAndDescription(
|
||||
)
|
||||
|
||||
@Composable
|
||||
internal fun createNewPhotoNameAndDescription(): NameAndDescription {
|
||||
fun createNewPhotoNameAndDescription(): NameAndDescription {
|
||||
val localization = LocalLocalization.current
|
||||
return remember {
|
||||
|
||||
|
||||
@@ -17,4 +17,4 @@ expect fun blurFilter(bitmap: ImageBitmap, context: PlatformContext): ImageBitma
|
||||
expect class PlatformContext
|
||||
|
||||
@Composable
|
||||
internal expect fun getPlatformContext(): PlatformContext
|
||||
expect fun getPlatformContext(): PlatformContext
|
||||
|
||||
@@ -48,7 +48,7 @@ object ImageviewerColors {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun ImageViewerTheme(content: @Composable () -> Unit) {
|
||||
fun ImageViewerTheme(content: @Composable () -> Unit) {
|
||||
isSystemInDarkTheme() // todo check and change colors
|
||||
MaterialTheme(
|
||||
colors = MaterialTheme.colors.copy(
|
||||
|
||||
@@ -10,7 +10,7 @@ import example.imageviewer.LocalImageProvider
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
@Composable
|
||||
internal fun CameraScreen(onBack: (resetSelectedPicture: Boolean) -> Unit) {
|
||||
fun CameraScreen(onBack: (resetSelectedPicture: Boolean) -> Unit) {
|
||||
val imageProvider = LocalImageProvider.current
|
||||
var showCamera by remember { mutableStateOf(false) }
|
||||
LaunchedEffect(onBack) {
|
||||
|
||||
@@ -7,4 +7,4 @@ import example.imageviewer.PlatformStorableImage
|
||||
import example.imageviewer.model.PictureData
|
||||
|
||||
@Composable
|
||||
internal expect fun CameraView(modifier: Modifier, onCapture: (picture: PictureData.Camera, image: PlatformStorableImage)->Unit)
|
||||
expect fun CameraView(modifier: Modifier, onCapture: (picture: PictureData.Camera, image: PlatformStorableImage)->Unit)
|
||||
|
||||
@@ -18,7 +18,7 @@ import example.imageviewer.icon.IconCustomArrowBack
|
||||
import example.imageviewer.style.ImageviewerColors
|
||||
|
||||
@Composable
|
||||
internal fun CircularButton(
|
||||
fun CircularButton(
|
||||
content: @Composable () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean,
|
||||
@@ -41,7 +41,7 @@ internal fun CircularButton(
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun CircularButton(
|
||||
fun CircularButton(
|
||||
imageVector: ImageVector,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
@@ -58,7 +58,7 @@ internal fun CircularButton(
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun BackButton(onClick: () -> Unit) {
|
||||
fun BackButton(onClick: () -> Unit) {
|
||||
Tooltip(LocalLocalization.current.back) {
|
||||
CircularButton(
|
||||
imageVector = IconCustomArrowBack,
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.BoxScope
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
@Composable
|
||||
internal expect fun BoxScope.EditMemoryDialog(
|
||||
expect fun BoxScope.EditMemoryDialog(
|
||||
previousName: String,
|
||||
previousDescription: String,
|
||||
save: (name: String, description: String) -> Unit
|
||||
|
||||
@@ -25,7 +25,7 @@ import example.imageviewer.model.*
|
||||
import example.imageviewer.style.*
|
||||
|
||||
@Composable
|
||||
internal fun FullscreenImageScreen(
|
||||
fun FullscreenImageScreen(
|
||||
picture: PictureData,
|
||||
back: () -> Unit,
|
||||
) {
|
||||
|
||||
@@ -47,7 +47,7 @@ enum class GalleryStyle {
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
internal fun GalleryScreen(
|
||||
fun GalleryScreen(
|
||||
pictures: SnapshotStateList<PictureData>,
|
||||
selectedPictureIndex: MutableState<Int>,
|
||||
onClickPreviewPicture: (PictureData) -> Unit,
|
||||
@@ -195,7 +195,7 @@ private fun SquaresGalleryView(
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun SquareThumbnail(
|
||||
fun SquareThumbnail(
|
||||
picture: PictureData,
|
||||
isHighlighted: Boolean,
|
||||
onClick: () -> Unit
|
||||
|
||||
@@ -5,4 +5,4 @@ import androidx.compose.ui.Modifier
|
||||
import example.imageviewer.model.GpsPosition
|
||||
|
||||
@Composable
|
||||
internal expect fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String)
|
||||
expect fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String)
|
||||
@@ -41,7 +41,7 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
|
||||
import org.jetbrains.compose.resources.painterResource
|
||||
|
||||
@Composable
|
||||
internal fun MemoryScreen(
|
||||
fun MemoryScreen(
|
||||
pictures: SnapshotStateList<PictureData>,
|
||||
memoryPage: MemoryPage,
|
||||
onSelectRelatedMemory: (PictureData) -> Unit,
|
||||
@@ -181,7 +181,7 @@ private fun MemoryHeader(bitmap: ImageBitmap, picture: PictureData, onClick: ()
|
||||
|
||||
@OptIn(ExperimentalResourceApi::class)
|
||||
@Composable
|
||||
internal fun BoxScope.MagicButtonOverlay(onClick: () -> Unit) {
|
||||
fun BoxScope.MagicButtonOverlay(onClick: () -> Unit) {
|
||||
Column(
|
||||
modifier = Modifier.align(Alignment.BottomEnd).padding(12.dp)
|
||||
) {
|
||||
@@ -193,7 +193,7 @@ internal fun BoxScope.MagicButtonOverlay(onClick: () -> Unit) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun BoxScope.MemoryTextOverlay(picture: PictureData) {
|
||||
fun BoxScope.MemoryTextOverlay(picture: PictureData) {
|
||||
val shadowTextStyle = LocalTextStyle.current.copy(
|
||||
shadow = Shadow(
|
||||
color = Color.Black.copy(0.75f),
|
||||
@@ -228,7 +228,7 @@ internal fun BoxScope.MemoryTextOverlay(picture: PictureData) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Collapsible(s: String) {
|
||||
fun Collapsible(s: String) {
|
||||
val interctionSource = remember { MutableInteractionSource() }
|
||||
var isCollapsed by remember { mutableStateOf(true) }
|
||||
val text = if (isCollapsed) s.lines().first() + "... (see more)" else s
|
||||
@@ -254,7 +254,7 @@ internal fun Collapsible(s: String) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Headliner(s: String) {
|
||||
fun Headliner(s: String) {
|
||||
Text(
|
||||
text = s,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
@@ -265,7 +265,7 @@ internal fun Headliner(s: String) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun RelatedMemoriesVisualizer(
|
||||
fun RelatedMemoriesVisualizer(
|
||||
pictures: List<PictureData>,
|
||||
onSelectRelatedMemory: (PictureData) -> Unit
|
||||
) {
|
||||
@@ -284,7 +284,7 @@ internal fun RelatedMemoriesVisualizer(
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun RelatedMemory(
|
||||
fun RelatedMemory(
|
||||
galleryEntry: PictureData,
|
||||
onSelectRelatedMemory: (PictureData) -> Unit
|
||||
) {
|
||||
|
||||
@@ -31,7 +31,7 @@ private const val INITIAL_ZOOM = 1.0f
|
||||
private const val SLIGHTLY_INCREASED_ZOOM = 1.5f
|
||||
|
||||
@Composable
|
||||
internal fun ScalableImage(scalableState: ScalableState, image: ImageBitmap, modifier: Modifier = Modifier) {
|
||||
fun ScalableImage(scalableState: ScalableState, image: ImageBitmap, modifier: Modifier = Modifier) {
|
||||
BoxWithConstraints {
|
||||
val areaSize = areaSize
|
||||
val imageSize = image.size
|
||||
|
||||
@@ -7,10 +7,10 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
@Composable
|
||||
internal expect fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit)
|
||||
expect fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit)
|
||||
|
||||
@Composable
|
||||
internal fun TouchScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) {
|
||||
fun TouchScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) {
|
||||
val scrollState = rememberScrollState()
|
||||
Column(modifier.verticalScroll(scrollState)) {
|
||||
content()
|
||||
|
||||
@@ -26,7 +26,7 @@ import example.imageviewer.icon.IconMoreVert
|
||||
import example.imageviewer.model.PictureData
|
||||
|
||||
@Composable
|
||||
internal fun Thumbnail(
|
||||
fun Thumbnail(
|
||||
picture: PictureData,
|
||||
onClickSelect: () -> Unit,
|
||||
onClickFullScreen: () -> Unit,
|
||||
|
||||
@@ -9,7 +9,7 @@ import example.imageviewer.LocalImageProvider
|
||||
import example.imageviewer.model.PictureData
|
||||
|
||||
@Composable
|
||||
internal fun ThumbnailImage(
|
||||
fun ThumbnailImage(
|
||||
modifier: Modifier,
|
||||
picture: PictureData,
|
||||
filter: (ImageBitmap) -> ImageBitmap = remember { { it } },
|
||||
|
||||
@@ -24,7 +24,7 @@ sealed interface ToastState {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Toast(
|
||||
fun Toast(
|
||||
state: MutableState<ToastState>
|
||||
) {
|
||||
val value = state.value
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
@Composable
|
||||
internal expect fun Tooltip(
|
||||
expect fun Tooltip(
|
||||
text: String,
|
||||
content: @Composable () -> Unit
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ import androidx.compose.ui.unit.dp
|
||||
import example.imageviewer.notchPadding
|
||||
|
||||
@Composable
|
||||
internal fun TopLayout(
|
||||
fun TopLayout(
|
||||
alignLeftContent: @Composable () -> Unit = {},
|
||||
alignRightContent: @Composable () -> Unit = {},
|
||||
) {
|
||||
|
||||
@@ -6,4 +6,4 @@ import androidx.compose.ui.Modifier
|
||||
import example.imageviewer.model.ScalableState
|
||||
|
||||
@Composable
|
||||
internal expect fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState)
|
||||
expect fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState)
|
||||
|
||||
@@ -24,9 +24,9 @@ actual fun blurFilter(bitmap: ImageBitmap, context: PlatformContext): ImageBitma
|
||||
actual class PlatformContext
|
||||
|
||||
@Composable
|
||||
internal actual fun getPlatformContext(): PlatformContext = PlatformContext()
|
||||
actual fun getPlatformContext(): PlatformContext = PlatformContext()
|
||||
|
||||
internal fun scaleBitmapAspectRatio(
|
||||
fun scaleBitmapAspectRatio(
|
||||
bitmap: BufferedImage,
|
||||
width: Int,
|
||||
height: Int
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.*
|
||||
|
||||
@OptIn(ExperimentalResourceApi::class)
|
||||
@Composable
|
||||
internal actual fun CameraView(
|
||||
actual fun CameraView(
|
||||
modifier: Modifier,
|
||||
onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit
|
||||
) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import androidx.compose.ui.unit.sp
|
||||
|
||||
@OptIn(ExperimentalMaterialApi::class)
|
||||
@Composable
|
||||
internal actual fun BoxScope.EditMemoryDialog(
|
||||
actual fun BoxScope.EditMemoryDialog(
|
||||
previousName: String,
|
||||
previousDescription: String,
|
||||
save: (name: String, description: String) -> Unit
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.jetbrains.compose.resources.painterResource
|
||||
|
||||
@OptIn(ExperimentalResourceApi::class)
|
||||
@Composable
|
||||
internal actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
|
||||
actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
|
||||
Image(
|
||||
painter = painterResource("dummy_map.png"),
|
||||
contentDescription = "Map",
|
||||
|
||||
@@ -14,7 +14,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
internal actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) {
|
||||
actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) {
|
||||
val scrollState = rememberScrollState()
|
||||
Modifier.verticalScroll(scrollState)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import androidx.compose.ui.unit.dp
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
internal actual fun Tooltip(
|
||||
actual fun Tooltip(
|
||||
text: String,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import androidx.compose.ui.unit.dp
|
||||
import example.imageviewer.model.ScalableState
|
||||
|
||||
@Composable
|
||||
internal actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
|
||||
actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
|
||||
Slider(
|
||||
modifier = modifier.fillMaxWidth(0.5f).padding(12.dp),
|
||||
value = scalableState.zoom,
|
||||
|
||||
@@ -21,7 +21,7 @@ actual fun blurFilter(bitmap: ImageBitmap, context: PlatformContext): ImageBitma
|
||||
actual class PlatformContext
|
||||
|
||||
@Composable
|
||||
internal actual fun getPlatformContext(): PlatformContext = PlatformContext()
|
||||
actual fun getPlatformContext(): PlatformContext = PlatformContext()
|
||||
|
||||
private fun scaleBitmapAspectRatio(
|
||||
bitmap: Bitmap,
|
||||
|
||||
@@ -54,7 +54,7 @@ private val deviceTypes = listOf(
|
||||
)
|
||||
|
||||
@Composable
|
||||
internal actual fun CameraView(
|
||||
actual fun CameraView(
|
||||
modifier: Modifier,
|
||||
onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit
|
||||
) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
@Composable
|
||||
internal actual fun BoxScope.EditMemoryDialog(
|
||||
actual fun BoxScope.EditMemoryDialog(
|
||||
previousName: String,
|
||||
previousDescription: String,
|
||||
save: (name: String, description: String) -> Unit
|
||||
|
||||
@@ -11,7 +11,7 @@ import platform.MapKit.MKMapView
|
||||
import platform.MapKit.MKPointAnnotation
|
||||
|
||||
@Composable
|
||||
internal actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
|
||||
actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
|
||||
val location = CLLocationCoordinate2DMake(gps.latitude, gps.longitude)
|
||||
val annotation = remember {
|
||||
MKPointAnnotation(
|
||||
|
||||
@@ -4,5 +4,5 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
@Composable
|
||||
internal actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) =
|
||||
actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) =
|
||||
TouchScrollableColumn(modifier, content)
|
||||
|
||||
@@ -3,7 +3,7 @@ package example.imageviewer.view
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
@Composable
|
||||
internal actual fun Tooltip(
|
||||
actual fun Tooltip(
|
||||
text: String,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
|
||||
@@ -5,6 +5,6 @@ import androidx.compose.ui.Modifier
|
||||
import example.imageviewer.model.ScalableState
|
||||
|
||||
@Composable
|
||||
internal actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
|
||||
actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
|
||||
// No need for additional ZoomControllerView for iOS
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
|
||||
kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
# Enable kotlin/native experimental memory model
|
||||
kotlin.native.binary.memoryModel=experimental
|
||||
kotlin.version=1.8.0
|
||||
kotlin.version=1.8.20
|
||||
agp.version=7.1.3
|
||||
compose.version=1.4.0-rc01
|
||||
compose.version=1.4.0-rc03
|
||||
|
||||
@@ -10,7 +10,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
@Composable
|
||||
internal fun BoardView(game: GameController) = with(GameStyles) {
|
||||
fun BoardView(game: GameController) = with(GameStyles) {
|
||||
Column {
|
||||
for (row in 0 until game.rows) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
|
||||
@@ -15,7 +15,7 @@ import kotlin.math.max
|
||||
|
||||
@OptIn(ExperimentalResourceApi::class)
|
||||
@Composable
|
||||
internal fun loadImage(res: String): Painter = painterResource(res)
|
||||
fun loadImage(res: String): Painter = painterResource(res)
|
||||
|
||||
expect fun hasRightClick(): Boolean
|
||||
|
||||
@@ -39,7 +39,7 @@ object GameStyles {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Game(requestWindowSize: ((width: Dp, height: Dp) -> Unit)? = null) = MainLayout {
|
||||
fun Game(requestWindowSize: ((width: Dp, height: Dp) -> Unit)? = null) = MainLayout {
|
||||
var message by remember { mutableStateOf<String?>(null) }
|
||||
|
||||
val onWin = { message = "You win!" }
|
||||
|
||||
@@ -6,7 +6,7 @@ import androidx.compose.ui.input.pointer.*
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
internal fun Modifier.gameInteraction(open: () -> Unit, flag: () -> Unit, seek: () -> Unit): Modifier =
|
||||
fun Modifier.gameInteraction(open: () -> Unit, flag: () -> Unit, seek: () -> Unit): Modifier =
|
||||
if (!hasRightClick()) {
|
||||
combinedClickable(
|
||||
onClick = {
|
||||
|
||||
@@ -17,7 +17,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
@Composable
|
||||
internal fun OpenedCell(cell: Cell) {
|
||||
fun OpenedCell(cell: Cell) {
|
||||
Text(
|
||||
text = cell.bombsNear.toString(),
|
||||
textAlign = TextAlign.Center,
|
||||
@@ -28,7 +28,7 @@ internal fun OpenedCell(cell: Cell) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun CellWithIcon(src: String, alt: String) {
|
||||
fun CellWithIcon(src: String, alt: String) {
|
||||
Image(
|
||||
painter = loadImage(src),
|
||||
contentDescription = alt,
|
||||
@@ -37,17 +37,17 @@ internal fun CellWithIcon(src: String, alt: String) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Mine() {
|
||||
fun Mine() {
|
||||
CellWithIcon(src = "assets/mine.png", alt = "Bomb")
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Flag() {
|
||||
fun Flag() {
|
||||
CellWithIcon(src = "assets/flag.png", alt = "Flag")
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun IndicatorWithIcon(iconPath: String, alt: String, value: Int) {
|
||||
fun IndicatorWithIcon(iconPath: String, alt: String, value: Int) {
|
||||
Box(modifier = Modifier.background(Color(0x8e, 0x6e, 0x0e))) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Box(modifier = Modifier.size(40.dp, 40.dp)) {
|
||||
@@ -66,7 +66,7 @@ internal fun IndicatorWithIcon(iconPath: String, alt: String, value: Int) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun NewGameButton(text: String, onClick: () -> Unit) {
|
||||
fun NewGameButton(text: String, onClick: () -> Unit) {
|
||||
Box(
|
||||
Modifier
|
||||
.background(color = Color(0x42, 0x8e, 0x04))
|
||||
|
||||
@@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
|
||||
kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
# Enable kotlin/native experimental memory model
|
||||
kotlin.native.binary.memoryModel=experimental
|
||||
kotlin.version=1.8.0
|
||||
kotlin.version=1.8.20
|
||||
agp.version=7.1.3
|
||||
compose.version=1.4.0-rc01
|
||||
compose.version=1.4.0-rc03
|
||||
|
||||
@@ -6,7 +6,7 @@ import androidx.compose.ui.Modifier
|
||||
import example.todoapp.lite.common.RootStore.RootState
|
||||
|
||||
@Composable
|
||||
internal fun RootContent(modifier: Modifier = Modifier) {
|
||||
fun RootContent(modifier: Modifier = Modifier) {
|
||||
val model = remember { RootStore() }
|
||||
val state = model.state
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ kotlin.native.cacheKind=none
|
||||
kotlin.native.useEmbeddableCompilerJar=true
|
||||
# Enable kotlin/native experimental memory model
|
||||
kotlin.native.binary.memoryModel=experimental
|
||||
kotlin.version=1.8.0
|
||||
kotlin.version=1.8.20
|
||||
agp.version=7.1.3
|
||||
compose.version=1.4.0-rc01
|
||||
compose.version=1.4.0-rc03
|
||||
|
||||
@@ -14,7 +14,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
@Composable
|
||||
internal fun SampleWithTopAppBar(sample: Screen, state: MutableState<Screen>, content: @Composable (PaddingValues) -> Unit) {
|
||||
fun SampleWithTopAppBar(sample: Screen, state: MutableState<Screen>, content: @Composable (PaddingValues) -> Unit) {
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
@@ -44,7 +44,7 @@ enum class Screen(val screen: String) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun MyButton(screenState: MutableState<Screen>, to: Screen) {
|
||||
fun MyButton(screenState: MutableState<Screen>, to: Screen) {
|
||||
Button(onClick = {
|
||||
screenState.value = to
|
||||
}) {
|
||||
@@ -53,7 +53,7 @@ internal fun MyButton(screenState: MutableState<Screen>, to: Screen) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun AllSamplesView() {
|
||||
fun AllSamplesView() {
|
||||
MaterialTheme {
|
||||
val screenState: MutableState<Screen> = remember { mutableStateOf(Screen.CHOOSE_SAMPLE) }
|
||||
when (screenState.value) {
|
||||
|
||||
@@ -110,7 +110,7 @@ class DoubleRocket(val particle: Particle) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun draw() {
|
||||
fun draw() {
|
||||
if (state == rocket.STATE_ROCKET) {
|
||||
particle.draw()
|
||||
} else {
|
||||
@@ -163,7 +163,7 @@ class Rocket(val particle: Particle, val color: Color, val startTime: Long = 0)
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun draw() {
|
||||
fun draw() {
|
||||
if (!exploded) {
|
||||
particle.draw()
|
||||
} else {
|
||||
@@ -185,7 +185,7 @@ class Particle(var x: Double, var y: Double, var vx: Double, var vy: Double, val
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun draw() {
|
||||
fun draw() {
|
||||
val alphaFactor = if (type == 0) 1.0f else 1 / (1 + abs(vy / 5)).toFloat()
|
||||
Box(Modifier.size(5.dp).offset(x.dp, y.dp).alpha(alphaFactor).clip(CircleShape).background(color))
|
||||
for (i in 1..5) {
|
||||
@@ -229,7 +229,7 @@ fun prepareStarsAndSnowFlakes(stars: SnapshotStateList<Star>, snowFlakes: Snapsh
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
internal fun NYContent() {
|
||||
fun NYContent() {
|
||||
var time by remember { mutableStateOf(nanoTime()) }
|
||||
var started by remember { mutableStateOf(false) }
|
||||
var startTime = remember { nanoTime() }
|
||||
@@ -371,20 +371,20 @@ fun flickeringAlpha(time: Long): Float {
|
||||
|
||||
|
||||
@Composable
|
||||
internal fun starrySky(stars: SnapshotStateList<Star>) {
|
||||
fun starrySky(stars: SnapshotStateList<Star>) {
|
||||
stars.forEach {
|
||||
star(it.x, it.y, it.color, size = it.size)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun star(x: Dp, y: Dp, color: Color = Color.White, size: Dp) {
|
||||
fun star(x: Dp, y: Dp, color: Color = Color.White, size: Dp) {
|
||||
Box(Modifier.offset(x, y).scale(1.0f, 0.2f).rotate(45f).size(size).background(color))
|
||||
Box(Modifier.offset(x, y).scale(0.2f, 1.0f).rotate(45f).size(size).background(color))
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun snow(time: Long, prevTime: Long, snowFlakes: SnapshotStateList<SnowFlake>, startTime: Long) {
|
||||
fun snow(time: Long, prevTime: Long, snowFlakes: SnapshotStateList<SnowFlake>, startTime: Long) {
|
||||
val deltaAngle = (time - startTime) / 100000000
|
||||
with(LocalDensity.current) {
|
||||
snowFlakes.forEach {
|
||||
@@ -400,7 +400,7 @@ internal fun snow(time: Long, prevTime: Long, snowFlakes: SnapshotStateList<Snow
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun snowFlake(modifier: Modifier, alpha: Float = 0.8f) {
|
||||
fun snowFlake(modifier: Modifier, alpha: Float = 0.8f) {
|
||||
Box(modifier) {
|
||||
snowFlakeInt(0, 0f, 30.dp, 0.dp, alpha)
|
||||
snowFlakeInt(0, 60f, 15.dp, 25.dp, alpha)
|
||||
@@ -413,7 +413,7 @@ internal fun snowFlake(modifier: Modifier, alpha: Float = 0.8f) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun snowFlakeInt(level: Int, angle: Float, shiftX: Dp, shiftY: Dp, alpha: Float) {
|
||||
fun snowFlakeInt(level: Int, angle: Float, shiftX: Dp, shiftY: Dp, alpha: Float) {
|
||||
if (level > 3) return
|
||||
Box(
|
||||
Modifier.offset(shiftX, shiftY).rotate(angle).width(100.dp).height(10.dp).scale(0.6f).alpha(1f)
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.jetbrains.compose.resources.painterResource
|
||||
|
||||
@OptIn(ExperimentalResourceApi::class)
|
||||
@Composable
|
||||
internal fun Words() {
|
||||
fun Words() {
|
||||
val duration = 5000
|
||||
|
||||
val infiniteTransition = rememberInfiniteTransition()
|
||||
@@ -84,7 +84,7 @@ internal fun Words() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Word(position: DpOffset, angle: Float, scale: Float, text: String,
|
||||
fun Word(position: DpOffset, angle: Float, scale: Float, text: String,
|
||||
color: Color, alpha: Float = 0.8f) {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
@@ -99,7 +99,7 @@ internal fun Word(position: DpOffset, angle: Float, scale: Float, text: String,
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun FallingSnow() {
|
||||
fun FallingSnow() {
|
||||
BoxWithConstraints(Modifier.fillMaxSize()) {
|
||||
repeat(50) {
|
||||
val size = remember { 20.dp + 10.dp * random() }
|
||||
@@ -134,14 +134,14 @@ internal fun FallingSnow() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Background() = Box(
|
||||
fun Background() = Box(
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.background(Color(0xFF6F97FF))
|
||||
)
|
||||
|
||||
@Composable
|
||||
internal fun RotatingWords() {
|
||||
fun RotatingWords() {
|
||||
Background()
|
||||
FallingSnow()
|
||||
Words()
|
||||
|
||||
@@ -18,7 +18,7 @@ import kotlin.math.*
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
internal fun WaveEffectGrid() {
|
||||
fun WaveEffectGrid() {
|
||||
var mouseX by remember { mutableStateOf(0) }
|
||||
var mouseY by remember { mutableStateOf(0) }
|
||||
var centerX by remember { mutableStateOf(1200) }
|
||||
@@ -93,7 +93,7 @@ internal fun WaveEffectGrid() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun HighPanel(mouseX: Int, mouseY: Int) {
|
||||
fun HighPanel(mouseX: Int, mouseY: Int) {
|
||||
Text(
|
||||
"Compose",
|
||||
Modifier.offset(270.dp, 600.dp).scale(7.0f).alpha(alpha(mouseX, mouseY, 270, 700)),
|
||||
@@ -148,7 +148,7 @@ private fun distance(x1: Int, y1: Int, x2: Int, y2: Int): Double {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Dot(size: Int, modifier: Modifier, color: Color, time: Long) {
|
||||
fun Dot(size: Int, modifier: Modifier, color: Color, time: Long) {
|
||||
Box(
|
||||
modifier.rotate(time.toFloat() / (15 * 10000000)).clip(RoundedCornerShape((3 + size / 20).dp))
|
||||
.size(width = size.dp, height = size.dp)
|
||||
|
||||
@@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
|
||||
kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
# Enable kotlin/native experimental memory model
|
||||
kotlin.native.binary.memoryModel=experimental
|
||||
kotlin.version=1.8.0
|
||||
kotlin.version=1.8.20
|
||||
agp.version=7.1.3
|
||||
compose.version=1.4.0-rc01
|
||||
compose.version=1.4.0-rc03
|
||||
|
||||
@@ -7,13 +7,13 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.Dp
|
||||
|
||||
@Composable
|
||||
internal expect fun VerticalScrollbar(
|
||||
expect fun VerticalScrollbar(
|
||||
modifier: Modifier,
|
||||
scrollState: ScrollState
|
||||
)
|
||||
|
||||
@Composable
|
||||
internal expect fun VerticalScrollbar(
|
||||
expect fun VerticalScrollbar(
|
||||
modifier: Modifier,
|
||||
scrollState: LazyListState,
|
||||
itemCount: Int,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package org.jetbrains.compose.demo.widgets.platform
|
||||
|
||||
internal expect fun isSystemInDarkTheme(): Boolean
|
||||
expect fun isSystemInDarkTheme(): Boolean
|
||||
@@ -115,7 +115,7 @@ enum class ColorPallet {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun WidgetGalleryTheme(
|
||||
fun WidgetGalleryTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
colorPallet: ColorPallet = GREEN,
|
||||
content: @Composable() () -> Unit,
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.jetbrains.compose.demo.widgets.ui.utils.VerticalSplittable
|
||||
import org.jetbrains.compose.demo.widgets.ui.utils.withoutWidthConstraints
|
||||
|
||||
@Composable
|
||||
internal fun MainView() {
|
||||
fun MainView() {
|
||||
WidgetGalleryTheme {
|
||||
Surface {
|
||||
WidgetsPanel()
|
||||
@@ -45,7 +45,7 @@ internal fun MainView() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun WidgetsPanel() {
|
||||
fun WidgetsPanel() {
|
||||
val widgetsTypeState = rememberSaveable { mutableStateOf(WidgetsType.sortedValues.first()) }
|
||||
val panelState = remember { PanelState() }
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import androidx.compose.ui.Modifier
|
||||
import org.jetbrains.compose.demo.widgets.ui.screens.*
|
||||
|
||||
@Composable
|
||||
internal fun WidgetsView(
|
||||
fun WidgetsView(
|
||||
widgetsTypeState: MutableState<WidgetsType>,
|
||||
modifier: Modifier
|
||||
) {
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.compose.demo.widgets.ui.utils.TitleText
|
||||
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
||||
|
||||
@Composable
|
||||
internal fun AppBars() {
|
||||
fun AppBars() {
|
||||
TopAppBarsDemo()
|
||||
BottomAppBarDemo()
|
||||
NavigationBarDemo()
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.jetbrains.compose.demo.widgets.theme.purple200
|
||||
import org.jetbrains.compose.demo.widgets.theme.typography
|
||||
|
||||
@Composable
|
||||
internal fun Buttons() {
|
||||
fun Buttons() {
|
||||
Column {
|
||||
Button(onClick = {}, modifier = Modifier.padding(8.dp)) {
|
||||
Text(text = "Main Button")
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.compose.demo.widgets.ui.utils.SubtitleText
|
||||
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
||||
|
||||
@Composable
|
||||
internal fun Chips() {
|
||||
fun Chips() {
|
||||
// There is no in-built chips but you can make yours like below
|
||||
SubtitleText(subtitle = "Custom chips with surface")
|
||||
Column(modifier = Modifier.padding(8.dp)) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
internal fun Loaders() {
|
||||
fun Loaders() {
|
||||
AlignedColumn {
|
||||
CircularProgressIndicator()
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import androidx.compose.ui.unit.dp
|
||||
import org.jetbrains.compose.demo.widgets.theme.typography
|
||||
|
||||
@Composable
|
||||
internal fun SnackBars() {
|
||||
fun SnackBars() {
|
||||
Snackbar(modifier = Modifier.padding(4.dp)) {
|
||||
Text(text = "This is a basic snackbar")
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import androidx.compose.ui.text.input.TextFieldValue
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
internal fun TextInputs() {
|
||||
fun TextInputs() {
|
||||
var text by remember { mutableStateOf(TextFieldValue("")) }
|
||||
|
||||
// TODO Explore CoreTextField
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.compose.demo.widgets.theme.typography
|
||||
import org.jetbrains.compose.demo.widgets.ui.utils.SubtitleText
|
||||
|
||||
@Composable
|
||||
internal fun TextViews() {
|
||||
fun TextViews() {
|
||||
Column {
|
||||
val textModifier = Modifier.padding(horizontal = 8.dp)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
internal fun Toggles() {
|
||||
fun Toggles() {
|
||||
Column {
|
||||
var checked by remember { mutableStateOf(true) }
|
||||
Checkbox(
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
|
||||
|
||||
@OptIn(ExperimentalMaterialApi::class, ExperimentalResourceApi::class)
|
||||
@Composable
|
||||
internal fun UICards() {
|
||||
fun UICards() {
|
||||
val item = remember { DemoDataProvider.item }
|
||||
|
||||
Text(
|
||||
|
||||
@@ -34,7 +34,7 @@ class PanelState {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun ResizablePanel(
|
||||
fun ResizablePanel(
|
||||
modifier: Modifier,
|
||||
state: PanelState,
|
||||
title: String,
|
||||
|
||||
@@ -9,12 +9,12 @@ import androidx.compose.ui.unit.sp
|
||||
import org.jetbrains.compose.demo.widgets.theme.typography
|
||||
|
||||
@Composable
|
||||
internal fun SubtitleText(subtitle: String, modifier: Modifier = Modifier) {
|
||||
fun SubtitleText(subtitle: String, modifier: Modifier = Modifier) {
|
||||
Text(text = subtitle, style = typography.subtitle2, modifier = modifier.padding(8.dp))
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun TitleText(title: String) {
|
||||
fun TitleText(title: String) {
|
||||
Text(
|
||||
text = title,
|
||||
style = typography.h6.copy(fontSize = 14.sp),
|
||||
|
||||
@@ -26,7 +26,7 @@ class SplitterState {
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun VerticalSplittable(
|
||||
fun VerticalSplittable(
|
||||
modifier: Modifier,
|
||||
splitterState: SplitterState,
|
||||
onResize: (delta: Dp) -> Unit,
|
||||
@@ -58,7 +58,7 @@ internal fun VerticalSplittable(
|
||||
|
||||
|
||||
@Composable
|
||||
internal fun VerticalSplitter(
|
||||
fun VerticalSplitter(
|
||||
splitterState: SplitterState,
|
||||
onResize: (delta: Dp) -> Unit,
|
||||
color: Color = Color.DarkGray
|
||||
|
||||
@@ -7,13 +7,13 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.Dp
|
||||
|
||||
@Composable
|
||||
internal actual fun VerticalScrollbar(
|
||||
actual fun VerticalScrollbar(
|
||||
modifier: Modifier,
|
||||
scrollState: ScrollState
|
||||
) = Unit
|
||||
|
||||
@Composable
|
||||
internal actual fun VerticalScrollbar(
|
||||
actual fun VerticalScrollbar(
|
||||
modifier: Modifier,
|
||||
scrollState: LazyListState,
|
||||
itemCount: Int,
|
||||
|
||||
@@ -4,4 +4,4 @@ import androidx.compose.runtime.Composable
|
||||
import org.jetbrains.skiko.SystemTheme
|
||||
|
||||
@Composable
|
||||
internal actual fun isSystemInDarkTheme(): Boolean = org.jetbrains.skiko.currentSystemTheme == SystemTheme.DARK
|
||||
actual fun isSystemInDarkTheme(): Boolean = org.jetbrains.skiko.currentSystemTheme == SystemTheme.DARK
|
||||
|
||||
Reference in New Issue
Block a user