android


How can I set three icon vertically to SwipeMenuItem in SwipeMenuListView


How can I add customize SwipeMenuListView.
I want to put three icons vertically in Menu when user swipe any item from list view it will display three icons.
Can any one help me for same.
Thanks in advance.
Like this Image
You can use this class to swipe any item...
public class SwipeDetector implements View.OnTouchListener {
private static final int MIN_DISTANCE = 300;
private static final int MIN_LOCK_DISTANCE = 30; // disallow motion intercept
private boolean motionInterceptDisallowed = false;
private float downX, upX;
private AudioObjectHolder holder;
private int position;
public SwipeDetector(AudioObjectHolder h, int pos) {
holder = h;
position = pos;
}
#Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
downX = event.getX();
return true; // allow other events like Click to be processed
}
case MotionEvent.ACTION_MOVE: {
upX = event.getX();
float deltaX = downX - upX;
if (Math.abs(deltaX) > MIN_LOCK_DISTANCE && listView != null && !motionInterceptDisallowed) {
listView.requestDisallowInterceptTouchEvent(true);
motionInterceptDisallowed = true;
}
if (deltaX > 0) {
holder.deleteView.setVisibility(View.GONE);
} else {
// if first swiped left and then swiped right
holder.deleteView.setVisibility(View.VISIBLE);
}
swipe(-(int) deltaX);
return true;
}
case MotionEvent.ACTION_UP:
upX = event.getX();
float deltaX = upX - downX;
if (Math.abs(deltaX) > MIN_DISTANCE) {
// left or right
swipeRemove();
} else {
swipe(0);
}
if (listView != null) {
listView.requestDisallowInterceptTouchEvent(false);
motionInterceptDisallowed = false;
}
holder.deleteView.setVisibility(View.VISIBLE);
return true;
case MotionEvent.ACTION_CANCEL:
holder.deleteView.setVisibility(View.VISIBLE);
return false;
}
return true;
}
private void swipe(int distance) {
View animationView = holder.mainView;
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) animationView.getLayoutParams();
params.rightMargin = -distance;
params.leftMargin = distance;
animationView.setLayoutParams(params);
}
private void swipeRemove() {
remove(getItem(position));
notifyDataSetChanged();
}
}
}

Related Links

onCancelled() seems differnet in Ice Cream Sandwich
Android 4.0 4G toggle
How to exclude certain numbers from autolinking within Android TextView
Send intent for screen on from shell
How to print toast every 10 seconds in Java?
Write Pixels to a Texture via OpenGL ES Android
App using libgdx restarts whenever device rotates
Google I/O 2010 - The world of ListView notifyDataSetChanged()
InflateException
Scala on Android using Netbeans (preferably 6.8)
build Custom Share panel of buttons , android
Problem in ContactsContract API android
Android monkeyrunner test calls onClick handler twice
how to display SQLite DataBase table?
Android fill_parent to match_parent
Android: how to get the name of apk file programmatically?

Categories

HOME
redux-form
google-spreadsheet
requirements
rendering
seo
tail
pyqt4
gson
alamofire
emoji
favicon
dynatrace
enterprise-architect
coin3d
asp.net-mvc-viewmodel
wolframalpha
git-extensions
sse
simpleitk
asciidoctor-pdf
babel
dataflow-diagram
roslyn
tosca
dynamically-generated
expressionengine3
angular-translate
alm
calculation
cart
fstream
mailkit
xajax
sql-server-ce
playframework-2.1
google-earth-engine
cin
c9.io
laravel-elixir
parser-generator
double-click
globalize
x-ray
trojan
quicktime
jquery-jscrollpane
scaffolding
cifilter
freepbx
nservicebus5
phpwebsocket
cycle2
piracy-prevention
libvlc
oracle-spatial
roadkill-wiki
canalyzer
iced-coffeescript
eoferror
ocra
apache-commons-daemon
botan
cwrsync
canvg
umlgraph
cross-join
jbake
crowd
spy++
koala
notorm
inputmismatchexception
nebula
actiondispatch
mysql-error-2013
jquery-blockui
subgraph
httponly
workflow-services
matlab-load
django-paypal
timertask
message-passing
scrollbars
skype4java
silverlight-oob
wcf-proxy

Resources

Encrypt Message