Visit my blog or connect with me on Twitter
git init
or
# Now Playing for Übersicht | |
# v0.7.1 | |
# | |
# For more info: | |
# http://github.com/levifig/now-playing.widget | |
# | |
# Levi Figueira | |
# http://levifig.com | |
# | |
# ================================== |
Visit my blog or connect with me on Twitter
git init
or
Extension functions:
Returns/Receiver | R (return value) | this (target) |
---|---|---|
(T) | let |
also |
T.() | run |
apply |
I hereby claim:
To claim this, I am signing this object:
sealed class Event { | |
object One : Event() | |
object Two : Event() | |
data class Three(val int: Int) : Event() | |
} | |
inline fun <reified T : Any> T.ordinal() = | |
T::class.java.superclass.classes.indexOfFirst { sub -> sub == this@ordinal::class.java } | |
fun testOrdinal() { |
package com.your.package | |
import android.app.Dialog | |
import android.os.Bundle | |
import com.your.package.R | |
import com.google.android.material.bottomsheet.BottomSheetDialog | |
import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
/** | |
* BottomSheetDialog fragment that uses a custom |
This document is based on the code of android-4.1.1_r6 (Jelly Bean).
First, the invalidate()
call will be propagated back to the root of the view hierarchy. During the propagation, the system determines the dirty area that needs to be redrawn. The propagation will eventually reach ViewRootImpl
.
frameworks/base/core/java/android/view/View.java
10219 void invalidate(boolean invalidateCache) {
... ...
/** | |
* A lazy property that gets cleaned up when the fragment is destroyed. | |
* | |
* Accessing this variable in a destroyed fragment will throw NPE. | |
*/ | |
class AutoClearedValue<T : Any> : ReadWriteProperty<Fragment, T>, LifecycleObserver { | |
private var _value: T? = null | |
override fun getValue(thisRef: Fragment, property: KProperty<*>): T = | |
_value ?: throw IllegalStateException("Trying to call an auto-cleared value outside of the view lifecycle.") |
As configured in my dotfiles.
start new:
tmux
start new with session name:
interface Listener { | |
fun performNewAction(actionId: String) | |
fun performOldAction() | |
} | |
class Presenter { | |
var listenerRef: Listener? = null | |
fun display() { |