Skip to content

Commit

Permalink
Suppressed custom modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Jun 1, 2024
1 parent ffa8a02 commit d7c8ab1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ internal fun <T : Any> rememberSwipeableStateFor(
*/
@ExperimentalMaterial3Api
@Composable
@Suppress("ktlint:compose:modifier-composable-check")
internal fun <T> Modifier.swipeable(
state: SwipeableState<T>,
anchors: Map<Float, T>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ private val ArrowHeight = 5.dp
private val Elevation = 6.dp

@Composable
@Suppress("ktlint:compose:modifier-composable-check")
fun Modifier.pullRefreshIndicatorTransform(
state: PullRefreshState,
scale: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,24 @@ import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.platform.LocalInputModeManager

@Composable
@Suppress("ktlint:compose:modifier-composable-check")
fun Modifier.onKeyEventLikeEscape(action: () -> Unit): Modifier {
return this.onKeyEvent {
when (it.key) {
Key.Escape, Key.Back, Key.NavigateOut -> {
action()
true
}
return this.then(
Modifier.onKeyEvent {
when (it.key) {
Key.Escape, Key.Back, Key.NavigateOut -> {
action()
true
}

else -> false
}
}
else -> false
}
},
)
}

@Composable
@Suppress("ktlint:compose:modifier-composable-check")
fun Modifier.focusableInNonTouchMode(
enabled: Boolean = true,
interactionSource: MutableInteractionSource? = null,
Expand Down

0 comments on commit d7c8ab1

Please sign in to comment.