共享Github 比较好的代码示例, 代码规范 且 容易入手。
并且,自定义了一套输出log的框架,可以在运行时展现在应用界面上,更容易掌握关键。
1. RecylerView 基础使用(可动态修改LayoutManager 为 LinearLayoutManager或者GridLayoutManager)
2. RecylerView 动态增加/删除/修改 某个item, 并且用动画过渡
3. SwipeRefreshLayout 下拉刷新
模拟数据3s更新 (字符串), 在创建其它示例,需要用到模拟数据,可以参考。
4.SwipeRefreshLayout 下拉刷新进阶版 (实现ListView 和 自定义View 均可下拉刷新)
https://github.com/android/views-widgets-samples/tree/main/SwipeRefreshMultipleViewshttps://github.com/android/views-widgets-samples/tree/main/SwipeRefreshMultipleViews5. ViewPager2的使用 (View/Fragment/ 动态增加删除页面/ 联动TabLayout/ 模拟滑动/ 组合RecylerView/ 滑动切换效果等, 非常强大)
https://github.com/android/views-widgets-samples/tree/main/ViewPager2https://github.com/android/views-widgets-samples/tree/main/ViewPager26. MultiWindow 入门(App 内启动新的Activity, 以多窗口的形式显示出来)
PS: 应用进入多窗口模式, 最近任务栏 -> 点击应用图标 -》 多窗口打开
此外:
Activity.isInMultiWindowMode 可以判断是否在多窗口模式
intent 启动activity方式下, 加入flag 可以让应用 进入 分屏模式, 主要加new task 标志
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK)
7. ConstraintLayout
(约束性布局, 适合有一定基础的看,如了解了ConstraintSet.appTo(rootLayout)
8.DataBinding (ViewDataBinding) 结合 RecyclerView使用 (不同ItemType)
封装性较强,RecyclerView.Adapter 封装成 DataBoundAdapter