Android 入门
未分类
语言基础
常用类型
基本类型/值类型boolean
int
float
double
引用类型String
Class
Collection{
List{
ArrayList,
LinkedList
}
Map{
HashMap
}
}
方法
ex:public static void main(String[] args) {
// 访问权限/方法类型/返回值/方法名(参数类型 参数名)
}
实例方法Person person = new Person();
person.run();
静态方法Person.run();
多态
抽象抽象类/class
接口/interface
拓展
单继承/多实现
继承Student extend Person
实现Student implements Speakable
异常try {
//需要捕获异常的方法
} catch (Exception e) {
//发生异常
} finally {
//无论是不是异常都会走
}
泛型
泛型接口
//定义 T->泛化的类型 子类去具体化
publicinterfaceSwitcher
//实现
publicclassFragmentSwitcherimplementsSwitcher
泛型方法public T find(T t){
}
反射/注解/并发
Android
UI
布局RelativeLayout
LinearLayout
FrameLayout
控件TextView
ImageView/SimpleDraweeView
Button
EditText
RecycleView
ViewPager
组件
Activity/Fragment
承载显示布局
生命周期
Service/Broadcast Receiver/Content Provide
Intent
组件之间跳转/传值
Bundle
项目中使用
项目按照页面/功能分模块,基本上每个目录对应一个页面/功能
ex:liveroom/直播间
livelist/直播列表
home/首页
mw/魔窗
rn/React Native
....
跳转
view.setOnClickListener(newView.OnClickListener(){
@Override
publicvoidonClick(Viewv){
//跳转逻辑
SwitchFragmentUtil.switchToFragmentFromType("https:www.bolo.me");
}
})
页面
使用 Templates 创建
不分页extends MvvmPageFragment>
分页extends RefreshRecyclerFragment, V extends MvvmLceView, VM extends MvvmBaseViewModel>
不分页 Tabextends RecyclerTab, VM extends MvvmBaseViewModel>
分页 Tabextends RecyclerListTab, VM extends MvvmBaseViewModel>
分页Modelextends BucketedList
不分页ModelPaginatedList
DataBinding
Model->View