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 com.yourpackage | |
| import android.os.Bundle | |
| import android.view.View | |
| import androidx.compose.runtime.MonotonicFrameClock | |
| import androidx.compose.runtime.PausableMonotonicFrameClock | |
| import androidx.compose.runtime.Recomposer | |
| import androidx.compose.ui.InternalComposeUiApi | |
| import androidx.compose.ui.platform.AbstractComposeView | |
| import androidx.compose.ui.platform.AndroidUiDispatcher |
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 patch allows building androidx-main on a Mac with M1 Apple Silicon. | |
| After following the instructions in the repository (https://github.com/androidx/androidx/blob/androidx-main/README.md) | |
| to sync the repo, edit the patch below to replace YOUR_JDK_FOLDER_HERE with an arm64 JDK path, then apply this patch. | |
| In prebuilts/androidx/external/com/google/protobuf folder, for the dependencies that | |
| needs to be updated to version 3.19.4 because it supports aarch64, | |
| create a 3.19.4 folder inside their folders. Here are the ones that need updating: | |
| . protobuf-bom | |
| . protobuf-java | |
| . protobuf-java-util |
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
| #!/bin/bash | |
| # check for where the latest version of IDEA is installed | |
| STUDIOS=() | |
| STUDIO_NAMES=() | |
| while read line | |
| do | |
| studio=`echo $line` | |
| STUDIOS+=("${studio}") |
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.content.Context | |
| import android.util.AttributeSet | |
| import android.view.View | |
| import android.widget.FrameLayout | |
| import androidx.coordinatorlayout.widget.CoordinatorLayout | |
| import androidx.core.view.NestedScrollingChildHelper | |
| import androidx.core.view.NestedScrollingParent2 | |
| import androidx.core.view.ViewCompat | |
| import androidx.recyclerview.widget.LinearLayoutManager |
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
| fun main(args: Array<String>) { | |
| val handler = CoroutineExceptionHandler { context, exception -> | |
| println("CoroutineExceptionHandler got $exception with suppressed ${exception.suppressed.contentToString()}") | |
| } | |
| val parentScope = CoroutineScope(Dispatchers.Default + Job() + handler) | |
| // val parentScope = MyScope() | |
| parentScope.launch { | |
| println("one job: " + this.coroutineContext[Job].toString()) | |
| println("Hello") |
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
| // Using Jetpack Compose Transition v1 | |
| enum class FabState { | |
| Initial, | |
| Normal, | |
| Exploded, | |
| } | |
| val fabSizeKey = DpPropKey() | |
| val fabColorKey = ColorPropKey() |
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 ForegroundServiceLauncher(private val serviceClass: Class<out Service>) { | |
| private var isStarting = false | |
| private var shouldStop = false | |
| private var isCreated = false | |
| @Synchronized | |
| fun startService(context: Context, block: Intent.() -> Unit = {}) { | |
| if (!isCreated) { | |
| isStarting = true |
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
| #!/usr/bin/env python3 | |
| """ | |
| Android11 | |
| Pair and connect devices for wireless debug on terminal | |
| python-zeroconf: A pure python implementation of multicast DNS service discovery | |
| https://github.com/jstasiak/python-zeroconf | |
| """ |
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
| val ALL_FAKES = listOf( | |
| FakePostLoginUseCase::class, | |
| // all fake classes go here | |
| ) | |
| /** | |
| * Finds and initializes an instance of | |
| * class [T] if it exists in [ALL_FAKES]. | |
| * | |
| * If it doesn't, a [FakeNotFoundException] is thrown |