百分比布局
新增两条包依赖:
implementation 'com.android.support:appcompat-v7:29.0.0'
implementation 'com.android.support:percent:29.0.0'
布局定义使用androidx:
<androidx.percentlayout.widget.PercentFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.percentlayout.widget.PercentFrameLayout>
RecyclerView
新增一条包依赖:
implementation 'com.android.support:recyclerview-v7:29.0.0'
布局定义:
<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"
>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>