Swipe and moving page conflicting events - android

In my web application there is an image gallery that uses swipe events to navigate to the next or previous pictures.
If a user zooms in to a particular image and tries to swipe to go to the next or previous picture, the whole page moves in addition to the swipe event being triggered, which creates a bad user experience. Note, this is a non issue, as long as the user is zoomed out all the way, however, I wouldn't want to limit the user in that way.
I was wondering if someone ever experienced this problem and has any suggestion as to how to troubleshoot this?
Swipe Event
$('.slideshowFrame').swipeleft(function () {
galleryIndex = ++galleryIndex%gallery.itemCount; //update index
$('.gallery-img-container').attr("src", gallery.item[galleryIndex].image);
});
I appreciate any suggestion, many thanks in advance!

Related

How can I implement a user "swipe up to reveal" on android

I want to implement a lock screen where the user has to swipe up an image to reveal the app lock screen. I know how to animate views, but how do I animate them based on user input? (i.e. not just swipe up, user should be able to pull the image along)
I really don't know the term for this action so I've been stumped trying to search for it. I tried searching google in many ways but no results
You can use GestureDetector to detect user's gesture and then you need to animation views.Use below links for ref
https://github.com/pwittchen/swipe
https://github.com/championswimmer/SimpleFingerGestures_Android_Library
https://stackoverflow.com/a/12938787/1481962

Android Studio return to previous page and same spot on scroll bar?

I am working on a android app and when I hit the back button or save I got it to take me to the previous page but it takes me all the way to the top and I have to scroll all the way to bottom each time I save. I have looked all over the internet and youtube but all I find is stuff on web page when you click back. Can anyone point me in the right direction here what I need to look up or some code to get me going. Thanks
If you are using ScrollView you simply need to save its current position using scroller.getScrollY() right before switching to any different screen. Then, on onResume() call scroller.smoothScrollTo(0, savedValue) to get back to previous position. savedValue would of course be 0 initially. If you don't want smooth scrolling, you can call scroller.scrollTo(0, savedValue).

How to draw and recognize gesture using gesture overlay view

I do not know Why I am getting error and getting my app crash saying index out of bound. I have made three different question but none of them help. So here I am saving my basic idea.
I think there is no need to share the code, All I want to draw the gesture on the gestureOverlayView are the points given below
if the gesture is the right gesture Say Letter A then it should stay visible if not then it should disappear as it does every time.
If the user has made the right gesture then the gesture should not be disappear , but there is a reset button , when the user made the correct gesture and let say it is not disappear then when user click on the Reset Button then the gestureOverlayView Should be removed
So Please kindly guide me how can I made gesture permanent after when it is the gesture we wanted user to made and then if it is our desired gesture and successfully made it permanent then how to reset it on the reset button
Please guide me and help me

Drag and Drop Items from Listview into Activity

In my app, I want the user to be able to follow this list of instructions to be able to put a link to their installed android apps into a widget that I am creating.
In the widget, when the user taps the widget it opens up a new activity which contains all of their apps. To add new app links to that activity, I want the user to be able to pull out a kind of scrolling tab that would hold a list of all of their applications they have on their device (I already know how to do this). The user would then be able to press and hold on a app from that listview and then drag it into the droppable area in the widget that would hold their app. Please note the picture below to get a better idea of what I mean (sorry for poor quality):
How could I turn a listview object into something that is able to do this? I would have to make the listview have a touch listener attribute and then make the droppable area have a drag event, that much I am sure of (somewhat from just looking around on how to make things drag and droppable).
How could I do this? Any ideas or comments on improvements are appreciated!
You could use setOnItemLongClickListener to set a listener waiting for a long click then when it is fired begin the drag process.

Navigate dynamic content horizontaly (ListViews)

sorry for the confusing title. I will try to explain my problem.
My app displays some content day-wise in a ListView. The user is able to switch days back and forth (e.g. by swiping his finger to the left/right). Now I want to implement some nice transition effect (like the new Android market has).
The problem is, that the content is generated dynamically and it can take a while to load. Also you can move (theoretically) infinite days to to past or to the future.
How can I implement a nice looking transition that is responsive and also tells the user, that some work is done in the background.
Just to clarify, I'm not asking how a ListView or an AsyncTask works, but rather for design concepts for my idea.
Thanks in advance.
If I understand correctly what you mean, I think you should try and preload in background the previous and following page, and keep them in memory ready to come in with the swipe.
Every time you change day you would recycle one page of data to load a new one (in one direction or another).
Obviously the user can still swipe too fast and you won't have time to preload things, but in that case I don't think you can do anything better than transitioning in the page with a nice spinner in it (not a blocking dialog).

Categories

Resources