仿京东首页需要的布局

轮播的依赖
implementation ‘com.github.donkingliang:CustomBanner:1.1.3’

一、推荐类的布局——R.layout.one_item1
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android

android:layout_width="match_parent"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_height="wrap_content"
android:gravity="center|top">

<com.facebook.drawee.view.SimpleDraweeView
    fresco:placeholderImage="@mipmap/ic_launcher"
    android:id="@+id/item_sdv"
    android:layout_width="270dp"
    android:layout_height="180dp" />
<TextView
    android:id="@+id/item_title"
    android:text="ssss"
    android:layout_width="220dp"
    android:layout_height="wrap_content"
    android:maxLines="4"
    />
<TextView
    android:layout_gravity="center"
    android:gravity="bottom"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/item_price"
    android:text="sdfsdf"
    />

二、轮播图的布局——R.layout.banner_item
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android

android:layout_width="match_parent"
android:layout_height="wrap_content">

<com.donkingliang.banner.CustomBanner
    android:id="@+id/banner"
    android:layout_width="match_parent"
    android:layout_height="250dp"/>

三、九宫格布局
1.R.layout.fenlei_layout
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android

android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<android.support.v7.widget.RecyclerView
    android:id="@+id/felei_layout_view"
    android:layout_height="match_parent"
    android:layout_width="match_parent"/>
2.**R.layout.fenlei_item**——适配器里的

<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android

android:padding="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:fresco="http://schemas.android.com/apk/res-auto">

<com.facebook.drawee.view.SimpleDraweeView
    android:id="@+id/fenlei_item_sdv" android:layout_height="35dp"
    android:layout_width="35dp"
   fresco:placeholderImage="@mipmap/ic_launcher"
    />
<TextView
    android:layout_gravity="center"
    android:text="ssssss"
    android:id="@+id/fenlei_item_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

四、秒杀——R.layout.time_layout

<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android

android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
    android:textSize="28dp"
    android:textColor="@android:color/black"
    android:text="秒杀:"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
<TextView
    android:textSize="20dp"
    android:textColor="#f00"
    android:text="hh:mm:ss"
    android:id="@+id/time_item"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

五、为你推荐标题——R.layout.text_layout
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android

android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
    android:textColor="#c6a"
    android:gravity="center"
    android:textSize="25dp"
    android:text="为你推荐"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

猜你喜欢

转载自blog.csdn.net/qq_42993958/article/details/82831387