Skip to content

Instantly share code, notes, and snippets.

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
BorderPathTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Box(
modifier = Modifier
.fillMaxSize()
@PMARZV
PMARZV / ScreenTransition.kt
Created September 25, 2024 13:58 — forked from ivaniskandar/ScreenTransition.kt
Predictive Back gesture support for Voyager (Jetpack Compose 1.7.0-alpha05+)
import androidx.activity.BackEventCompat
import androidx.activity.compose.PredictiveBackHandler
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.AnimatedContentTransitionScope
import androidx.compose.animation.ContentTransform
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.ExperimentalTransitionApi
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.remember
import androidx.compose.runtime.snapshots.MutableSnapshot
import androidx.compose.runtime.snapshots.Snapshot
import java.util.WeakHashMap
@PublishedApi
internal class DebugStateObservation(private val id: String) {
private val map = WeakHashMap<Any, MutableList<Exception>>()
@Composable
fun CardGradient(modifier: Modifier = Modifier) {
Card(
modifier = Modifier.padding(16.dp).fillMaxWidth().aspectRatio(600 / 400f)
.clip(RoundedCornerShape(16.dp))
) {
Gradient()
}
}
@PMARZV
PMARZV / dom3d.js
Created August 23, 2024 12:40 — forked from OrionReed/dom3d.js
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@PMARZV
PMARZV / test.json
Last active April 19, 2024 19:18
test
{
"key": "key-4SMKSJ6QQBc4yXTKZpCs4DchM1Du2wAyk4iykCTgJuUzNkSNX0twIlsyi9BaQfcKWcNfIHZcDRT46mhxS3IIA6wVKMZ4ISzv",
"adsloop": 3,
"versioncode": 3,
"versionrequired": false,
"activateads": true
}