Skip to content

Instantly share code, notes, and snippets.

View kaleai's full-sized avatar
😀
Be Happy

Kale kaleai

😀
Be Happy
  • kale
  • Shanghai, China
View GitHub Profile
@kaleai
kaleai / hahfasdf
Created November 2, 2015 10:40
editText
/**
* 限制中文字符的长度
*/
public static void lengthChineseFilter(final EditText editText, final int length) {
InputFilter[] filters = new InputFilter[1];
filters[0] = new InputFilter.LengthFilter(length) {
public CharSequence filter(@NonNull CharSequence source, int start, int end, @NonNull Spanned dest, int dstart, int dend) {
// 可以检查中文字符
boolean isChinese = CharacterUtil.checkNameChese(source.toString());
@kaleai
kaleai / dfd
Created November 2, 2015 10:40
fdf
/**
* 限制中文字符的长度
*/
public static void lengthChineseFilter(final EditText editText, final int length) {
InputFilter[] filters = new InputFilter[1];
filters[0] = new InputFilter.LengthFilter(length) {
public CharSequence filter(@NonNull CharSequence source, int start, int end, @NonNull Spanned dest, int dstart, int dend) {
// 可以检查中文字符
boolean isChinese = CharacterUtil.checkNameChese(source.toString());
^+WheelUp::
SendInput ^#{Right}
sleep ,200
return
#if GetKeyState("LShift", "p")
LAlt & i:: Send {WheelUp}
LAlt & k:: Send {WheelDown}
@kaleai
kaleai / gist:a6c8c3a505a8488530b465e2cd77e001
Created May 3, 2018 03:39
AHK:鼠标滚轮+组合键
;------------- 切换标签栏 --------------
^WheelLeft::
SendInput ^{tab}
sleep ,200
return
^WheelRight::
SendInput ^+{tab}
sleep ,200
;------------ For Double RAlt -----------
#Persistent
$RAlt::
if key_presses > 0
{
key_presses += 1
return
@kaleai
kaleai / HttpManager.java
Last active October 28, 2019 02:36
SonarDemo
public class HttpManager {
private static final String TAG = "HttpManager";
private static HttpManager mInstance = null;
private OkHttpClient httpClient;
public static HttpManager getInstance() {
if (mInstance == null) {
@kaleai
kaleai / AdvancedCountdownTimer.java
Created August 26, 2018 06:59
android中的倒计时类,可以支持暂停
import android.os.Handler;
import android.os.Message;
/**
* 自定义的倒计时类,没有用官方提供的CountDownTimer来实现.有暂停等方法,灵活性强.
* 在activity退出后还会持续计时,所以结束时需要判断当前activity是否在前台<br>
*
* @author kale
* @date 2015/4/24
* @see "http://www.cnblogs.com/tianzhijiexian/p/4459216.html"