Code Monkey home page Code Monkey logo

slidelistview's Introduction

SlideListView

完全仿QQ列表滑动。优化各种细节。支持点击事件、添加删除动画 目前点击事件仅支持item的整体点击,不支持item里面的子VIew的点击事件。

用法: 在Adapter的getView(final int position, View convertView, ViewGroup parent)的方法中如下代码

    Holder holder = null;
    if (convertView == null) {
        Log.i("ListAdapter", "convertView == null");
        //这里要将SlideView作为listView的子Item
        convertView = new SlideView(mContext);
        View view = LayoutInflater.from(mContext).inflate(R.layout.list_item, null);
        ((SlideView)convertView).setContentView(view);
        holder = new Holder();
        holder.contentTv = (TextView) view.findViewById(R.id.contentTv);
        holder.testButtonTv = (TextView) view.findViewById(R.id.testButtonTv);
        convertView.setTag(holder);

        //这里根据自己的需要,添加view
        TextView deleteTv = (TextView) View.inflate(mContext, R.layout.slide_bottom_item1, null);
        TextView buttonTv = (TextView) View.inflate(mContext,R.layout.slide_bottom_item2,null);
        ((SlideView)convertView).setBottomView(deleteTv, buttonTv);

        holder.deleteTv = deleteTv;
        holder.buttonTv = buttonTv;
    } else {
        holder = (Holder) convertView.getTag();
        Log.i("ListAdapter", "convertView != null");
    }

slidelistview's People

Contributors

haidaodashushu avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.