z25

android lib project,,大得项目可以使用。可以使用lib 


引用属性,可配置化
A style attribute resource allows you to reference the value of an attribute in the currently-applied theme. 仅仅是属性,不是style 。缺省是直接套配theme 中相同的att ,但是这样可以定义为 secongAtt
android:textColor="?android:textColorSecondary" 
属性很多,我们可以选择也很多 textColor ,textColorLink ,textColorSecondary,有时候全部了解系统属性。当然也可以直接用系统定义的color secondary_text_dark
stytle 和 stytlable 的区别。
如何使用系统定义,如何了解系统定义了那些属性。
android.R  是个宝藏
String 中的属性,不必要都copy ,因为String 字符串是根据String 名字查找的。只有Layout 之类整个文件 属性 ,才需要整体copy 。


android为什么不按分辨率和尺寸。 mdpi 和small 烦死啦。


Api demo 里面 styable 的使用,Api demo 也是个宝藏。


full wide VGA 。
Calendar activity不能有与Calendar或其它activity同样的亲缘性(affinity),也就是将该亲缘性设为空字符串即可。
toast 也可以定制,一切皆可以定制。


为什么淘金岛背景音乐不休眠。
http://stackoverflow.com/questions/6806963/android-mediaplayer-powermanager-partial-wake-lock
http://stackoverflow.com/questions/4522905/how-to-stop-service-when-action-screen-off 可以这样监听关闭 音乐




android:authorities="com.example.autos.autoinfoprovider" ,注册provider


常用颜色的RGB值及中英文名称
http://blog.csdn.net/xinke453/article/details/6757535


menu SubMenu ,group menu ,checkable menu 。
menu stytle 。没有防备的可定制框架。


http://www.android10.org/index.php/forums/43-view-layout-a-resource/195-customizing-the-options-menu-background
重载 LayoutInflater 定制menu ,但是最好还是不用系统 menu ,不好定制。




api demo ,架构,


汉字显示的最小像素


In touch mode, there is no focus and no selection. Any selected item in a list of in a grid becomes unselected as soon as the user enters touch mode. Similarly, any focused widgets become unfocused when the user enters touch mode. The image below illustrates what happens when the user touches a list after selecting an item with the trackball.
For a touch capable device, once the user touches the screen, the device will enter touch mode. From this point onward, only views for which isFocusableInTouchMode() is true will be focusable, such as text editing widgets. Other views that are touchable, like buttons, will not take focus when touched; they will only fire the on click listeners.
why touch no focus selection
hdpi ,不找 default ,却找上mdpi 。对它是一样的。


仔细思考,不要下错误的结论。
注意目录结构不要搞错


为什么在select user 里面 gone 好像也占了空间,  不是gone 问题,还是代码问题,marginleft 太大 。


name="myInfoDialog" parent="@android:style/Theme.Dialog"
parent="android:Theme"  这样省掉?


关于svn tag ,
tag 就是新建一个目录。你可以在新tag 上做,也可以在原来tag 上做,tag 只是个备份。
最好建立在tags 下面


progressDialog 
addContentView(progressBar, new LayoutParams(width, height));


dialog 就是一个小window ,activity ,它有自己的menu 。比popup window 复杂的多。     
可以定制 ,set contextVIew ,不过通常用AlertDialog 。而且用bulder 方法来构建。
alertdialog 加了几个button 。好通知。


progressbar 处理
 
电子书格式  ,开源
http://en.wikipedia.org/wiki/Comparison_of_e-book_formats#IDPF.2FEPUB
epub 格式
http://618119.com/archives/2010/03/04/162.html




android core class
View class 方法
event ,dispatch ,on, addListener
addListener( key  ,touch 
 click ,doubleclick ,drag ,genericmotion
 focus ,contextMenu,attach,
 hover )
 
draw ,onmeature 
position,layoutPara,padding margin
touchmod ,create ,lifecycle , attachwindow 
fadingEdge android:longClickable,android:minHeight
android:rotation 
bringToFront()


android.view.ViewGroup.LayoutParams
type ,flag ,bright ,dim ,position ,gravity
flag 都比较复杂。


popup view 显示
public void showAtLocation(View parent, int gravity, int x, int y) {
 WindowManager.LayoutParams p = createPopupLayout(parent.getWindowToken());
 }
 
parent view 只是为了get token 。其余要自己设置 WindowManager.LayoutParams。
p.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
p.token = token;


浮动窗口拖动
http://www.eoeandroid.com/thread-71478-1-1.html


dialog.dismiss ,remove ,cancel, cancelListener


recent task 的bug  和  home  的区别。
recent 用 base intent 。
Home 用 Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED




用 startForResult 处理 更方便 ,直接传消息给父亲Activity 。
可以同时打开多个Activity ,多个forResult 。可以管理(关闭)子activit 并处理消息。
从 ActivityManager 里面 取 recentTask  baseIntent 只读 ?可能并不是。


网络处理,监听器,分层做的不错。但是
绘制,大部分可以用layout ,牌可以自己定义个view 。只有nitify view 需要绘制。
绘制 对齐,定位,大小。图片 src 和 disc 。
计时器,连续handler 。
网络消息组件,可以用个vector 处理,但是dialog 消息处理 不应该。不应该什么都。
牌的分类,位置,计时器view 。


定制labelView     /**
     * @see android.view.View#measure(int, int)
     */
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        setMeasuredDimension(measureWidth(widthMeasureSpec),
                measureHeight(heightMeasureSpec));
    }
    
<attr name="android:galleryItemBackground" /> 如何取系统Theme的Itembackground 属性。
需要自己定义一个 stytlable ,包含这个属性,再使用
TypedArray attr = mContext.obtainStyledAttributes(R.styleable.HelloGallery);
mGalleryItemBackground = attr.getResourceId(
R.styleable.HelloGallery_android_galleryItemBackground, 0);


第一要取系统属性,其实也该可以用系统的styable ? 没有。
自己定义一个,使用系统的,注意 名字。引用,和自定义的区别。引用只有名字,还有andorid 前缀。
还不如不用呢。
见官方的galley tutorial           


gallery 可以 set space ,比较方便。 还可以set gravity ,还可以监听事件。


rom file  directory


Get a View that displays in the drop down popup the data at the specified position in the data set.
应该是专门为Spinner 显示 单个view 的时候用的。因为其他地方看不到使用


 Image.setLayoutParams(new Gallery.LayoutParams(layout, layout));
 可以自己设,不然系统也会帮你设。
 设错了,就有问题了。
 
contextMenu 需要注册 ,然后就可以监听 事件了。
public void registerForContextMenu(View view) {
  view.setOnCreateContextMenuListener(this);
}
View.OnCreateContextMenuListener
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
可以得到 AdapterView 的 附属信息


menu 不易重用,dialog 还好一点。


     
1 frameLayout 
2 eidtAction ,set error 
3 thread 动画
4 ListView ,Image 
5 AsyncTask 
6 camera scale 
7 httpupload 
8 page framework  and clear image framework




recent task 。


dialog setCanceledOnTouchOutside(true);
ImageButton and dialog 
  
The monkeyrunner tool is primarily designed to test applications and devices at the functional/framework level and for running unit test suites, but you are free to use it for other purposes.
The monkeyrunner tool provides an API for writing programs that control an Android device or emulator from outside of Android code. With monkeyrunner, you can write a Python program 
Use Jython,can use alll java class ,like Python .




File path = Environment.getDataDirectory(); 
StatFs stat = new StatFs(path.getPath()); 
long blockSize = stat.getBlockSize(); 
long availableBlocks = stat.getAvailableBlocks();


取目录大小 。


android XML paser 
http://disanji.net/2011/01/29/android-xml-study-compare/




motionEvent keyup 没有执行 ,在parent ListView onKeyup 中调用 ,ImgBtnMgr 再把全部button 恢复。
Imagebutton 拖拉,还在listview 的时候 会 有 up ,但是 拖拉出 listview 后 ,只会触发一个 cancel 事件。同时 listview 会触发 一个 up 事件。
ACTION_OUTSIDE is only used in activity ,not view 。所以 outside 监听也没用。
Activity ontouchEvent ,只有 view 不处理才触发。
注意 cancel 事件。
  
  
onInterceptTouchEvent
先传给child 。如果不处理,才父亲。
如果不处理,以后的down 就不传了
如果拦截掉也就不传了。


Activity 有可能只是在后台,但是永远可见,(前面是透明的,或非全屏)


http://blog.csdn.net/feng88724/article/details/6362710
悬浮窗口


Shader is the based class for objects that return horizontal spans of colors during drawing. A subclass of Shader is installed in a Paint calling paint.setShader(shader). After that any object (other than a bitmap) that is drawn with that paint will get its color(s) from the shader.


params.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL | LayoutParams.FLAG_NOT_FOCUSABLE;  
可以让后面的能操作,但是,前面的touch 也可以。


public boolean isInTouchMode() {
  if (mAttachInfo != null) {
      return mAttachInfo.mInTouchMode;
  } else {
      return ViewRoot.isInTouchMode();
  }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值