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 androidx.compose.foundation.layout.Box | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.ui.Modifier | |
| import androidx.compose.ui.draw.drawWithContent | |
| import androidx.compose.ui.geometry.Offset | |
| import androidx.compose.ui.graphics.BlendMode | |
| import androidx.compose.ui.graphics.Color | |
| import androidx.compose.ui.graphics.nativeCanvas | |
| @Composable |
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
| // This prints the dependencies of each task in the current execution graph | |
| gradle.taskGraph.whenReady( | |
| closureOf<TaskExecutionGraph> { | |
| println("About to run ${allTasks.size} tasks: (use `-i` to see why tasks are skipped, use `--rerun-tasks` to prevent UP-TO-DATE checks)") | |
| allTasks.forEachIndexed { i, task -> | |
| val dependenciesString = | |
| if (task.dependsOn.isEmpty()) { | |
| "" | |
| } else { | |
| task.dependsOn.joinToString(", ", " (depends on ", ")") { dependency -> |
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
| lane :test do | options | | |
| apk_downloader(json_key: "./[email protected]", package_name: "m.zhgchg.li", version_code:1000, export_file_path: "./zhgchgli.apk") | |
| end |
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
| suspend fun <ReturnT> Mutex.checkedWithLock( | |
| block: suspend () -> ReturnT | |
| ): ReturnT { | |
| val element = LockedMutexesElement(this).key | |
| check (currentCoroutineContext()[element] == null) { | |
| "Reentered Mutex" | |
| } | |
| return withContext(element) { withLock { block() } } | |
| } |
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 ParallaxScreen(modifier: Modifier = Modifier) { | |
| val context = LocalContext.current | |
| val scope = rememberCoroutineScope() | |
| var data by remember { mutableStateOf<SensorData?>(null) } | |
| DisposableEffect(Unit) { | |
| val dataManager = SensorDataManager(context) | |
| dataManager.init() |
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:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") | |
| // Tooltip implementation for AndroidX Jetpack Compose | |
| // See usage example in the next file | |
| // Tested with Compose version **1.1.0-alpha06** | |
| // Based on material DropdownMenu implementation. | |
| import androidx.compose.animation.core.MutableTransitionState | |
| import androidx.compose.animation.core.animateFloat |
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 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 |
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 androidx.compose.ui.Modifier | |
| import androidx.compose.ui.composed | |
| import androidx.compose.ui.draw.drawBehind | |
| import androidx.compose.ui.graphics.Color | |
| import androidx.compose.ui.graphics.Paint | |
| import androidx.compose.ui.graphics.drawscope.drawIntoCanvas | |
| import androidx.compose.ui.graphics.toArgb | |
| import androidx.compose.ui.unit.Dp | |
| import androidx.compose.ui.unit.dp |
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
| /* | |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the |
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
| /* | |
| Copyright 2020 Cedric Kring. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, |