I'm trying to simulate scrolling by GESTURE_SWIPE event but the only useful data in this event is offsetY,offsetX but the handler function dosent receives any data about how fast the user swipes or how far or any other data to calculate it .
the page contain several movie clips that should be able to scroll smoothly.
how can I do this?
Greensock has a plugin called ThrowProps which provides the same behaviour as your would get in a native menu.
https://greensock.com/throwprops-as
Related
I create a android app for Auto clicker, that can be used to click the XY position of the window,The click event is done during some interval, Similar that i can implement the scrolling event.I have attached the reference link is -https://play.google.com/store/apps/details?id=com.tafayor.autoscroll2&hl=en, I dont have idea of this.Give me some suggestion for auto Scrolling.
I need to create page controller in android.
For that i have followed 1 very simple example THIS IS LINK I HAVE USED
All thing is working good i need only i need to swip pages automatically without touch events....
How to make it possible?
You need to implement on swipe logic in to Timer, and based on that swipe pages automatically without touch.
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.
I know there are already a bzillion threads about this, but I cannot get a solution.
Problem: Not every swipe gesture is recognized.
Setup: Android 4.0.4, PhoneGap 2.1 and jQuery Mobile 1.2
On a touchMove (scroll or swipe) I get (almost every time)
Miss a drag as we are waiting for WebCore's response for touch down.
The problem seems to be that my setup is not able to detect a touchstop properly.
I using the following at the moment for swiping:
(".mainList").swipeleft(function() {
$.mobile.changePage("status.html", {
transition : "slide"
});
console.log("swipe left!!!");
});
and this for enabling the swipe to be triggered correctly every time:
// deactivate normal touch handling for swipe to work
document.ontouchmove = function(event) {
event.preventDefault();
};
This way swiping works every time but scrolling (of course) does not work anymore. You could apply this function only for the header of a page to make the header "swipable" and the content scrollable but not swipeable correctly. But this cannot be the real solution.
I tried the following tips I gathered from various thread:
use the ".on" function to bind the swipe event
bind the swipe event to a class rather than an id
Try to detect a horizontal scroll by using "ontouchstart" and "ontouchend"
This does not work as the touchend event is not triggered on every swipe.
experiment with different values of the swipe constants like $.event.special.swipe.scrollSupressionThreshold
As I thought maybe the setup is not show whether a swipe is a real swipe or a horizontal scroll:
prevent horizontal scrolling via css overflow
prevent horizontal scrolling by using a customized cordovarwebview
use different values fo the viewport meta tag in my html to set the correct page width
All trials except the event.preventDefault(); approach do not change the situation: only every second, third or fourth swipe gesture is recognized correctly.
Anyone with the same problem and maybe a solution? :D
Thx in advance
I'm developing a mobile app in jQueryMobile and PhoneGap. Often, due to the nature of jQM or because it's about loading data, a page will need some last-minute adjustments before it is shown. For example, form fields need to be filled in with dynamically retrieved data, or the contents of list items need to be given a slightly different style in order to fit better.
I am currently doing all these adjustments using the pageBeforeShow event handler. But I wonder if I shouldn't have been using the pageBeforeChange event handler. The jQM docs do not really make it clear how these two events relate to each other, i.e. which is fired first.
What I know
I do know the following
pageBeforeShow and pageShow are triggered after all of jQM's markup (e.g. making list items look pretty) has been applied.
pageBeforeShow and pageShow are bound to a specific page, whereas pageChange is called whenever a change of page occurs (so if you want to make specifi changes to one page before the user gets there, you need to test the event.toPage property)
Why I'm asking
And this is the background why I want to know if page(Before)Change is a better candidate.
jQuery Mobile page transitions are awkward on many devices. The big issue on Android devices is that page changes are jumpy: regardless of the transition type (fade, pop, etc), the page being left by the user will pop back into view briefly after the new page has more or less finished in the browser.
In my experience, this occurs mostly when other animations are running or are started while the page transition takes place. Basically, the Android browser doesn't seem to want to apply transitions to elements that are not actually in view, and it will flip back and forth between jQM pages as a result.
I've already developed a workaround where I delay any markup and form adjustments for a page by about 1000ms, which prevents the flashing but does mean that the user may be seeing these adjustments happen on screen after the page has come into view.
This analysis makes me think that pageBeforeChange might be a better candidate for attaching any markup and form adjustments. But it will be a big rewrite of the code, and I don't know what unforeseen stuff I will be getting into. Anyone have any experience with these events?
I'm not sure pagebeforechange would be the best place to do this. I don't see pagebeforechange as a page-level event, but more of a site-level event. I use it mainly if I want to take over navigation or to build dynamic pages.
I use pageinit when I want to attach event handlers to a page. I use pagebeforeshow when I want to change the contents or look of a page before it is shown.
Hope this helps.