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.cypressworks.retrolambdafailure; | |
import com.google.android.gms.maps.SupportMapFragment; | |
public class MarkerMapFragment extends SupportMapFragment { | |
Runnable r = () -> { | |
}; | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="red_50">#fde0dc</color> | |
<color name="red_100">#f9bdbb</color> | |
<color name="red_200">#f69988</color> | |
<color name="red_300">#f36c60</color> | |
<color name="red_400">#e84e40</color> | |
<color name="red_500">#e51c23</color> | |
<color name="red_600">#dd191d</color> | |
<color name="red_700">#d01716</color> |
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 net.hockeyapp.android.demo | |
import com.squareup.okhttp.FormEncodingBuilder | |
import com.squareup.okhttp.OkHttpClient | |
import com.squareup.okhttp.Request | |
import org.acra.ACRA | |
import org.acra.ReportField | |
import org.acra.collector.CrashReportData | |
import org.acra.sender.ReportSender | |
import java.util.Date |
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
public class ExampleApplication extends Application { | |
@Override public void onCreate() { | |
super.onCreate(); | |
if (Build.VERSION.SDK_INT >= 21) { | |
try { | |
Class<?> cls = Class.forName("android.sec.clipboard.ClipboardUIManager"); | |
Method m = cls.getDeclaredMethod("getInstance", Context.class); | |
m.setAccessible(true); | |
Object o = m.invoke(null, this); | |
} catch (Exception ignored) { } |
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
fun <T> Observable<T>.delayUntil(value: T): Observable<T> { | |
val replaySubject = ReplaySubject.create<T>() | |
val sharedObservable = this.publish().autoConnect(2) | |
sharedObservable.subscribe(replaySubject) | |
val delayObservable = sharedObservable | |
.first { it == value } | |
.concatWith(Observable.error(IllegalArgumentException())) |
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
val mutex = Semaphore(0) | |
val source = Observable.interval(200, TimeUnit.MILLISECONDS).take(10) | |
val delayed = source.delayUntil(3L) | |
println("${System.currentTimeMillis()}: start") | |
delayed.subscribe( | |
{ println("${System.currentTimeMillis()}: $it") }, | |
{ println("Failed with $it") }, | |
{ mutex.release() } | |
) |
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
task waitForEmulator << { | |
def start = System.currentTimeMillis() | |
while (System.currentTimeMillis() - start < 60000) { | |
def out = new StringBuilder() | |
def process = 'adb shell getprop init.svc.bootanim'.execute() | |
process.consumeProcessOutput(out, null) | |
process.waitForOrKill(1000) | |
if (out.toString().trim() == "stopped") return |
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
version '1.0-SNAPSHOT' | |
buildscript { | |
ext.kotlin_version = '1.1.60' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
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 { | |
ext.kotlin_version = '1.1.60' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
} | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="choose_beast.css"/> | |
</head> | |
<body> | |
<div id="popup-content"> | |
<div class="button beast">Frog</div> |
OlderNewer