Skip to content

Instantly share code, notes, and snippets.

View dovahkiin98's full-sized avatar

Ahmad Sattout dovahkiin98

  • UCG
  • 06:23 (UTC +03:00)
View GitHub Profile
@dovahkiin98
dovahkiin98 / FadingEdge.kt
Last active July 16, 2024 05:04
A Jetpack Compose implementation of the `fadingEdge` effect.
import androidx.compose.foundation.ScrollState
import androidx.compose.material.MaterialTheme
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.debugInspectorInfo
@dovahkiin98
dovahkiin98 / AutoSizeText.kt
Created October 4, 2021 09:03
AutoSize text implementation in Jetpack Compose
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.text.InlineTextContent
import androidx.compose.foundation.text.InternalFoundationTextApi
import androidx.compose.foundation.text.TextDelegate
import androidx.compose.material.LocalTextStyle
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@dovahkiin98
dovahkiin98 / LongClickButton.kt
Created October 6, 2021 07:32
LongClickButton
import android.widget.Toast
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Button
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.Text
@dovahkiin98
dovahkiin98 / Table.kt
Created March 14, 2022 15:34
Compose Table/Grid
package net.inferno.compose.view
import androidx.compose.foundation.layout.LayoutScopeMarker
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.BiasAlignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.layout.*
import androidx.compose.ui.platform.InspectorInfo