Skip to content

解决SwipeMenuListView使用自定义adapter时 侧滑菜单与实际效果不对应的 bug,添加下拉刷新,上拉加载更多的通用布局,封装简单实用的CommonAdapter

Notifications You must be signed in to change notification settings

congxc/SwipeMenuListView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

#1.使用 CommonAdapter+ViewHolder:

   mCommonAdapter = new CommonAdapter<String>(this,mDatas,R.layout.item_view) {
       @Override
       public void convert(ViewHolder holder, String s) {
            holder.setText(R.id.tv,holder.getPosition()+"----"+s)
                  .setBackgroundRes(R.id.tv,R.drawable.icon_arrow)
                  .setOnClickListener(R.id.tv, new View.OnClickListener() {
                       @Override
                       public void onClick(View v) {

                       }
             });
        }
   };
            mSwipeMenuListView.setAdapter(mCommonAdapter);

#2.PullToRefreshLayout 万能的上拉加载更多 下拉刷新控件 让你的ListView implements Pullable ,
可以方便的通过setPullUpEnable(boolean)或者setPullDownEnable(boolean)控制是否可以上拉或下拉

  <com.rainnshieh.views.PullToRefreshLayout
          android:id="@+id/refreshlayout"
          android:layout_width="match_parent"
          android:layout_height="match_parent">
          <com.rainnshieh.views.SwipeMenuListView
              android:id="@+id/swipemenuListView"
              android:layout_width="match_parent"
              android:layout_height="match_parent"/>
      </com.rainnshieh.views.PullToRefreshLayout>

#3.解决baoyz的SwipeMenuListView控件使用CommonAdapter时滑出控件类型不一致的bug

About

解决SwipeMenuListView使用自定义adapter时 侧滑菜单与实际效果不对应的 bug,添加下拉刷新,上拉加载更多的通用布局,封装简单实用的CommonAdapter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages