Skip to content

Instantly share code, notes, and snippets.

@TonyTangAndroid
TonyTangAndroid / Example.java
Created May 5, 2023 06:49 — forked from gelitenight/Example.java
A way to easily traverse any view hierarchy in Android
/* basic usage */
ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
LayoutTraverser.build(new LayoutTraverser.Processor() {
@Override
public void process(View view) {
// do stuff with the view
}
}).traverse(root);
@TonyTangAndroid
TonyTangAndroid / Interceptor.java
Created November 16, 2016 22:48 — 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.
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
@TonyTangAndroid
TonyTangAndroid / android_studio_shortcuts.md
Created April 7, 2016 05:02 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

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:

Parse -> LeanCloud 文件迁移工具

注意:这个工具是用来导入到中国区节点的

依赖: gevent、requests

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

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