GitHub Issue | n/a |
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-03-30T00:41:56.000+0000 |
Affected Version/s | Release 2.1.4, Release 3.0.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 04 API, 2013 Sprint 04, 2013 Sprint 07 Core |
Components | Android |
Labels | exalture, module_map, parity, qe-testadded, triage |
Reporter | Carlo Hermus |
Assignee | Allen Yeung |
Created | 2012-11-21T16:03:54.000+0000 |
Updated | 2013-03-30T18:33:05.000+0000 |
*Actual Result*
No results. The event is only fired the first time you touch the screen when window is opened. It states in version 1.8.0.1 this feature was available. But in version 2.1.3, 2.1.4 and the new 3.0 SDK this feature is not available.
*Expected Result*
Being able to detect longpress event on a mapview and return the appropriate parameters.
*Notes*
When you run this on a iOS device it works.
*Test case*
var mapView = Ti.Map.createView({
mapType : Ti.Map.STANDARD_TYPE,
animate : true,
regionFit : true,
region : {
latitudeDelta : 0.02,
longitudeDelta : 0.02,
},
userLocation : true,
width : '100%',
height : '100%',
top : 0,
});
// open a single window
var window = Ti.UI.createWindow({
backgroundColor : 'white'
});
mapView.addEventListener('longpress', function(e) {
alert(e);
});
window.add(mapView);
window.open();
Tested and confirmed on Samsung Galaxy S2 2.3.6 device and Android emulator 2.3.3 on both 2.1.4 GA and latest 3.0.0 build.
Any ETA on this?
Any ETA on this?
Hi. Also wondering if there was an movement on this. Thanks.
Hi Vivekr, I was wondering if you could tell me if, included in the scope of this ticket, is the issue that the "longpress" event is fired on a quick tap. Thanks.
Can you please give us an ETA? My android launch is depending on this and so is my paycheque
x2
Since the TIUIView touch handlers get the event only once, I implemented this in the native MapView by handling touch. I have returned false for 'allowRegisterForTouch' so that TIView handlers don't get registered and we don't get duplicate event fired at the first time.
The 'longpress' event is never supported on MapView on Android. This event is not documented either. Change the ticket to New Feature.
If I remember correctly this was a feature in 1.8
Dear Ping, Please change it back to bug. We are waiting for 3 months until it was picked up and after a few weeks in review it is now a feature?? And this "feature" was available in 1.8 versions and also documented. Even so it is working in iPhone. This is a bug and not a new feature request. Besides there is also a pull request from november.
On testing, the Android behavior on 1.8 is identical to the current behavior, so this is not a regression. The 1.8 doc is wrong. So we have a documentation issue here as well as a parity issue. When we transitioned to a new doc format in 1.8, a number of spurious events were introduced by the new documentation inheritance mechanism. Between 1.8 and 2.0, we spent a lot of time testing controls and correcting the doc for events etc., that were not actually supported. In this case, it appears that we were overzealous and removed the doc for the "longpress" event, although it appears to be supported on iOS. I'll open a doc ticket to correct the event support info.
PR: https://github.com/appcelerator/titanium_mobile/pull/3871
Can someone help me out with this? I'm having trouble keeping up. Will this be added in 3.1 or will documentation be updated to reflect that it is not available for Android? Thanks.
Hi Ben, this feature will be in 3.1 and the doc will show that it is added on Android since 3.1.
Thanks, Ping.
Thanks Ping. I tested and the longpress works... I have only 2 questions or requests. The longpress is activated after 4 seconds pressing and then releasing. On the iPhone it is activated after 2 seconds and still pressing on the map. Is it possible to implement this as the iPhone so give it only 2 seconds (because it is hard not to move the map while pressing for 4 seconds). And is it possible to implement this as the iPhone that the event is triggered when still pressing and not on the up event. TIA, Carlo
I agree the longpress ought to be fired while the user is still pressing. This allows the app to update the UI and cue the user that something has happened. Otherwise, the user doesn't know they've pressed long enough until they lift their finger.
Agreed. Also, I've never encountered an app where a longpress takes 4 seconds. I'm not sure that a user could be convinced to press for that long.
Closing it as it has been implemented.Test case added.
Carlo, if you have test code handy, could you open a bug for the parity differences between Android and iOS?
Hi. Can we get an update on what this additional activity is for? Is the release going to stay the same and has the timing been addressed or is it still 4 seconds? Thanks.
PR: https://github.com/appcelerator/titanium_mobile/pull/4054 The long press event does not take 4 seconds to activate, it's most likely masked by the fact that you need to lift your finger to trigger the event. I've changed it so the long press event activates even when the user does not perform and action up event.
Ok, verified the feature has been implemented as follows: Longpress fires after approx 2 seconds while finger down, without "up" event. Verified on the following with the sample code above: Mac OS 10.8.3 SDK: 3.1.0.v20130329175112 Titanium Studio, build: 3.1.0.201303261815 CLI 3.0.25-alpha node-appc 1.0.29-alpha Nexus 4 OS 4.2.1