View 基类:
视图对象在屏幕特定矩形区域处理自己的尺寸,布局,绘图,焦点切换,滚动,按键/手势交互.也
接收用户交互事件.

View 是 Widget基类,为之提供服务.
ViewGroup 是 Layout 基类,为之提供服务.

视图体系:
ViewGroup   |ViewGroup   |    |View    ViewGroup            |            View



布局:
声明式布局 main.xml

Widgets:
UI组件

UI 事件:
1.定义一个事件监听器,并使用视图注册
2.重写视图回调方法


Menus:
MENU key
菜单键
定义
onCreateOptionsMenu()
onCreateContextMenu()
回调方法声明菜单项.不需要注册事件监听器在菜单中.

声明式菜单项.


Adapters:
适配器

Styles and Themes:
样式:View
主题:Activity或应用

声明式布局:
使用XML文件来描述布局,避免硬编码.提高布局的灵活性.同时表现与行为分离.

创建菜单:
可选菜单:包括图标菜单和扩展菜单.图标菜单最多支持6个菜单项.不支持单选,多选框.
上下文菜单:
子菜单:作文可选菜单和上下文菜单的子菜单,但不能再嵌套子菜单.

在XML中定义菜单
快捷键


Creating Dialogs:
AlertDialog
ProgressDialog
DatePickerDialog
TimePickerDialog

处理 UI Events:
onClick()
From View.OnClickListener.
This is called when the user either touches the item (when in touch mode), or focuses upon the item with the navigation-keys or trackball and presses the suitable "enter" key or presses down on the trackball.

onLongClick()
From View.OnLongClickListener.
This is called when the user either touches and holds the item (when in touch mode), or focuses upon the item with the navigation-keys or trackball and presses and holds the suitable "enter" key or presses and holds down on the trackball (for one second).

onFocusChange()
From View.OnFocusChangeListener.
This is called when the user navigates onto or away from the item, using the navigation-keys or trackball.

onKey()
From View.OnKeyListener.
This is called when the user is focused on the item and presses or releases a key on the device.

onTouch()
From View.OnTouchListener.
This is called when the user performs an action qualified as a touch event, including a press, a release, or any movement gesture on the screen (within the bounds of the item).

onCreateContextMenu()
From View.OnCreateContextMenuListener.
This is called when a Context Menu is being built (as the result of a sustained "long click"). See the discussion on context menus in Creating Menus for more information.

事件处理器:

onKeyDown(int, KeyEvent) - 按键.
onKeyUp(int, KeyEvent) - 按键.
onTrackballEvent(MotionEvent) - Called when a trackball motion event occurs.
onTouchEvent(MotionEvent) - 触摸屏幕
onFocusChanged(boolean, int, Rect) - 获取和失去焦点

用户通知:
Toast Notification: 弹出一个窗口
Status Bar Notification: 状态条
Dialog Notification: 对话框


应用样式和主题:
styles.xml

自定义UI组件:

AdapterView 绑定数据

常用布局对象:
FrameLayout: 帧布局,所有子对象都定位在左上角,并且重叠放置.
LinearLayout: 线性布局,所有子对象从左到右依次排列或从上到下依次排列.不换行/列.
TableLayout: 表格布局,简单表格行列式布局.
RelativeLayout: 相对布局,相对元素布局.


视图渲染:
视图渲染是从视图树根结点开始.分2个过程.第一个过程计算大小measure,第二个过程确定布局layout.
视图渲染从根结点开始广度优先draw().


更多相关文章

  1. Android布局方式浅析
  2. CoderPig’s Android(安卓)Study Note——目录
  3. Android(安卓)popupwindow弹出对话框
  4. Android中快速为Recyclerview添加头部
  5. Android(安卓)FrameLayout布局中的控件设置居中动态设置
  6. Android(安卓)studio登录界面
  7. MVVM + dataBinding
  8. android圆形旋转菜单,教你分分钟搞定它,CircleMenu
  9. android 在当前的布局上加载xml填充内部

随机推荐

  1. 获取Android(安卓)System 写入权限
  2. [日更-2019.4.22、23、24] cm-14.1 Andro
  3. Android下引用系统库的方法及问题
  4. 【Android】Android中两种常用布局(Linear
  5. 解决AndroidStudio连不上Android设备真机
  6. android中简单的Handler与Message
  7. Android(安卓)Drawable 那些不为人知的高
  8. Android(安卓)逆向apk程序的心得
  9. Android框架理解之USB
  10. Android(安卓)自定义上面圆角下面直角的I