Skip to content

Instantly share code, notes, and snippets.

TonyTangAndroid / gist:35bd8c9d2eb0fba8206c955dbf1dc1d5
Created Mar 3, 2017
The submit button only gets enabled if username and password have a length>=3
View gist:35bd8c9d2eb0fba8206c955dbf1dc1d5
emailChangeObservable = RxTextView.textChangeEvents(email);
passwordChangeObservable = RxTextView.textChangeEvents(password);
// force-disable the button
Observable.combineLatest(emailChangeObservable, passwordChangeObservable,
(emailObservable, passwordObservable) -> {
boolean emailCheck = emailObservable.text().length() >= 3;
boolean passwordCheck = passwordObservable.text().length() >= 3;
TonyTangAndroid /
Created Nov 16, 2016 — forked from alex-shpak/
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON

Android Studio Shortcuts (Mac)


  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:


Parse -> LeanCloud 文件迁移工具


依赖: gevent、requests

Ubuntu 可以 # apt-get install python-gevent python-requests

View enable-volley-verbose-logging
# (42f63b0de7318fe1 is a device id)
adb -s 075d0cdb0ae533b1 shell setprop log.tag.Volley VERBOSE