不废话,需求:做一个订单模块类APP的物流详情页,怎么办?
这个功能完全是看到别人写的好,自己学习一下,主要写一下自己对别人代码的理解。参考文章:https://blog.csdn.net/weixin_34291004/article/details/87119827
app下的buidle添加:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:support-v4:27.1.1'
//封装了RecyclerView自带的Adapter
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.40'
}
项目buidle添加:
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
主界面:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F0F0F0"
android:orientation="vertical">
<include layout="@layout/include_title" />
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff">
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center_vertical"
android:scaleType="fitXY"
android:src="@mipmap/img" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingBottom="17dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="17dp">
<LinearLayout