购物车基础展示数据(MVP+Brvah+OKgo)

首先是MVP逻辑架构,此处省略
导入下列我们需要的依赖

//MetrialDesign:Design库
    implementation 'com.android.support:design:28.+'
    //Butterknife:根据反射注入框架
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    //Brvah:RecyclerView快速开发框架
    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
    //SmartRefreshLayout
    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-19'
    implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-alpha-19'
    //没有使用特殊Header,可以不加这行
    //okgo
    //必须使用
    implementation 'com.lzy.net:okgo:3.0.4'
    implementation 'com.google.code.gson:gson:2.8.5'
    //图片加载框架
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'

导入Brvah需要在Gradle下你自己得到包下添加以下代码

maven { url "https://jitpack.io" }

购物车主要的布局分为三部分:
1.activity_main

<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=".ui.activity.MainActivity">

   <android.support.v7.widget.Toolbar
       android:background="@color/colorAccent"
       android:fitsSystemWindows="true"
       app:title="@string/toolbar_name"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"/>
    <com.scwang.smartrefresh.layout.SmartRefreshLayout
        android:id="@+id/srl_container"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_business"
            android:layout_width="match_parent"
        
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值