Skip to content

Instantly share code, notes, and snippets.

@toddway
toddway / Examples.kt
Created July 24, 2017 18:47
Kotlin property delegates for SharedPreferences
val preferences : SharedPreferences = ...
//Old way...
val MY_BOOLEAN_PREF = "myBooleanPref"
val MY_STRING_PREF = "myStringPref"
fun oldSharedPreferenceExample() {
//set
val editor = preferences.edit()
@NikolaDespotoski
NikolaDespotoski / SimpleCustomChromeTabsHelper.java
Last active January 29, 2020 18:18
Simple Custom Tab Helper for Custom Tab support libary
import android.app.Activity;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.net.Uri;