This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.view.ViewGroup | |
| import androidx.recyclerview.widget.RecyclerView | |
| abstract class SectionAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() { | |
| private val headerPositions: MutableMap<Int, Int> = mutableMapOf() | |
| private val itemPositions: MutableMap<Int, Int> = mutableMapOf() | |
| private val sectionItemPositions: MutableMap<Int, Int> = mutableMapOf() | |
| private var listSize = 0 | |
| private var headerSize = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import androidx.compose.animation.core.Animatable | |
| import androidx.compose.animation.core.Spring | |
| import androidx.compose.animation.core.animateFloatAsState | |
| import androidx.compose.animation.core.spring | |
| import androidx.compose.foundation.background | |
| import androidx.compose.foundation.gestures.detectDragGestures | |
| import androidx.compose.foundation.layout.aspectRatio | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.wrapContentSize | |
| import androidx.compose.integration.demos.BlockFilter.Companion.Lighting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension Task where Failure == Error { | |
| // Start a new Task with a timeout. If the timeout expires before the operation is | |
| // completed then the task is cancelled and an error is thrown. | |
| init(priority: TaskPriority? = nil, timeout: TimeInterval, operation: @escaping @Sendable () async throws -> Success) { | |
| self = Task(priority: priority) { | |
| try await withThrowingTaskGroup(of: Success.self) { group -> Success in | |
| group.addTask(operation: operation) | |
| group.addTask { | |
| try await _Concurrency.Task.sleep(nanoseconds: UInt64(timeout * 1_000_000_000)) |
OlderNewer