Android-SmartRefreshLayout修改ClassicsHeader文字

1、创建类继承 ClassicsHeader

class RefreshHeader: ClassicsHeader {

    constructor(context: Context) : super(context)  {

        mTextFinish = "已加载完毕"

    }


    constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)

}

2、替换xml中的类

 <com.scwang.smart.refresh.layout.SmartRefreshLayout
        android:id="@+id/smartRefreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.xxx.xxx.ui.refresh.RefreshHeader
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <com.xxx.xxx.ui.refresh.RefreshFooter
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </com.scwang.smart.refresh.layout.SmartRefreshLayout>

3、替换

smartRefreshLayout?.setRefreshHeader(RefreshHeader(context))

底部刷新同理

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容