京东分类点击跳转后的列表页面以及列表跳转后的详情页面

本文介绍了京东应用中分类点击后展示的列表页面布局设计,包括列表适配器的rvlist_item.xml布局文件。接着详细讲解了从列表跳转到详情页面的activity_list_details.xml布局,并讨论了详情页面的Contract和Presenter实现,适合前端开发者参考。
摘要由CSDN通过智能技术生成

首先咱先写写布局文件啊

<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"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="#ff3660"
        android:gravity="center_vertical"
        android:orientation="horizontal">


        <ImageView
            android:id="@+id/ivZxing"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_marginLeft="15dp"
            android:background="@drawable/a_s"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"
            android:layout_weight="1"
            android:background="@drawable/shape_search"></LinearLayout>

        <ImageView
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_alignParentRight="true"
            android:layout_marginRight="15dp"
            android:background="@drawable/my_msg_bai"/>
    </LinearLayout>

    <com.jcodecraeer.xrecyclerview.XRecyclerView
        android:id="@+id/xrv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"></com.jcodecraeer.xrecyclerview.XRecyclerView>
</LinearLayout>

这个是列表适配器的布局rvlist_item.xml


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/ll"
              android:layout_width="match_parent"
              android:layout_height="100dp"
              android:orientation="horizontal">

    <com.facebook.drawee.view.SimpleDraweeView
        android:id="@+id/iv"
        android:layout_width="70dp"
        android:layout_height="70dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:orientation="vertical">

        <TextView
            android:id="@+id/tvTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        <TextView
            android:id="@+id/tvPrice"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:textColor="#ff0000"/>
    </LinearLayout>
</LinearLayout>
下面写contract

ListContract

public interface ListContract {
    interface View extends BaseContract.BaseView {
        void onSuccess(List<ProductsBean.DataBean> list);
    }

    interface Presenter extends BaseContract.BasePresenter<View> {
        void getProducts(String pscid);
    }
}
写presenter
ListPresenter

public class ListPresenter extends BasePresenter<ListContract.View> implements ListContract.Presenter {
    private ListApi listApi;

    @Inject
    public ListPresenter(ListAp
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值