Skip to content

Commit

Permalink
library: Optimize some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YuKongA committed Sep 28, 2024
1 parent 313b6eb commit 997ccbf
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 9 deletions.
4 changes: 3 additions & 1 deletion composeApp/src/commonMain/kotlin/utils/FPSMonitor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import top.yukonga.miuix.kmp.basic.Text

// This is a simple FPS monitor that displays the current frames per second.
/**
* A simple FPS monitor that displays the current frames per second.
*/
@Composable
fun FPSMonitor(modifier: Modifier = Modifier) {
var fps by remember { mutableStateOf(0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.annotation.SuppressLint
import androidx.compose.runtime.MutableState
import androidx.compose.ui.Modifier

/**Returns modifier to be used for the current platform */
/**
* Returns modifier to be used for the current platform.
*/
@SuppressLint("ModifierFactoryExtensionFunction")
actual fun modifierPlatform(modifier: Modifier, isHovered: MutableState<Boolean>): Modifier = modifier
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import top.yukonga.miuix.kmp.utils.squircleshape.SquircleShape
*
* @param value The input [TextFieldValue] to be shown in the text field.
* @param onValueChange The callback that is triggered when the input service updates values in
* * [TextFieldValue]. An updated [TextFieldValue] comes as a parameter of the callback.
* [TextFieldValue]. An updated [TextFieldValue] comes as a parameter of the callback.
* @param modifier The modifier to be applied to the [TextField].
* @param insideMargin The margin inside the [TextField].
* @param backgroundColor The background color of the [TextField].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ import top.yukonga.miuix.kmp.utils.getWindowSize
import top.yukonga.miuix.kmp.utils.squircleshape.SquircleShape
import kotlin.math.roundToInt

/**Returns modifier to be used for the current platform */
/**
* Returns modifier to be used for the current platform.
*/
expect fun modifierPlatform(modifier: Modifier, isHovered: MutableState<Boolean>): Modifier

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ enum class Platform {
WasmJs
}

/** Returns the current platform name */
/**
* Returns the current platform name.
*/
expect fun platform(): Platform

/**
* Window size data class.
*/
data class WindowSize(val width: Int, val height: Int)

/** Returns the current window size */
/**
* Returns the current window size.
*/
@Composable
expect fun getWindowSize(): WindowSize

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.PointerEventType
import androidx.compose.ui.input.pointer.onPointerEvent

/**Returns modifier to be used for the current platform */
/**
* Returns modifier to be used for the current platform.
*/
@OptIn(ExperimentalComposeUiApi::class)
actual fun modifierPlatform(modifier: Modifier, isHovered: MutableState<Boolean>): Modifier = modifier
.onPointerEvent(PointerEventType.Move) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ package top.yukonga.miuix.kmp.extra
import androidx.compose.runtime.MutableState
import androidx.compose.ui.Modifier

/**Returns modifier to be used for the current platform */
/**
* Returns modifier to be used for the current platform.
*/
actual fun modifierPlatform(modifier: Modifier, isHovered: MutableState<Boolean>): Modifier = modifier
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.PointerEventType
import androidx.compose.ui.input.pointer.onPointerEvent

/**Returns modifier to be used for the current platform */
/**
* Returns modifier to be used for the current platform.
*/
@OptIn(ExperimentalComposeUiApi::class)
actual fun modifierPlatform(modifier: Modifier, isHovered: MutableState<Boolean>): Modifier = modifier
.onPointerEvent(PointerEventType.Move) {
Expand Down

0 comments on commit 997ccbf

Please sign in to comment.