I hereby claim:
- I am nschwermann on github.
- I am nschwermann (https://keybase.io/nschwermann) on keybase.
- I have a public key ASAff3locbJ9zf46P1nayfMpXzkXVsl3U-RvgYG8KInEwgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
abstract class CoroutineDialog<T>(context : Context, private val channel: Channel<DialogMessage<T>>) : AlertDialog(context) { | |
init { | |
setOnCancelListener { | |
channel.offer(DialogMessage.Cancelled) | |
} | |
} | |
fun positiveChannel(text : String, block : (() -> T)? = null) { | |
setButton(AlertDialog.BUTTON_POSITIVE, text){d, _ -> |
package org.jetbrains.anko | |
import android.app.Activity | |
import android.support.annotation.StringRes | |
import android.support.design.widget.* | |
import android.support.v4.app.Fragment | |
import android.view.View | |
import android.view.ViewManager | |
import java.util.concurrent.atomic.AtomicInteger |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.ViewGroup; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Path; | |
import android.util.AttributeSet; | |
import android.widget.FrameLayout; | |
public class ClipRevealFrame extends FrameLayout{ | |
private Path mRevealPath; |
/* | |
* Copyright (C) 2013 The Android Open Source Project | |
* | |
* 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 |
import android.content.Context; | |
import android.net.Uri; | |
import android.text.TextUtils; | |
import com.google.android.exoplayer.C; | |
import com.google.android.exoplayer.upstream.DataSource; | |
import com.google.android.exoplayer.upstream.DataSpec; | |
import com.google.android.exoplayer.upstream.HttpDataSource; | |
import com.google.android.exoplayer.upstream.TransferListener; | |
import com.google.android.exoplayer.upstream.UnexpectedLengthException; |
package schwiz.net.example; | |
import android.content.Context; | |
import android.graphics.Color; | |
import android.support.wearable.view.GridPagerAdapter; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.ViewGroup; |
/** | |
* Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable). | |
* In the ghost bitmap, the RGB values take on the values from the 'color' argument, while | |
* the alpha values are derived from the source's grayscaled RGB values. The effect is that | |
* you can see through darker parts of the source bitmap, while lighter parts show up as | |
* the given color. The 'invert' argument inverts the computation of alpha values, and looks | |
* best when the given color is a dark. | |
*/ | |
private Bitmap createGhostIcon(Drawable src, int color, boolean invert) { | |
int width = src.getIntrinsicWidth(); |
/* | |
* Copyright 2014 Google Inc. | |
* | |
* 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 |