Skip to content

Instantly share code, notes, and snippets.

Avatar

Denis Ismailaj denis-ismailaj

View GitHub Profile
@denis-ismailaj
denis-ismailaj / SwipeToDelete.kt
Last active Oct 12, 2021
SwipeToDelete is a boilerplate-free simple implementation of SwipeToDismiss for bidirectional delete gestures in Jetpack Compose.
View SwipeToDelete.kt
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete
@denis-ismailaj
denis-ismailaj / OutlinedLabelledRadioButton.kt
Created May 20, 2021
Selectable outlined radio button
View OutlinedLabelledRadioButton.kt
@Composable
fun OutlinedLabelledRadioButton(
selected: Boolean,
onClick: () -> Unit,
label: String,
modifier: Modifier = Modifier
) {
OutlinedButton(
onClick = onClick,
border = BorderStroke(
View LabelledRadioButton.kt
@Composable
fun LabelledRadioButton(
selected: Boolean,
onClick: () -> Unit,
label: String,
modifier: Modifier = Modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
@denis-ismailaj
denis-ismailaj / WormPageIndicator.kt
Last active Jun 12, 2022
Animated worm page indicator composable for Jetpack Compose
View WormPageIndicator.kt
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.CornerRadius
@denis-ismailaj
denis-ismailaj / LabelledCheckBox.kt
Last active Jul 1, 2022
LabelledCheckBox in Jetpack Compose
View LabelledCheckBox.kt
@Composable
fun LabelledCheckBox(
checked: Boolean,
onCheckedChange: ((Boolean) -> Unit),
label: String,
modifier: Modifier = Modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier