实现搜索页面到商品列表

//activity_main

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.bwie.test.moni.MainActivity">

    <LinearLayout
        android:background="#eceaea"
        android:gravity="center"
        android:layout_marginTop="20dp"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <ImageView
            android:background="@drawable/zuo"
            android:layout_width="30dp"
            android:layout_height="30dp" />
        <EditText
            android:layout_marginLeft="40dp"
            android:layout_marginRight="40dp"
            android:background="@drawable/sou"
            android:id="@+id/et"
            android:layout_width="360dp"
            android:singleLine="true"
            android:hint="落来京东超级商品日"
            android:layout_height="40dp" />
        <Button
            android:id="@+id/sousuo"
            android:background="#eceaea"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="搜索" />
    </LinearLayout>

    <TextView
        android:padding="10dp"
        android:textSize="25dp"
        android:text="热搜"
        android:textStyle="bold"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" /> 
    <com.bwie.test.utils.flow
        android:id="@+id/ffff"
android:layout_width="match_parent" android:layout_height="100dp"/> <TextView android:padding="10dp" android:textSize="25dp" android:text="搜索历史" android:textStyle="bold" android:id="@+id/lishi" android:visibility="invisible" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <ListView android:id="@+id/lv" android:layout_width="match_parent" android:layout_height="wrap_content"></ListView> <Button android:id="@+id/qingkong" android:visibility="invisible" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="清空历史记录" /></LinearLayout>



//activity_neirong

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="match_parent"
    tools:context="com.bwie.test.moni.NeirongActivity">
    <LinearLayout
        android:orientation="horizontal"
        android:background="#e7e4e4"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <ImageView
            android:id="@+id/fan"
            android:layout_marginRight="170dp"
            android:background="@drawable/zuo"
            android:layout_width="45dp"
            android:layout_height="45dp" />

        <TextView
            android:text="商品详情"
            android:textSize="30dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <CheckBox
            android:layout_marginLeft="140dp"
            android:button="@null"
            android:id="@+id/grid"
            android:background="@drawable/dian"
            android:layout_width="35dp"
            android:layout_height="35dp" />

    </LinearLayout>

    <android.support.v7.widget.RecyclerView

        android:id="@+id/res"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>
</LinearLayout>


//activity_xiangqing

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns: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="com.bwie.test.moni.XiangqingActivity">
    <LinearLayout
        android:id="@+id/lin"
        android:layout_alignParentTop="true"
        android:background="#dbd9d9"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <ImageView
            android:id="@+id/zuo"
            android:background="@drawable/zuo"
            android:layout_width="30dp"
            android:layout_height="30dp" />
        <TextView
            android:gravity="center"
            android:text="商品详情"
            android:textSize="20dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>
   <com.stx.xhb.xbanner.XBanner
       android:layout_below="@+id/lin"
       android:id="@+id/xb"
       android:layout_width="match_parent"
       android:layout_height="300dp"></com.stx.xhb.xbanner.XBanner>
    <TextView
        android:layout_below="@+id/xb"
        android:id="@+id/tel"
        android:maxLines="2"
        android:minLines="2"
        android:textSize="18dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <TextView
        android:layout_below="@+id/tel"
        android:id="@+id/head"
        android:layout_marginTop="20dp"
        android:maxLines="2"
        android:minLines="2"
        android:textSize="18dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <TextView
        android:layout_marginTop="15dp"
        android:layout_below="@+id/head"
        android:id="@+id/yuanprice"

        android:textSize="18dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <TextView
        android:layout_marginTop="15dp"
        android:layout_below="@+id/yuanprice"
        android:id="@+id/price"
        android:textColor="#f00"
        android:textSize="18dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <Button
        android:layout_alignParentBottom="true"
        android:id="@+id/tianjia"
        android:text="添加购物车"
        android:textSize="25dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</RelativeLayout>



//gridbuju.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/img"
        android:layout_gravity="center"
        android:layout_width="130dp"
        android:layout_height="130dp" />

        <TextView
            android:id="@+id/name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
        <TextView
            android:layout_marginTop="5dp"
            android:id="@+id/price"
            android:textColor="#f00"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

</LinearLayout>


//linbuju.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:orientation="horizontal"
    android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/img"
        android:layout_width="100dp"
        android:layout_height="100dp" />
    <LinearLayout
        android:layout_marginTop="10dp"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:id="@+id/name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
        <TextView
            android:layout_marginTop="5dp"
            android:id="@+id/price"
            android:textColor="#f00"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>
</LinearLayout>



//drawable文件夹下_dian.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true" android:drawable="@drawable/kind_liner"></item>
    <item android:state_checked="false" android:drawable="@drawable/kind_grid"></item>
</selector>


//sou.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    corners android:radius="30dp" />
    <solid android:color="#fff"/>
</shape>


//textview_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#666666"/>  
        <corners android:radius="10dp"/>  
    <padding
    android:left="5dp"
    android:right="5dp"
    android:top="5dp"
    android:bottom="5dp"/> 
</shape>


//需要添加的依赖

compile files('libs/gson-2.6.2.jar')
compile files('libs/universal-image-loader-1.9.5.jar')
compile 'com.xhb:xbanner:1.0.0'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.squareup.okio:okio:1.11.0'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support.test:runner:0.5'
compile 'com.android.support.test.espresso:espresso-core:2.2.2'


//需要添加的权限

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


<application
    android:name="com.bwie.test.utils.Inagoath"


    <activity android:name=".NeirongActivity"/>
    <activity android:name=".XiangqingActivity"/>
</application>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值