|
|
@@ -57,6 +57,28 @@ import kotlin.math.abs
|
|
|
@Suppress("MemberVisibilityCanBePrivate")
|
|
|
object ModifierExt {
|
|
|
|
|
|
+// private val VerticalScrollConsumer = object : NestedScrollConnection {
|
|
|
+// override fun onPreScroll(available: Offset, source: NestedScrollSource) =
|
|
|
+// available.copy(x = 0f)
|
|
|
+// override suspend fun onPreFling(available: Velocity) =
|
|
|
+// available.copy(x = 0f)
|
|
|
+// }
|
|
|
+
|
|
|
+// private val HorizontalScrollConsumer = object : NestedScrollConnection {
|
|
|
+// override fun onPreScroll(available: Offset, source: NestedScrollSource) =
|
|
|
+// available.copy(y = 0f)
|
|
|
+// override suspend fun onPreFling(available: Velocity) =
|
|
|
+// available.copy(y = 0f)
|
|
|
+// }
|
|
|
+
|
|
|
+// fun Modifier.disabledVerticalPointerInputScroll(
|
|
|
+// disabled: Boolean = true
|
|
|
+// ) = if (disabled) this.nestedScroll(VerticalScrollConsumer) else this
|
|
|
+
|
|
|
+// fun Modifier.disabledHorizontalPointerInputScroll(
|
|
|
+// disabled: Boolean = true
|
|
|
+// ) = if (disabled) this.nestedScroll(HorizontalScrollConsumer) else this
|
|
|
+
|
|
|
@Composable
|
|
|
fun Modifier.conditional(
|
|
|
condition: Boolean,
|