本項目來自菜鳥窩,有興趣者點擊http://www.cniao5.com/course/
項目已經(jīng)做完,
https://github.com/15829238397/CN5E-shop
仿京東商城系列0------項目簡介
仿京東商城系列1------fragmentTabHost實現(xiàn)底部導(dǎo)航欄
仿京東商城系列2------自定義toolbar
仿京東商城系列3------封裝Okhttp
仿京東商城系列4------輪播廣告條
仿京東商城系列5------商品推薦欄
仿京東商城系列6------下拉刷新上拉加載的商品列表
仿京東商城系列7------商品分類頁面
仿京東商城系列8------自定義的數(shù)量控制器
仿京東商城系列9------購物車數(shù)據(jù)存儲器實現(xiàn)
仿京東商城系列10------添加購物車,管理購物車功能實現(xiàn)
仿京東商城系列11------商品排序功能以及布局切換實現(xiàn)(Tablayout)
仿京東商城系列12------商品詳細信息展示(nativie與html交互)
仿京東商城系列13------商品分享(shareSDK)
仿京東商城系列14------用戶登錄以及app登錄攔截
仿京東長城系列15------用戶注冊,SMSSDK集成
仿京東商城系列16------支付SDK集成
仿京東商城系列17------支付功能實現(xiàn)
仿京東商城系列18------xml文件讀取(地址選擇器)
仿京東商城系列19------九宮格訂單展示
仿京東商城系列20------終章
前言
本文我們將一起實現(xiàn)一個仿京東商品分類頁面。廢話不說,上圖:
內(nèi)容
商品分類展示頁面涉及到的技術(shù)有Okhttp , Fresco加載機制,MaterialRefreshLayout + recyclerview下拉加載控件。關(guān)于上述控件的說明在之前就已經(jīng)有所說明。在此不做介紹。
關(guān)于頁面的布局如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.example.cne_shop.widget.CnToolbar
android:id="@+id/toolBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:minWidth="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:title="@string/tab_assort"
android:titleTextColor="@color/white"
app:isShowSearchView="false"
></com.example.cne_shop.widget.CnToolbar>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v7.widget.RecyclerView
android:layout_width="@dimen/classify_layout_width"
android:layout_height="match_parent"
android:id="@+id/ass_first_recyclerview"
android:background="@color/white">
</android.support.v7.widget.RecyclerView>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.daimajia.slider.library.SliderLayout
android:layout_width="match_parent"
android:layout_height="@dimen/classify_Slider_height"
android:id="@+id/slidLayout">
</com.daimajia.slider.library.SliderLayout>
<com.cjj.MaterialRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/materialRefreshLayout">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/ass_show_recyclerview">
</android.support.v7.widget.RecyclerView>
</com.cjj.MaterialRefreshLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
布局使用了一個slider輪播,控件,兩個ReciclerView控件,其中一個被MaterialRefreshLayout包裹,具有上拉加載功能。
功能的具體實現(xiàn)在此不做說明,有興趣者請看文章開頭源碼。