Skip to content

Instantly share code, notes, and snippets.

@ixiyang
ixiyang / 好的技术网站
Last active December 26, 2015 23:19
一些技术网站
深入学习java的好地方
http://tutorials.jenkov.com/
http://www.ibm.com/developerworks/cn/java/coretech/?ca=j-r
good blog
http://www.stylingandroid.com/
http://android.okhelp.cz/
http://flavienlaurent.com/
http://android-developers.blogspot.com/
@ixiyang
ixiyang / android开发资源
Created October 31, 2013 09:14
android开发资源
News:
Android Weekly - a free newsletter that helps you remain on the cutting-edge with your Android Development.
http://androidweekly.net/
Tutorials:
Google's Android Developer Training http://developer.android.com/training/index.html
CommonsWare - AdvAndroid http://commonsware.com/AdvAndroid/
@ixiyang
ixiyang / onInterceptTouchEvent()
Last active December 27, 2015 08:39
PullToRefresh源码阅读摘记
private boolean isFirstItemVisible() {
final Adapter adapter = mRefreshableView.getAdapter();
if (null == adapter || adapter.isEmpty()) {
if (DEBUG) {
Log.d(LOG_TAG, "isFirstItemVisible. Empty View.");
}
return true;
} else {
@ixiyang
ixiyang / MenuAdapter
Created November 4, 2013 07:54
adapter填充不同类型的数据以及不同的视图
public class MenuAdapter extends BaseAdapter {
public interface MenuListener {
void onActiveViewChanged(View v);
}
private Context mContext;
private List<Object> mItems;
@ixiyang
ixiyang / DecorView
Last active December 27, 2015 08:49
menudrawer源码摘记
/**
* Attaches the menu drawer to the window.
*/
private static void attachToDecor(Activity activity, MenuDrawer menuDrawer) {
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
ViewGroup decorChild = (ViewGroup) decorView.getChildAt(0);
decorView.removeAllViews();
decorView.addView(menuDrawer, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
@ixiyang
ixiyang / drawEdgeEffects
Created November 11, 2013 08:35
自定义视图绘制边缘滑动的效果
http://developer.android.com/training/gestures/viewgroup.html
InteractiveChart
/**
* Draws the overscroll "glow" at the four edges of the chart region, if necessary. The edges
* of the chart region are stored in {@link #mContentRect}.
*
* @see EdgeEffectCompat
*/
@ixiyang
ixiyang / custom_view
Created December 12, 2013 03:25
android view 绘制流程
关于view的绘制流程
View
ViewParent(interface)
ViewGroup(extends View implements ViewParent)
ViewRoot(implements ViewParent)
Being a root parent of all views in the activity, the ViewRootschedules traversals of all the views in
order to first lay them out at the right place with the right size; this is called the layout phase. The
ViewRoot then traverses the view hierarchy to draw them; this phase is called the drawing phase.
@ixiyang
ixiyang / gist:7922825
Last active July 18, 2019 15:28
difference between requestLayout() and forceLayout()
比喻很形象
Please note that the methods in Listing 1-10 are internal methods and are not part of the
public API, so they may change with newer releases. However, the underlying protocol would remain
the same.
In Listing 1-10, it is easier to first tell what forceLayout( ) is. It is like a touch command in build
environments. Usually when a file hasn’t changed, the build dependencies will ignore it. So, you
force that file to be compiled by “touch”ing, and thereby updating its time stamp. Just like touch,
the forceLayout( ) will not invoke any build commands by itself (unless your build environment is too
@ixiyang
ixiyang / ScreenUtils
Created December 12, 2013 10:03
Charles Harley 写的一个与手机屏幕相关的工具类 http://www.charlesharley.com/2012/programming/android-screen-utility-class/
/* Copyright 2012 Charles Harley
*
* 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
* distributed under the License is distributed on an "AS IS" BASIS,
@ixiyang
ixiyang / LongRunningBroadcastReceiver
Created December 27, 2013 10:01
Long-Running Broadcast Receiver Protocol
//todo