All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.dragselectcompose.core.GridDragSelectDefaults.kt Maven / Gradle / Ivy

Go to download

A Compose multiplatform library for adding Google Photos style drag-to-select multi-selection to a LazyGrid.

The newest version!
package com.dragselectcompose.core

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.hapticfeedback.HapticFeedback
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.unit.dp

/**
 * Default values for [Modifier.gridDragSelect].
 */
public object GridDragSelectDefaults {

    /**
     * Default value for [HapticFeedback].
     */
    public val hapticsFeedback: HapticFeedback
        @Composable get() = LocalHapticFeedback.current

    /**
     * Default value to determine when to start auto-scrolling.
     */
    public val autoScrollThreshold: Float
        @Composable get() = with(LocalDensity.current) { DEFAULT_THRESHOLD_DP.dp.toPx() }

    private const val DEFAULT_THRESHOLD_DP = 40
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy