Skip to content

Instantly share code, notes, and snippets.

@lxyd
lxyd / EditTextAutoFormatAid.kt
Created September 8, 2018 22:46
Android EditText (limited) mask auto-formatter
package net.lxyd.autofmt
import android.text.*
import android.widget.EditText
import java.lang.Character.isHighSurrogate
class EditTextAutoFormatAid(private val formatter: Formatter) {
companion object {
fun remove(editText: EditText) {
editText.filters.clone().forEach { (it as? AutoFormatInputFilter)?.aid?.remove() }
@lxyd
lxyd / LICENSE.txt
Created April 12, 2012 18:04 — forked from 140bytes/LICENSE.txt
Recursively clones plain hashes and arrays (but not Dates or wrappers like Boolean(), String(), Number()). Handles one-level circular references
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 lxyd <https://github.com/lxyd>, TheShock <https://github.com/theshock>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE