File tree 4 files changed +35
-1
lines changed
4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -1793,6 +1793,23 @@ public class MainActivity extends AppCompatActivity {
1793
1793
> ` RecyclerView ` 是官方在5.0之后新添加的控件,推出用来替代传统的` ListView ` 和` GridView ` 列表控件。
1794
1794
> 相对于 ` ListView ` ,` RecyclerView ` 提供了更多的功能和更好的性能。它引入了一些新的概念,如 ` ViewHolder ` 模式,更高效的滚动和动画支持,以及更灵活的布局管理器(` LayoutManager ` )
1795
1795
1796
+
1797
+ * 两者对比*
1798
+
1799
+ | ** 特性** | ** ListView** | ** RecyclerView** |
1800
+ | ----------- | ----------------- | ------------------------------------- |
1801
+ | ** 引入时间** | Android 1.x | Android 5.0+(API 21) |
1802
+ | ** 视图复用机制** | ` convertView ` 复用视图 | ` ViewHolder ` 模式,复用更高效 |
1803
+ | ** 布局管理** | 固定的垂直列表布局 | 通过` LayoutManager ` 灵活定义 |
1804
+ | ** 动画效果** | 不支持 | 内置动画,支持自定义` ItemAnimator ` |
1805
+ | ** 高级功能支持** | 功能有限,需要大量手工实现 | 支持拖拽、滑动删除、多视图类型等 |
1806
+ | ** 性能优化** | 适合简单的小型列表 | 性能更高,适合大规模数据列表 |
1807
+ | ** 分隔线支持** | 内置分隔线功能 | 需要手动实现 |
1808
+ | ** 头部/尾部视图** | 原生支持 | 需要通过` Adapter ` 实现 |
1809
+ | ** 实现复杂度** | 简单易用 | 较复杂,需理解` ViewHolder ` 和` LayoutManager ` 机制 |
1810
+
1811
+
1812
+
1796
1813
* 待续*
1797
1814
1798
1815
### 其他控件
@@ -3673,6 +3690,19 @@ Activity通过`bindService()`绑定到`BindService`后,ServiceConnection类的
3673
3690
3674
3691
无序广播(标准广播)
3675
3692
3693
+ ** 广播优先级**
3694
+
3695
+ 范围为` -1000 ` 到` 1000 ` :
3696
+
3697
+ - ** 值越大,优先级越高** ,接收广播的顺序越靠前。
3698
+ - 默认值为` 0 ` 。
3699
+
3700
+ - 广播按优先级从高到低传递。
3701
+ - 高优先级的接收器可以:
3702
+ - ** 拦截广播** :通过调用` abortBroadcast() ` 方法,阻止广播继续传递。
3703
+ - ** 修改广播内容** :通过` setResult() ` 修改广播的数据。
3704
+ - 如果没有接收器拦截广播,广播会继续传递到优先级较低的接收器。
3705
+
3676
3706
### 基础用法
3677
3707
3678
3708
Original file line number Diff line number Diff line change @@ -130,5 +130,9 @@ git clone --recurse-submodules https://github.com/KomeijiReimu/Android.git
130
130
** 实验6.2(位置 + 文件存储)** (文档中传感器一栏)
131
131
132
132
133
- 设计题要画流程图
133
+ 设计题要 ** 统功能层次图(H 图)、软件部署架构图 **
134
134
135
+
136
+ ![ [ Pasted image 20241226220840.png]]
137
+
138
+ ![ [ Pasted image 20241226220848.png]]
You can’t perform that action at this time.
0 commit comments