Skip to content

Instantly share code, notes, and snippets.

View tomriddle25's full-sized avatar
🏠
Working from home

Faisal tomriddle25

🏠
Working from home
View GitHub Profile
@tomriddle25
tomriddle25 / MechanicalRedSwitch.kt
Created October 28, 2025 08:13 — forked from amayde/MechanicalRedSwitch.kt
Mechanical red switch - jetpack compose
package com.example.switch
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.spring
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
@tomriddle25
tomriddle25 / LoopingCarausel.kt
Created October 9, 2025 07:50
Creating a looping pager in compose
@Composable
fun LoopingCarousel(modifier: Modifier = Modifier) {
Column(modifier = modifier) {
// create a caraousel of banners
// use the following url https://picsum.photos/200/300
val banners = listOf(
"https://picsum.photos/id/1/400/600",
"https://picsum.photos/id/2/400/600",
"https://picsum.photos/id/3/400/600",
)
@tomriddle25
tomriddle25 / StretchTabComponent.kt
Created July 19, 2025 18:59 — forked from ardakazanci/StretchTabComponent.kt
Stretch Tab Jetpack Compose
data class TabPosition(val left: Float, val right: Float)
@Composable
fun StretchTabComponent() {
val tabs = listOf("SALE", "RENT")
var selectedIndex by remember { mutableIntStateOf(0) }
val tabPositions = remember { mutableStateListOf<TabPosition>() }
val startX = remember { Animatable(0f) }
val endX = remember { Animatable(0f) }
val scope = rememberCoroutineScope()
@tomriddle25
tomriddle25 / converter.sh
Created February 20, 2020 07:22 — forked from Kishanjvaghela/converter.sh
Create Image drawable for all resolutions
if [ $# -eq 0 ]; then
echo "No arguments supplied"
else if [ -f "$1" ]; then
echo " Creating different dimensions (dips) of "$1" ..."
mkdir -p drawable-xxhdpi
mkdir -p drawable-xhdpi
mkdir -p drawable-hdpi
mkdir -p drawable-mdpi
if [ $1 = "ic_launcher.png" ]; then