Skip to content

Instantly share code, notes, and snippets.

@TonyTangAndroid
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
submitButton.setEnabled(false);
Observable.combineLatest(emailChangeObservable, passwordChangeObservable,
(emailObservable, passwordObservable) -> {
boolean emailCheck = emailObservable.text().length() >= 3;
boolean passwordCheck = passwordObservable.text().length() >= 3;
@TonyTangAndroid
TonyTangAndroid / Interceptor.java
Created Nov 16, 2016 — forked from alex-shpak/Interceptor.java
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
View Interceptor.java
private class HttpInterceptor implements Interceptor {
@Override
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
View android_studio_shortcuts.md

Android Studio Shortcuts (Mac)

Notes:

  • 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:

View README.md

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