day11 | |||
1_回顾昨天&展望今天 | |||
2_fragment入门 | 重要 | ||
3_动态添加fragment | onCreateView | 重要 | |
4_模拟微信主页面完成 | |||
5_Fragment兼容低版本的写法 | 用v4包兼容 | 重要 | 目前用的少 |
6_Fragment的生命周期 | 重要 | ||
7_fragment之间的通信 | 重要 | ||
8_menu菜单介绍 | |||
9_autocompletetextview控件介绍 | 重要 | 常用 | |
10_Android中view动画 | |||
11_应用的反编译 | 重要 | ||
12_使用xml方式定义补间动画 | 重要 | ||
13_属性动画介绍 | 不常用(面试常问) | ||
14_通知栏介绍 | NotificationManager 通知管理者 | 重要 | 语法链式调用 |
15_今日总结-通知栏和服务连用 |
1 fragment入门
[1]在activity布局中定义fragment
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment android:name="com.itheima.fragment.Fragment1"
android:id="@+id/list"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
<fragment android:name="com.itheima.fragment.Fragment2"
android:id="@+id/viewer"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
[2]声明fragment
//定义一个Fragment
public class Fragment1 extends Fragment {
//当用户第一次画ui的时候调用 要显示Fragment自己的内容 setContentView(R.layout.activity_main);
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//[1]通过打气筒把一个布局转换成view对象
View view = inflater.inflate(R.layout.fragment1, null);
- return view;
}
}
[3]name属性 要指定我们自己定义的fragment
事务 执行一段逻辑 要么同时成功 要么同时失败 银行转账
2 动态替换fragment
3 使用fragment创建一个选项卡页面
4 使用fragment兼容低版本的写法
[1]定义fragment继承V4包中的Fragment
[2]定义的activity要继承v4包中的FragmentActivity
[3]通过这个方法getSupportFragmentManager 获取Fragment的管理者
5 fragment的生命周期
[1]使用Fragment必须重写onCreateView方法
[2]还可以重写一个ondestroy方法 做一些收尾的工作
6 fragment之间的通信
[1]Fragment有一个公共的桥梁 Activity
7 menu菜单
[1]添加菜单方式 通过一个布局 在res下 meun目录下创建一个布局
[2]动态的添加
[3]点击menu弹出一个对话框 如果你想实现自己定义的view 效果重写onMeunOpened方法
8 AutoCompleteTextView控件的使用
9 补间动画
[1]透明
[2]旋转
[3]缩放
[4]位移
总结: 动画效果不会改变控件真实的坐标
10 应用程序的反编译
apktools
dex2jar jd.exe 就看程序源码
Android逆向助手
11 使用xml方式定义补间动画
[1]在res下创建一个目录 anim目录
12 属性动画
属性动画会改变控件真实的坐标
如果使用xml方式定义属性动画 要在res下创建一个animator目录
13 通知栏的介绍
[1]Toast
[2]对话框
[3]通知栏
总结学过的manager
[1]smsManager 发短信
[2]telephoneManager 电话的管理者
[3]windowManager 窗口的管理者
[4]fragmenManager fragment的管理者
[5]
NotificationManager 通知的管理者
14 通知栏和服务连用