分类模块
1、TypeFragment extends BaseFragment
TypeFragment的布局文件是fragment_type.xml,
其中使用第三方库FlycoTabLayout实现顶部导航;
使用FrameLayout装载Fragment(ListFragment和TagFragment)
2、ListFragment extends BaseFragment
1 布局文件是fragment_list.xml,其中使用ListView(左)和RecyclerView(右)
2 ListView的适配器:TypeLeftAdapter extends BaseAdapter,布局文件是type_left_item.xml,其中组件是TextView
3 RecyclerView的适配器:TypeRightAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
该适配器下有两种类型:热卖推荐和常用分类(HOT和ORDINARY)
该适配器的构造函数需传入网路获取的数据
HOT类型对应的布局文件:item_hot_right.xml,
其中组件有TextView,HorizontalScrollView(该控件下又包含水平的LinearLayout,LinearLayout下动态加载
ImageView和TextView)
ORDINARY类型对应的布局文件:item_ordinary_right.xml,
其中组件有ImageView和TextView
4 利用Gson获取数据,并存入到TypeBean中;再从TypeBean中获取数据传入到TypeRightAdapter的适配器里 3、TagFragment extends BaseFragment
1 布局文件:fragment_tag.xml,其中控件是GridView
2 GriedView的适配器:TagGridViewAdapter,
该适配器的构造函数中需要传入网络数据
该适配器的子布局为item_tag_gridview,组件是唯一的TextView
TagFragment里利用Gson获取网络数据,存储到TagBean中;再从TagBean中获取数据传入到TagGridViewAdapter