Desire


  • 首页

  • 分类

  • 归档

  • 标签

  • 关于

ListView源码解读

发表于 2017-11-04 | 分类于 读别人的源码,涨自己的智慧
字数统计: 7,805字 | 阅读时长 ≈ 47分钟
ListView的测量onMeasure12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182/** * onMeasure four step * * 1. getWidthMode and getWidthSize etc. * 2. widthSize if(unspcified) * use (position of 0' child width + paddingRight + paddingLeft + scrollBarWidth) * else * modify measureState by childSate * * 3.heightSize if(unspecifi ...
阅读全文 »

TextLayoutBuilder源码解读

发表于 2017-10-29 | 分类于 读别人的源码,涨自己的智慧
字数统计: 4,113字 | 阅读时长 ≈ 24分钟
原理背景Canvas在drawText的时候,如果需要每次都计算字体的大小,边距之类的话,就会非常耗时,导致drawText时间会拉的很长,为了提高效率,android4.0之后引入了TextLayoutCache,使用了LRU缓存了字型,边距等数据,提升了drawText的速度,在4.4中,这个cache的大小是0.5m,全局使用,并且受到系统的控制会在Activity的configurationChanged, onResume, lowMemory, updateVisibility等时机,会调用Canvas.freeTextLayoutCache来释放这部分内存 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758// /frameworks/minikin/libs/minikin/Layout.cpp中的Layout ...
阅读全文 »

SurfaceView源码解读

发表于 2017-09-24 | 分类于 读别人的源码,涨自己的智慧
字数统计: 1,801字 | 阅读时长 ≈ 11分钟
surfaceView的建立整体流程 performTraversals12345678910111213141516171819202122232425private void performTraversals() { boolean viewVisibilityChanged = mViewVisibility != viewVisibility || mNewSurfaceNeeded; ...... Rect frame = mWinFrame; //default is true,indicate whether the view is first attached to the windows. // if mFirst is true ,we should inital the attchinfo,and then dispatch it to its children if (mFirst) { ...
阅读全文 »

ViewRootImpl源码解读

发表于 2017-09-17 | 分类于 读别人的源码,涨自己的智慧
字数统计: 971字 | 阅读时长 ≈ 6分钟
主要功能消息传递12345678910111213前置消息生成hardWare&nativeCode -> InputEventReceiver(dispatchInputEvent)->ViewRootImpl$WindowInputEventReceiver(dispatchInputEvent)->ViewRootImpl(enqueueInputEvent) -> if processImmediately ViewRootImpl(doProcessInputEvents) else ViewRootImpl(scheduleProcessInputEvents) KeyEvent12345678910111213141516171819Target:to find the focus one self or child.get from QueuedInputEvent .....->ViewRootImpl$ViewPostImeIn ...
阅读全文 »

关于canvas的使用

发表于 2017-09-10 | 分类于 读别人的源码,涨自己的智慧
字数统计: 700字 | 阅读时长 ≈ 4分钟
前言12345678WHO AM I:The Canvas class holds the "draw" calls. To draw something, you need4 basic components:1.a Bitmap to hold the pixels2.a Canvas to host the draw calls (writing into the bitmap)3.a drawing primitive (e.g. Rect,Path, text, Bitmap)4.a paint (to describe the colors and styles for the *drawing) 宏观图 易混淆用法canvasdrawArc12345678910111213141516171819202122232425262728/** ### arc center is the left,top,right,bottom center to da ...
阅读全文 »

Drawable源码解读

发表于 2017-08-17 | 分类于 读别人的源码,涨自己的智慧
字数统计: 5,187字 | 阅读时长 ≈ 31分钟
前言Android里最常用的5大包名 package: android.animation android.text android.view android.widget android.graphics 本篇介绍android.graphics当中的drawable Though usually not visible to the application, Drawables may take a variety of forms: Bitmap: the simplest Drawable, a PNG or JPEG image. Nine Patch: an extension to the PNG format allows it to specify information about how to stretch it and place things inside of it. Shape: contains simple drawing commands ...
阅读全文 »

ViewGroup源码解读

发表于 2017-08-13 | 分类于 读别人的源码,涨自己的智慧
字数统计: 7,876字 | 阅读时长 ≈ 49分钟
LinearLayoutonMeasure12345678@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (mOrientation == VERTICAL) { measureVertical(widthMeasureSpec, heightMeasureSpec); } else { measureHorizontal(widthMeasureSpec, heightMeasureSpec); }} measureVertical1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636 ...
阅读全文 »

Animation 源码解读篇

发表于 2017-08-07 | 分类于 读别人的源码,涨自己的智慧
字数统计: 1,104字 | 阅读时长 ≈ 7分钟
代码结构uml类图关于animation 关于animator 设计思想Animation创建流程1.AnimationUtils的加载流程序列图 package android.view.animation; AnimationUtil:ceateAminationFromXml1234567891011121314151617181920212223242526272829303132333435363738394041private static Animation createAnimationFromXml(Context c, XmlPullParser parser, AnimationSet parent, AttributeSet attrs) throws XmlPullParserException, IOException { Animation anim = null; // Make sure we are on a s ...
阅读全文 »

TextView 源码解读篇

发表于 2017-08-06 | 分类于 读别人的源码,涨自己的智慧
字数统计: 5,025字 | 阅读时长 ≈ 30分钟
OverView继承关系 onMeasure调用流程时序图 背景知识关于源码onMeasure123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 ...
阅读全文 »

CCAI2017人工智能大会总结

发表于 2017-07-22 | 分类于 Confluence
字数统计: 2,769字 | 阅读时长 ≈ 9分钟
前言想要快速了解一个行业的现状和瓶颈,最快的方式就是找这个方面的顶尖大咖,听听他们的分享。CCAI人工智能大会正好给我们了解人工智能提供了这样一个平台和入口。 L3的挑战与量产说开什么是L3? L3是汽车自动驾驶的等级,其等级可简单的描述为 等级 自动化程度 L0 warning only L1 hands on L2 hands off L3 eyes off L4 mind off 目前大部分的汽车包括tesla只能达到L2的等级,而L3 是社会对自动驾驶的底线,但是现在的L3更多的是一些演示车和示范车 L3的挑战与量产通过我对李德毅院士分享的理解,L3离大规模的量产还有一段的距离主要有两个原因: 第一个是量产之后如果有存在设计上的缺陷,目前的做法只能是全部召回,不像是软件一样可以通过发补丁包的形式,悄无声息的把所存在的问题给修复掉,这里的成本和代价太大了。 第二个是,对一般人来说cloud computing云计算一定听过很多,但是edge co ...
阅读全文 »
1234
Jinjian

Jinjian

Practice Makes Perfect

31 日志
7 分类
7 标签
RSS
GitHub E-Mail StackOverflow
© 2019 Jinjian
由 Hexo 强力驱动
|
主题 — NexT.Mist v5.1.4