This file contains 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
// Use this template if you use ComposeTestRule (createComposeRule()) | |
// Use the other template if you use ComposeUiTest (runComposeUiTest()) | |
private val TAG = "TEST_TAG" | |
private var I = 0 // add a sequence number to every log message for disambiguation | |
private var unregisterApplyObserver: ObserverHandle? = null | |
private var unregisterWriteObserver: ObserverHandle? = null | |
@Test | |
fun test() { |
This file contains 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 { Octokit } from '@octokit/rest'; | |
type Option = { | |
owner: string; | |
repo: string; | |
baseBranch: string; | |
newBranch: string; | |
pullRequest: { | |
title: string; | |
body: string; |
This file contains 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
// IMPORTANT! READ THIS FIRST | |
// Assisted Injection doesn't work with @HiltViewModel or @ViewModelInject | |
// Read more about the issue here: https://github.com/google/dagger/issues/2287 | |
// | |
// | |
// AssistedInject and Hilt working together in v2.28-alpha times | |
// Example of a ViewModel using AssistedInject injected in a Fragment by Hilt | |
// As AssistedInject isn't part of Dagger yet, we cannot use in | |
// conjuction with @ViewModelInject |
This file contains 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 kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.launch | |
class ResultAsync<T> private constructor(action: suspend () -> T, scope: CoroutineScope) { | |
internal var onSuccess : (T) -> Unit = {} | |
internal var onError : (e: Throwable) -> Unit = {} | |
companion object { | |
fun <T> with(action: suspend () -> T, scope: CoroutineScope) :ResultAsync<T>{ |
This file contains 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 bash | |
set -euo pipefail | |
########## | |
# Config # | |
########## | |
readonly GIT_BRANCH='android-8.0.0_r4' | |
readonly API_LEVEL='26' |
This file contains 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.arch.lifecycle.ViewModel | |
import android.arch.lifecycle.ViewModelProvider | |
import android.arch.lifecycle.ViewModelStore | |
import android.arch.lifecycle.ViewModelStores | |
import android.support.v4.app.Fragment | |
import android.support.v4.app.FragmentActivity | |
import java.util.concurrent.atomic.AtomicBoolean | |
/** | |
* Created by Nikola on 7/19/2017. |
This file contains 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.example.customfonts; | |
import android.app.Application; | |
import android.content.res.AssetManager; | |
import android.graphics.Typeface; | |
import android.os.Build; | |
import java.lang.reflect.Array; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; |
This file contains 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 | |
## This script is for taking a screen shot of an Android device. | |
## If possible, it tries to resize the image file and then copy to the clipboard. | |
## | |
## The script passes unrecognized arguments to adb command, which means you can specify "-e" or "-d" | |
## to select which device to take a screenshot of. | |
if [ -z $(which adb) ]; then | |
echo "Error. adb must be installed and in PATH." 1>&2 |
This file contains 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
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.genymotion:plugin:1.0' | |
} | |
} | |
apply plugin: "genymotion" |
This file contains 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
java -cp "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true . src |
NewerOlder