Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (C) 2014 Chris Banes
*
* 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
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active December 23, 2025 06:48
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@mrleolink
mrleolink / SoftKeyboardHandledLinearLayout.java
Last active December 21, 2015 04:33
A hack to catch events when soft keyboard comes up/down on Android (Tested on 2.3 and 4.0.4) (For usage: check out my blog post at: http://tech.leolink.net/2014/02/a-hack-to-catch-soft-keyboard-showhide.html)
public class SoftKeyboardHandledLinearLayout extends LinearLayout {
private boolean isKeyboardShown;
private SoftKeyboardVisibilityChangeListener listener;
public SoftKeyboardHandledLinearLayout(Context context) {
super(context);
}
public SoftKeyboardHandledLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
@edokeh
edokeh / index.js
Last active November 23, 2025 17:00
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'