仿京东分类+MVP

该博客介绍了如何在Android项目中实现仿京东分类的功能,并结合MVP架构进行详细讲解。涉及依赖设置、权限配置、布局设计以及各个层的实现,包括主布局、分类XML、右侧条目、商家信息、契约类、P层、M层和Activity界面的适配器等。
摘要由CSDN通过智能技术生成

首先用到的依赖有

	 //okgo
    implementation 'com.lzy.net:okgo:3.0.4'
    implementation 'org.kie.modules:com-google-code-gson:6.5.0.Final'
    //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'
    ///glide图片加载框架
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
     //recyclerview依赖
    implementation 'com.android.support:recyclerview-v7:28.0.0'

brvah使用需要在最外的gradle里面写入

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

清单文件下的网络权限

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

下面开始写布局

主布局

<android.support.v7.widget.RecyclerView
        android:id="@+id/fl_recyle"
        android:layout_width="0dp"
        android:layout_weight="3"
        android:layout_height="wrap_content">
    </android.support.v7.widget.RecyclerView>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/xq_recyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="7"
        >
    </android.support.v7.widget.RecyclerView>

分类的xml

 <TextView
        android:id="@+id/recy_text"
        android:layout_margin="5dp"
        android:textSize="18sp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textStyle="bold"
        />
</
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值