| | 1 | 1、com.juchaozhi.luncher(启动界面与引导界面包) |
| | 2 | 1>启动界面(com.juchaozhi.luncher.LauncherActivity) |
| | 3 | 1)在onResume事件中根据当前版本号下载最新皮肤SkinUtils.downLoadNewSkin(pcgroupapi) 存放地址为/data/data/com.juchaozhi/app_skin |
| | 4 | 2)startBackgroundService加载导行栏信息(一开始加载的是本地或assets/discount_menu.config里面的,在MainActivity才会调用网络的JuInitUtil.startPreload) |
| | 5 | 2>引导界面(com.juchaozhi.luncher.GuideActivity) |
| | 6 | 使用ViewPager控件 |
| | 7 | |
| | 8 | |
| | 9 | 2、com.juchaozhi.main(主界面包) |
| | 10 | 1>主要界面com.juchaozhi.main.MainActivity |
| | 11 | 1)侧边栏使用SlidingMenu这个开源控件 下载地址:https://github.com/jfeinstein10/SlidingMenu |
| | 12 | 2>com.juchaozhi.main.MainTabFragment(界面切换) |
| | 13 | |-公共头部include app_top_banner_layout |
| | 14 | |-com.juchaozhi.discount.DiscountMainFragment(优惠) |
| | 15 | |-com.juchaozhi.find.FindMainFragment(发现) |
| | 16 | |-com.juchaozhi.showorder.ShowOrderFragment(晒单) |
| | 17 | |-com.juchaozhi.subscribe.SubscribeMainFragment(订阅) |
| | 18 | |-com.juchaozhi.topic.TopicFragment(专题) |
| | 19 | 对应的xml文件为activity_main.xml |
| | 20 | 实现功能包括底部tab切换,搜索页面跳转,个人中心侧边栏 |
| | 21 | 3>com.juchaozhi.main.MainTabSkinService(主要提供tab切换时的切换背景图片) |
| | 22 | 4>com.juchaozhi.main.NavigationFragment(暂时没发现有用到) |
| | 23 | 5>com.juchaozhi.main.NavifationListAdapter(暂时没发现有用到) |
| | 24 | 6>com.juchaozhi.main.NavigationService(顶部菜单数据来源) |
| | 25 | *根据传过来的类型来判断获取那个tab的顶部菜单(MainTabFragment.TAB_DISCOUNT,MainTabFragment.TAB_FIND等),数据优先获取SD卡(路径为:/data/data/com.juchaozhi/**.config,SD卡里面的文件在进入MainActivity这个类时会调用JuInitUtil.startPreload方法从网络上加载最新的菜单到本地),如果sd卡没有则获取assets目录下对应的文件 |
| | 26 | |
| | 27 | |
| | 28 | 3、com.juchaozhi.discount包(优惠主页) |
| | 29 | 1>com.juchaozhi.discount.DiscountMainFragment(优惠主界面) |
| | 30 | *顶部tab切换使用的是开源框架Android-ViewPagerIndicator 下载地址:https://github.com/JakeWharton/Android-ViewPagerIndicator |
| | 31 | *下拉箭头按扭discountIndicatorImg 对应的Activity为com.juchaozhi.columns.ColumnsMainActivity |
| | 32 | *所有的ViewPager 来源于DiscountFragment |
| | 33 | 2>com.juchaozhi.discount.DiscountFragment(优惠列表activity) |
| | 34 | 数据请求调用 cn.com.pcgroup.android.framework.http.client.AsyncHttpClient这个封装类来实现,再通过DiscountUtil转成对应的BEAN |
| | 35 | 3>com.juchaozhi.discount.DiscountAdapter(优惠列表Item适配器) |
| | 36 | 4>com.juchaozhi.discount.DiscountUtil |
| | 37 | 里面封装了优惠主页的所有对象(JSON转BEAN) |
| | 38 | GoodsMessage 列表 |
| | 39 | ArticleModel 列表详情(WebView) |
| | 40 | getComment 评论列表 |
| | 41 | .. |
| | 42 | 5>com.juchaozhi.discount.ArticleActivity(列表详情--公用) |
| | 43 | 需要注意protocol方法(里面有做URL拦截,跳转到图赏界面,收藏界面等) |
| | 44 | 6>com.juchaozhi.discount.ArticleGestureService(详情手势,根据左右滑动切换到列表或评议) |
| | 45 | 7>com.juchaozhi.discount.BusinessListActivity(ArticleActivity页面的点击直达连接时会进入该页面,商品购买.webView) |
| | 46 | 8>com.juchaozhi.discount.CommentActivity(评论界面) |
| | 47 | 9>com.juchaozhi.discount.CommentAdapter(评论适配器) |
| | 48 | 10>com.juchaozhi.discount.CommentWriteActivity(写评论界面) |
| | 49 | |
| | 50 | |
| | 51 | 4、com.juchaozhi.discount.adapter(优惠图片适配器包) |
| | 52 | 1>com.juchaozhi.discount.adapter.MyHeaderAdapter (优惠信息顶部图片) |
| | 53 | |
| | 54 | |
| | 55 | 5、com.juchaozhi.discount.service包 |
| | 56 | 1>com.juchaozhi.discount.service.DiscountService(优惠信息公共方法) |
| | 57 | 包括:优惠列表ListView 右边浮动时间控件的显示和隐藏,定时刷新列表等功能 |
| | 58 | |
| | 59 | |
| | 60 | 6、com.juchaozhi.find包(发现,结构跟优惠差不多) |
| | 61 | 1>com.juchaozhi.discount.FindMainFragment |
| | 62 | 顶部tab切换使用的是开源框架Android-ViewPagerIndicator 下载地址:https://github.com/JakeWharton/Android-ViewPagerIndicator |
| | 63 | 下拉箭头按扭findIndicatorImg 对应的Activity为com.juchaozhi.columns.ColumnsMainActivity |
| | 64 | 所有的ViewPager 来源于FindFragment |
| | 65 | 2>com.juchaozhi.discount.FindFragment(发现列表activity) |
| | 66 | 界面使用PullToRefreshGridView 开源控件 使用方式可参考以下地址:http://www.haogongju.net/art/2774333 |
| | 67 | 里面的item组件点击后跳转到com.juchaozhi.discount.ArticleActivity详情界面 |
| | 68 | 3>com.juchaozhi.discount.FindAdapter(FindFragment 中间列表数据适配器) |
| | 69 | 4>com.juchaozhi.discount.Shake*(暂时没发现什么地方使用到) |
| | 70 | |
| | 71 | |
| | 72 | 7、com.juchaozhi.showorder(晒单) |
| | 73 | 1>com.juchaozhi.showorder.ShowOrderFragment(晒单主界面) |
| | 74 | 界面使用PullToRefreshGridView 开源控件 使用方式可参考以下地址:http://www.haogongju.net/art/2774333 |
| | 75 | 里面的item组件点击后跳转到com.juchaozhi.discount.PostActivity晒单终端页 |
| | 76 | 2>com.juchaozhi.discount.PostActivity(晒单终端页) |
| | 77 | 主要也是WebView界面,使用的xml文件是article_activity.xml.地址为:http://mrobot.pconline.com.cn/best/topics/109089?pageNo=1&authorId=0 |
| | 78 | 3>com.juchaozhi.discount.CircularImageView(圆角ImageView,实际并没有使用,可删除) |
| | 79 | 4>com.juchaozhi.discount.OrderAdapter(晒单评论适配器) |
| | 80 | 5>com.juchaozhi.discount.OrderItem(订单bean) |
| | 81 | 6>com.juchaozhi.discount.OrderUtil(晒单的一些公共方法) |
| | 82 | 7>com.juchaozhi.discount.PostWriteActivity(回帖界面) |
| | 83 | |
| | 84 | |
| | 85 | 8、com.juchaozhi.topic(专题包) |
| | 86 | 1>com.juchaozhi.topic.TopicFragment(专题主界面) |
| | 87 | 主要是webView 加载的页面为:JuInterface.TOPIC_URL JuInterface类为(聚超值接口类) |
| | 88 | |
| | 89 | |
| | 90 | |
| | 91 | |
| | 92 | |
| | 93 | |
| | 94 | |
| | 95 | |
| | 96 | 9、个人中心与之相关的包为:com.juchaozhi.personal包。 |
| | 97 | 1>PersonalFragement类为个人中心的入口类。在其中初始化了整个个人中心的布局,里面主要涉及到了对我的爆料、我的收藏、推送定制、消息中心、设置 这些功能的事件点击分发。在该类中,如果用户登录则跳转正常,没有登录则除了爆料功能外显示到登录页面。 |
| | 98 | 2>PersonalUtil类主要封装了获取用户个人信息、签到、爆料的网络请求和json解析方法。 |
| | 99 | 3>PostTipOffActivity类是针对用户在个人中心点击爆料按钮后进行爆料的activity,如果是登录用户就隐藏了邮箱填写的布局,非登录用户显示,在其中主要是对邮箱格式进行了验证,对需要爆料的信息在退出时进行了缓存。 |
| | 100 | 4>SettingActivity类为设置界面,由PersonalFragement类中分发而来。当该activity初始化的时候,既会去检查是否是用太平洋、QQ、新浪帐号登录过。如果登录过则显示的是登录后的界面,如果未登录就显示的是未登录界面。同时还会请求CacheUtil该类中获取缓存的方法。CacheUtil中封装了缓存的获取和缓存的删除操作。SettingActivity类中主要涉及到的是登录、平台绑定(调用了魔方里面的封装方法)、清理缓存(调用CacheUtil清除)、意见反馈的事件分发、关注微博(也是调用魔方的封装方法)、关于我们(就是一个activity界面展示)、退出帐号。 |
| | 101 | |
| | 102 | |
| | 103 | 10、我的爆料功能与之相关的包为:com.juchaozhi.tipoff |
| | 104 | 1>TipoffActivity为入口类。里面主要实例化了自定义的头部Tab和viewPager,其中添加了一个自动刷新列表功能。 |
| | 105 | 2>TipoffAdapter作为我的爆料的item的自适配用。 |
| | 106 | 3>TipoffFragement 为爆料审核过或者未审核通过的子页面。 通过爆料的条目才可以点击进入文章详情页面。 |
| | 107 | 4>TipoffTabSwitcher为自定义的控件。接收传递过来的布局然后进行初始化。里面主要是对viewpager的滑动事件和本身layout中的点击事件做了监听,其目的主要是为了达到tab头部颜色的变化。 |
| | 108 | 5>TipoffUitl主要是封装了我的爆料的数据请求和json解析,都是通过定义一个接口提供给调用者回调。 |
| | 109 | |
| | 110 | 11、我的收藏与之相关包为:com.juchaozhi.collection |
| | 111 | 1>CollectionMainActivity为主类,其中逻辑基本和我的爆料一样。都是通过需要请求的页面类型来实例化子页面的Fragment。 |
| | 112 | 2>CollectionTabIndicator类作用也和我的爆料中TipoffTabSwitcher作用一样。但是其中因为有设置数字多少所以多了一个set数字的方法。 |
| | 113 | 3>CollectionTabFragment为各个收藏的子页面。 |
| | 114 | 4>CollectionUtil封装了对收藏的网络请求解析和本地数据同步的问题。里面涉及到的东西比较多,因为收藏分成了两种状态,一种是:本地收藏的和网络是同步的。一种是:本地和网络是不同步的。所以里面对数据本地化保存和同步这块写了很多方法。 |
| | 115 | 5>CollectionDelDialog为删除某个本地收藏的时候弹出的自定义提示框。 |
| | 116 | |
| | 117 | 12、推送定制与之相关的包为: com.juchaozhi.push |
| | 118 | 1>PushSetActivity为主类里实例化了推送的界面,消息提示设置(如声音、震动、勿扰模式)等是通过listView.addHeaderView指定来list头部。其中推送是否开启等各种推送状态的记录都是通过PreferencesUtils类的方法记录在SharePreferences中。消息提示设置的记录是在魔方的SettingSaveUtil中。其中日期选择控件用到了numberpicker这个开源项目。推送设置的列表信息来源于本地asset文件夹中的push_topic_url.config配置文件。 |
| | 119 | 2>PushTopicListService 该类主要是为了从配置文件中获取定制列表用。 |
| | 120 | 3>PushTopicAdapter 就是定制列表的adapter,其中点击某个定制开关之后,这里逻辑稍微有点麻烦,因为进入的时候是初始化的国内优惠和海淘资讯为true,点击之后应该变为false,这里状态的改变是根据当前状态来变化。点击按钮的时候状态还是没变的。是经过代码设置之后才变化所以里面代码逻辑看上去可能有点乱。 |
| | 121 | |
| | 122 | 13、消息中心与之相关的包为:com.juchaozhi.message |
| | 123 | 1>MessageMainActivity为主类里面通过TabPageIndicator类进行了头部滑动栏实例化。在oncreate中进行了网络请求进行了消息数量的初始化。同时也在中间实例化了MyMessageFragment,ReceivedCommentsFragment,PostedCommentsFragment这几个子页面。 |
| | 124 | 2>ExpandTextView 类为该自定义TextView。目的是为了消息列表中消息内容很多的情况下进行扩展。里面定义了三种状态,没有消息就是STATUS_HIDE,一行可以显示就是STATUS_ENOUGH,需要多行显示就是STATUS_EXPAND。 |
| | 125 | 3>ListAdapter类 没用到。 |
| | 126 | 4>MyMessage类 没用到。 |
| | 127 | 5>MessageUtil类主要封装了对消息相关json数据的解析方法。 |
| | 128 | 6>MyMessageFragment类 为我的消息子页面。 |
| | 129 | 7>MyMsgAdapter为我的消息的adapter。 |
| | 130 | 8>ReceivedCommentsFragment类为收到评论子页面。 |
| | 131 | 9>ReceivedComment为收到的消息的实体类。(发出的评论实体类也是这个) |
| | 132 | 10>ReceivedCommentsAdapter为收到评论的adapter。 |
| | 133 | 11>PostedCommentsFragment类为发出评论子页面。 |
| | 134 | 12>PostedCommentsAdapter为发出评论adapter。 |
| | 135 | |
| | 136 | 14、 订阅功能相关的包为:com.juchaozhi.subscribe |
| | 137 | 1>SubscribeMainFragment为主类里面也是ViewPager+Fragment的形式实例化了SubscribeListFragment(订阅内容页)和SubscribeKeyWordFragment(订阅关键词页面)。 |
| | 138 | 2>SubscribeHint类为订阅线索的实体类。(类似保存一个订阅的keyword)主要是为了与服务端交互出关键词搜索列表用。 |
| | 139 | 3>SubscribeKeyWordFragment订阅关键词页面。里面头部用到了nubmerpicker这个开源控件用来选择电商信息。具体逻辑是在SubscribeKeyWordFragment中以starActivityforResult的方式调用SubscribeMallActivity类进行电商选择,在SubscribeMallActivity类中又调用了SubscribeSelectItemService从asset中获取配置的电商信息。底部就是一个列表展示已经订阅过的信息。 |
| | 140 | 4>SubscribeListFragment为订阅内容页。 |
| | 141 | 5>SubscribeMallActivity主要是提供了用户订阅的时候选择电商类型操作的类。 |
| | 142 | 6>SubscribeRecord订阅类内容的实体类(包含一些关键词,电商,分类等信息)。 |
| | 143 | 7>SubscribeRecordAdapter就是订阅记录的adapter |
| | 144 | 8>SubscribeSelectItemService类 从asset目录中读取电商信息的配置文件 |
| | 145 | 9>SubscribeUtil 封装了将服务器数据存入本地,从本地取订阅记录。 |
| | 146 | |
| | 147 | 15、搜索功能相关的包为:com.juchaozhi.search |
| | 148 | 1>MyFragment这个类没用到过 |
| | 149 | 2>SearchActivity为主类里面初始化了界面和点击事件,如果开始搜索就会实例化 优惠、海淘、发现 三个fragement。页面下部分就是一个gridview显示一些热词信息。 |
| | 150 | 3>SearchDiscountFragment优惠的子页面,都是通过SearchActivity传入的keywork进行的数据请求展示。 |
| | 151 | 4>SearchFindAdapter发现页面的adapter |
| | 152 | 5>SearchFindFragment发现的子页面,基本和SearchDiscountFragment一样的逻辑。 |
| | 153 | 6>SearchResultFragmentPagerAdapter类用于SearchActivity中初始化结果页面的时候用。 |
| | 154 | 7>SearchSeaWashesFragment 海淘搜索页与优惠搜索页数据和布局一直调用同一套布局和适配器。 |
| | 155 | 8>SearchUtil 就是封装了对热词的解析操作。 |
| | 156 | 9>SimulateOnResume 接口,主要用来点击或者滑动到不同栏目的时候调用onResume方法的时候用到。 |