I have Imageview in center of screen.
I want to swipe Imageview left and right of the screen.How can i implement this?
I have Imageview in center of screen.
I want to swipe Imageview left and right of the screen.How can i implement this?
Have a look at https://github.com/nadavfima/GlowPadView .
It has open source implementation of glowpadview.
you can use it as a reference and change icons as per your need. It should create that swipable view.
I was also looking for some very simple solution to this. I just needed left/right swipe. I found many solutions which were overly complicated. So I reduced what I found as much as I can and came up with something really simple (the swipe will work on a div with ID mainarea in this example, swipes are detected for minimum 100px to either side):
var swipe={
startx:0,touch:function(event) {
if (typeof event.touches!=='undefined') {
switch (event.type) {
case 'touchstart':swipe.startx=event.touches[0].pageX;
case 'touchend':
if(Math.abs(swipe.startx-event.changedTouches[0].pageX)>100)
swipe.startx<event.changedTouches[0].pageX?window.location.href=swipe.prev:window.location.href=swipe.next
}
}
},init:function(prev,next){
swipe.prev=prev;
swipe.next=next;
document.getElementById("mainarea").addEventListener('touchstart',swipe.touch,false);
document.getElementById("mainarea").addEventListener('touchend',swipe.touch,false);
}
}
swipe.init(<previous page>,<next page>);