Watch 1 Star 0 Fork 0

刘近冲 / AndroidBaseApache-2.0

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
Android开发基础库,涵盖Activity、Fragment基类,通用下拉刷新界面、同意ViewHolder、Adapter、MD5,日志打印,Toast等 spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

#AndroidBase Android快速开发基础库,涵盖Activity、Fragment基类,通用下拉刷新、加载更多界面、同意ViewHolder、Adapter、MD5,日志打印,Toast等

###AndroidStudio使用

compile 'com.haibin:androidbase:1.0.1'

###下拉刷新界面

public class MainActivity extends BaseRecyclerViewActivity<String> {


    @Override
    public void onItemClick(int position, long itemId) {
        
    }

    @Override
    protected BaseRecyclerAdapter<String> getAdapter() {
        return new StringAdapter(this, BaseRecyclerAdapter.ONLY_FOOTER);
    }
    @Override
    public void onRefreshing() {
        //下拉刷新
    }

    @Override
    public void onLoadMore() {
        //加载更多
    }
}

###RecyclerAdapter

public class StringAdapter extends BaseRecyclerAdapter<String> {
    public StringAdapter(Context context, int mode) {
        super(context, mode);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.item_list_string;
    }

    @Override
    protected void onBindDefaultViewHolder(ViewHolder holder, String item, int position) {
        holder.bindText(R.id.title, item);
        holder.setImageResource(R.id.image, R.mipmap.ic_launcher);
    }
}

Comments ( 0 )

Sign in for post a comment

1
https://gitee.com/LiuJinChong/AndroidBase.git
git@gitee.com:LiuJinChong/AndroidBase.git
LiuJinChong
AndroidBase
AndroidBase
master

Help Search