尚硅谷Android项目之_硅谷商城项目全套源码解析(四、分类)
2016-12-26 00:54
495 查看
一、简介
承接上文:尚硅谷Android项目之_硅谷商城项目全套源码解析(三、首页)
上篇博客概括的介绍了硅谷商城项目的首页技术要点。本篇内容给大家讲解硅谷商城项目分类,分类页面用的技术包括:采用FlycoTabLayout实现标签和分类切换、布局采用百分比适配、整体数据展示采用仿京东的分类页面、热卖类型布局横向滚动采用HorizontalScrollView。
二、详细资源地址
由于篇幅所限,详情情况见如下地址视频和笔记
项目免费视频讲解下载地址:http://www.atguigu.com/download.shtml
github地址:https://github.com/atguigu01/Shopping
作者:大海哥
三、效果展示
![](https://oscdn.geek-share.com/Uploads/Images/Content/202005/11/049551323eaed7d61b374f446843aa99)
![](https://oscdn.geek-share.com/Uploads/Images/Content/202005/11/4cf65c178ea414fd43634ff139ec3a9b)
四、技术详解
1、采用FlycoTabLayout实现标签和分类切换
详细事情情况参考https://github.com/H07000223/FlycoTabLayout;
2、布局采用百分比适配
1)导包
compile'com.android.support:percent:23.3.0'
2)布局文件:
<android.support.percent.PercentRelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".type.fragment.ListFragment">
<ListView
android:id="@+id/lv_left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="#11000000"
android:scrollbars="none"
app:layout_widthPercent="22%"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_right"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_toRightOf="@id/lv_left"
app:layout_widthPercent="78%"/>
</android.support.percent.PercentRelativeLayout>
3、热卖类型布局横向滚动采用HorizontalScrollView
<HorizontalScrollView
android:scrollbars="none"
android:id="@+id/hsl_hot_right"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/ll_hot_right"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"/>
</HorizontalScrollView>
4、整体数据展示采用仿京东的分类页面
左侧分类商品采用listview,右侧商品展示采用分类型recyclerview显示商品。
承接上文:尚硅谷Android项目之_硅谷商城项目全套源码解析(三、首页)
上篇博客概括的介绍了硅谷商城项目的首页技术要点。本篇内容给大家讲解硅谷商城项目分类,分类页面用的技术包括:采用FlycoTabLayout实现标签和分类切换、布局采用百分比适配、整体数据展示采用仿京东的分类页面、热卖类型布局横向滚动采用HorizontalScrollView。
二、详细资源地址
由于篇幅所限,详情情况见如下地址视频和笔记
项目免费视频讲解下载地址:http://www.atguigu.com/download.shtml
github地址:https://github.com/atguigu01/Shopping
作者:大海哥
三、效果展示
四、技术详解
1、采用FlycoTabLayout实现标签和分类切换
详细事情情况参考https://github.com/H07000223/FlycoTabLayout;
2、布局采用百分比适配
1)导包
compile'com.android.support:percent:23.3.0'
2)布局文件:
<android.support.percent.PercentRelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".type.fragment.ListFragment">
<ListView
android:id="@+id/lv_left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="#11000000"
android:scrollbars="none"
app:layout_widthPercent="22%"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_right"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_toRightOf="@id/lv_left"
app:layout_widthPercent="78%"/>
</android.support.percent.PercentRelativeLayout>
3、热卖类型布局横向滚动采用HorizontalScrollView
<HorizontalScrollView
android:scrollbars="none"
android:id="@+id/hsl_hot_right"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/ll_hot_right"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"/>
</HorizontalScrollView>
4、整体数据展示采用仿京东的分类页面
左侧分类商品采用listview,右侧商品展示采用分类型recyclerview显示商品。
相关文章推荐
- 尚硅谷Android项目之_硅谷商城项目全套源码解析(五、发现)
- 尚硅谷Android项目之_硅谷商城项目全套源码解析(七、购物车)
- 尚硅谷Android项目之_硅谷商城项目全套源码解析(二、主框架搭建)
- 尚硅谷Android项目之_硅谷商城项目全套源码解析(三、首页)
- 尚硅谷Android项目之_硅谷商城项目全套源码解析(一、综述)
- 尚硅谷Android项目之_硅谷商城项目全套源码解析(六、个人中心)
- 关于 Android 开源项目汇总、学习、源码解析
- Android 开源项目源码解析 -->公共技术点之 View 事件传递(一)
- Android 开源项目源码解析之DynamicLoadApk 源码解析
- Android 开源项目源码解析 -->Android Lock Pattern 源码解析(六)
- 开源项目源码解析-Android Lock Pattern 源码解析
- Android 开源项目源码解析(第二期)
- 【Android学习】JSON与XML综合六种解析方式-综合案例(web项目源码+android源码+jar包)
- Android 开源项目源码解析 -->公共技术点之 View 绘制流程(三)
- Android 开源项目源码解析 -->PhotoView 源码解析(七)
- android项目源码解析04:新浪微博客户端源码解析
- 汇聚各种android开源项目源码分类总汇-IT蓝豹
- 开源项目源码解析-Android Universal Image Loader 源码分析
- Android 开源项目源码解析 中 android-Ultra-Pull-To-Refresh 部分
- Android 开源项目源码解析 -->公共技术点之 Java 动态代理(五)