实现思路很简单左侧栏目是一个一个的 Fragment 的,点击时动态替换各个 Fragment 到当前 Activity 中。
关键代码:
public void loadFragment(Map map) {
if (map == null) {
return;
}
try {
getSlidingMenu().toggle();
String title = (String) ("title");
if (currentTitle == null || !currentTitle.equals(title)) {
currentTitle = title;
// set title
this.title.setText(title);
Class> cls = (Class>) ("class");
String tag = (String) ("tag");
Fragment fragment = (Fragment) wInstance();
// Insert the fragment by replacing any existing fragment
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.fragment_content, fragment, tag)mit();
}
} catch (Exception e) {
e.printStackTrace();
}
}
首页布局:
1 SliddingMenu + ViewPagerIndicator
2 JSON 解析 FastJson
3 网络请求 Volley
4 sqlite 数据库简单封装,主要处理数据库版本升级问题
5 微信、微博 API 简单封装
6 代码混淆
。。。。。。
来源:.html
本文发布于:2024-02-02 12:59:56,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170684999743963.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |