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
| package de.apuri.choicechips | |
| import androidx.compose.animation.AnimatedVisibility | |
| import androidx.compose.animation.ExperimentalAnimationApi | |
| import androidx.compose.animation.animateColorAsState | |
| import androidx.compose.animation.expandHorizontally | |
| import androidx.compose.animation.fadeIn | |
| import androidx.compose.animation.fadeOut | |
| import androidx.compose.animation.scaleIn | |
| import androidx.compose.animation.scaleOut |
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
| package de.apuri.norunninginthehalls | |
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.compose.animation.core.Animatable | |
| import androidx.compose.animation.core.EaseInQuint | |
| import androidx.compose.animation.core.EaseOutQuint | |
| import androidx.compose.animation.core.Spring | |
| import androidx.compose.animation.core.VectorConverter |
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.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.compose.animation.animateColorAsState | |
| import androidx.compose.animation.core.tween | |
| import androidx.compose.foundation.layout.Arrangement | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.Row | |
| import androidx.compose.foundation.layout.Spacer |
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
| private class Blocking<T>( | |
| private val dataStore: DataStore<Preferences>, | |
| private val prefKey: Preferences.Key<T> | |
| ) : ReadWriteProperty<Any, T?> { | |
| override fun getValue(thisRef: Any, property: KProperty<*>): T? = runBlocking { | |
| dataStore.data.map { | |
| it[prefKey] | |
| }.firstOrNull() | |
| } |
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
| // Usage | |
| // PingPongSwitch( | |
| // textFirst = "Ping", | |
| // textSecond = "Pong" | |
| // ) | |
| @Composable | |
| fun PingPongSwitch( | |
| state: PingPongSwitchState = rememberPingPongSwitchState(), | |
| textFirst: String, |
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.graphics.Matrix | |
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.compose.animation.core.LinearEasing | |
| import androidx.compose.animation.core.RepeatMode | |
| import androidx.compose.animation.core.animateFloat | |
| import androidx.compose.animation.core.animateIntAsState | |
| import androidx.compose.animation.core.infiniteRepeatable | |
| import androidx.compose.animation.core.rememberInfiniteTransition |
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
| @Composable | |
| fun PlacementWithinAnchor( | |
| modifier: Modifier, | |
| content: @Composable PlacementWithinAnchorScope.() -> Unit | |
| ) { | |
| CompositionLocalProvider( | |
| LocalLayoutCoordinatesHolder provides ContainerLayoutCoordinatesHolder() | |
| ) { | |
| Box( | |
| modifier = modifier |
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
| package de.apuri.boing | |
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.compose.animation.core.Animatable | |
| import androidx.compose.animation.core.Spring | |
| import androidx.compose.animation.core.spring | |
| import androidx.compose.foundation.BorderStroke | |
| import androidx.compose.foundation.gestures.awaitFirstDown |
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
| @file:OptIn(ExperimentalFoundationApi::class) | |
| package de.apuri.springytabs | |
| import android.os.Bundle | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.compose.animation.core.Spring | |
| import androidx.compose.animation.core.animateFloatAsState | |
| import androidx.compose.animation.core.spring |
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
| class MainActivity : ComponentActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| WindowCompat.setDecorFitsSystemWindows(window, false) | |
| super.onCreate(savedInstanceState) | |
| setContent { | |
| P2RTheme { | |
| // A surface container using the 'background' color from the theme | |
| Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { | |
| CompositionLocalProvider( | |
| LocalOverscrollConfiguration provides null // Disable overscroll otherwise it consumes the drag before we get the chance |
OlderNewer