Skip to content

Instantly share code, notes, and snippets.

@Den-Rimus
Den-Rimus / ResettableLazyDelegate.kt
Last active June 22, 2022 04:39
Android Kotlin resettable lazy delegate
interface ResettableLazy<out T> : Lazy<T> {
fun reset()
}
private class ResettableSynchronizedLazyImpl<out T>(initializer: () -> T, lock: Any? = null) : ResettableLazy<T> {
private val initializer: (() -> T)? = initializer
@Den-Rimus
Den-Rimus / Blender.java
Created November 21, 2014 09:10
Blender modes for android
package com.example.blendmodes;
import android.graphics.Bitmap;
import android.util.Log;
public class Blender {
private static final String TAG = Blender.class.getSimpleName();
public static Bitmap performBlending(Bitmap source, Bitmap destination, int mode) {