// Path: AndroidSwipeLayoutDemo/myswipedemo/src/main/java/bryan/com/myswipedemo/adapter/ListViewAdapter.java
// public class ListViewAdapter extends BaseSwipeAdapter {
// 
// 
//     private Context context;
// 
//    public ListViewAdapter(Context context){
//        this.context=context;
//    }
// 
//     @Override
//     public int getSwipeLayoutResourceId(int position) {
//         //返回swipelayout的资源id
//         return R.id.swipelayout;
//     }
// 
//     @Override
//     public View generateView(int position, ViewGroup parent) {
//         return View.inflate(context,R.layout.listview_item,null);
//     }
// 
//     @Override
//     public void fillValues(final int position, View convertView) {
//         TextView textView= (TextView) convertView.findViewById(R.id.content);
//         textView.setText("这是内容" + position);
// 
//         final SwipeLayout swipeLayout= (SwipeLayout) convertView.findViewById(R.id.swipelayout);
//          swipeLayout.setDrag(SwipeLayout.DragEdge.Right,R.id.delete);
//         convertView.findViewById(R.id.delete).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 Toast.makeText(context, "delete clicked", Toast.LENGTH_SHORT).show();
//             }
//         });
//         swipeLayout.getSurfaceView().setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 if(swipeLayout.getOpenStatus()==SwipeLayout.Status.Close){
//                     Toast.makeText(context, position+"clicked", Toast.LENGTH_SHORT).show();
//                 }else{
//                     swipeLayout.close(true);
//                 }
// 
//             }
//         });
// 
// 
// 
// 
//     }
// 
//     @Override
//     public int getCount() {
//         return 50;
//     }
// 
//     @Override
//     public Object getItem(int position) {
//         return null;
//     }
// 
//     @Override
//     public long getItemId(int position) {
//         return position;
//     }
// }


import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import com.daimajia.swipe.util.Attributes;
import bryan.com.myswipedemo.adapter.ListViewAdapter;
package bryan.com.myswipedemo;




/**
 * Created by Administrator on 2015/8/3.
 */
public class ListViewExample extends Activity {


    ListView listView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listview_demo);

        listView= (ListView) findViewById(R.id.listview);

// Path: AndroidSwipeLayoutDemo/myswipedemo/src/main/java/bryan/com/myswipedemo/adapter/ListViewAdapter.java
// public class ListViewAdapter extends BaseSwipeAdapter {
// 
// 
//     private Context context;
// 
//    public ListViewAdapter(Context context){
//        this.context=context;
//    }
// 
//     @Override
//     public int getSwipeLayoutResourceId(int position) {
//         //返回swipelayout的资源id
//         return R.id.swipelayout;
//     }
// 
//     @Override
//     public View generateView(int position, ViewGroup parent) {
//         return View.inflate(context,R.layout.listview_item,null);
//     }
// 
//     @Override
//     public void fillValues(final int position, View convertView) {
//         TextView textView= (TextView) convertView.findViewById(R.id.content);
//         textView.setText("这是内容" + position);
// 
//         final SwipeLayout swipeLayout= (SwipeLayout) convertView.findViewById(R.id.swipelayout);
//          swipeLayout.setDrag(SwipeLayout.DragEdge.Right,R.id.delete);
//         convertView.findViewById(R.id.delete).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 Toast.makeText(context, "delete clicked", Toast.LENGTH_SHORT).show();
//             }
//         });
//         swipeLayout.getSurfaceView().setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 if(swipeLayout.getOpenStatus()==SwipeLayout.Status.Close){
//                     Toast.makeText(context, position+"clicked", Toast.LENGTH_SHORT).show();
//                 }else{
//                     swipeLayout.close(true);
//                 }
// 
//             }
//         });
// 
// 
// 
// 
//     }
// 
//     @Override
//     public int getCount() {
//         return 50;
//     }
// 
//     @Override
//     public Object getItem(int position) {
//         return null;
//     }
// 
//     @Override
//     public long getItemId(int position) {
//         return position;
//     }
// }


// Path: AndroidSwipeLayoutDemo/myswipedemo/src/main/java/bryan/com/myswipedemo/ListViewExample.java
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import com.daimajia.swipe.util.Attributes;
import bryan.com.myswipedemo.adapter.ListViewAdapter;

package bryan.com.myswipedemo;




/**
 * Created by Administrator on 2015/8/3.
 */
public class ListViewExample extends Activity {


    ListView listView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listview_demo);

        listView= (ListView) findViewById(R.id.listview);

        ListViewAdapter adapter=new ListViewAdapter(this);