Back to project page AndroidSwipeLayout.
The source code is released under:
MIT License
If you think the Android project AndroidSwipeLayout listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.daimajia.swipedemo; /*from ww w . j a v a 2 s. c o m*/ import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.GridView; import com.daimajia.swipe.implments.SwipeItemMangerImpl; import com.daimajia.swipedemo.adapter.GridViewAdapter; public class GridViewExample extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gridview); final GridView gridView = (GridView)findViewById(R.id.gridview); final GridViewAdapter adapter = new GridViewAdapter(this); adapter.setMode(SwipeItemMangerImpl.Mode.Multiple); gridView.setAdapter(adapter); gridView.setSelected(false); gridView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { Log.e("onItemLongClick","onItemLongClick:" + position); return false; } }); gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Log.e("onItemClick","onItemClick:" + position); } }); gridView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Log.e("onItemSelected","onItemSelected:" + position); } @Override public void onNothingSelected(AdapterView<?> parent) { } }); } }