nutiteq map: Strange map touch behaves in ScrollView container - android

I'm using nutiteq map. I have made a sample app using this map and it works all right.
But when I put map into ScrollView container then it behaves a strange way like when I touch map for navigate, it is unexpectedly zoom out and zoom in and all that.
It is only happen when I put map into scrollview container. In another view it works all right.
I want to use it with scrollview container but I can't because of this issue.

ScrollView has some special touch events and states (like Cancel touch) which were not handled in earlier versions, but are handled if you take the latest version.
Another issue of ScrollView what you may get is that scrolling is canceled after some panning, as View/Layout controller thinks that user wants to scroll whole view, so MapView does not get necessary events, it just gets Touch cancel. Maybe this can be resolved with Android view parameters.

Related

How do I cause vertical two-finger swipe behavior to cause a horizontal slider to move left or right?

I have a horizontal slider in my app, and I want to make it so that if you have the slider selected, you can do the two-fingered swipe up or down gesture from anywhere on the screen (The scroll up or down gesture) to move the slider left or right. I haven't been able to find anything through google about how to change vertical swipe behavior for Talkback and was wondering if there was in fact a way to change this.
I'd really suggest not doing this, it isn't how Android works so it will confuse your users, and be a big source of bugs as any behavior like this can cause touch errors on completely separate views. I just fixed a problem on something similar in my company's app.
But if you really want to do this- your root ViewGroup needs to intercept touch events if there are two fingers down and it moves far enough to qualify. Read https://developer.android.com/training/gestures/viewgroup#intercept for an explanation of how a parent view group can steal touch events from the child. This is the same way ScrollView works to scroll its contents. In fact, looking up the AOSP implementation of ScrollView would give you good example code.

Pinch Zoom on Android with an embedded ScrollView

I have an Android app with an Activity that I'd like to be able to pinch zoom.
The Activity is a LinearLayout that contains several controls, one of which is a ScrollView. I've implemented the zooming by following the very good example here:
https://github.com/Xjasz/AndroidZoomableViewGroup/blob/master/ZoomListView.java
Here's what I've seen:
If I put Finger1 outside of the ScrollView, I can put Finger2 anywhere and things zoom beautifully.
If I put Finger1 inside of the ScrollView, then nothing will zoom regardless of where I put Finger2.
It seems to me that once a finger goes into the ScrollView, the onTouchEvent is not propagated up to the parents.
Has anyone else seen behavior like this? Any ideas on how I can fix this so that I can always zoom if I touch inside the ScrollView first?

Android : How to detect onTouch event on a view, with touch down outside the view?

In an Android fragment, I have a GridLayout with views in it.
I would like to be able to detect when a user swipes over a view, even if he initially touches down outside of it. I've included a diagram to illustrate what I mean here :
Is there a simple way to do this (without using coordinates to see if the touch point is in the view)?
Thanks!
You solve this using View.OnTouchListeners.
Set OnTouchListeners both root view as well as your view.
Check for Events and actions ACTION_DOWN(touch event start),ACTION_UP(touch event over)
Set flags as per need for inside touch or outside touch.
basically you need capture events as well as points too.

Mapview in listview, scrolling behaviour

I've added a Map from google play services as a headerview of my listview. However, when trying to pan on the map, the list immediately takes over and starts scrolling up and down. If the user intents to pan the map(e.g. he starts a touch event on the maps surface) it should block the listview from handling the input. How do i achieve this?
note: when starting a touch on the listview, it should still scroll as a normal listview :)
I think you can try to use a static(fixed) header view, so touching your header view wont scroll your listview.
Also, I think putting a Google Map inside a header view is not really a good practice. I think a better practice is to put a MapFragment on top, then put listview below the MapFragment

Navigation controls on a mapview

Im asking a question here without any code because I don't even know if its possible. I have a MapView on an Android application which fills the width of its parent layout but not the height because the map displays a few overlays of locations and then below is a list of the locations and the user can select the one they want or to add a new location to the database. So it goes like this:
Scroll View
LinerLayout
Map View
Text View (of the overlay names on map)
/LinearLayout
/Scroll View
The problem here is that when I try to navigate north and south on the map it just scrolls with the scroll view. I expected it to move the map and only the scroll view if I clicked outside the map. It moves left and right as expected.
So what I was wondering was is it possible to either have some sort of lock function on the map so when you click on it you can navigate around it fine and then click else where on the screen and then you will navigate up and down using the scroll view. Or is there someway to have the up down left and right arrows on the map like the standard google maps do?
(I can navigate around the map fine if I use the roller ball (using the G1 phone) but it is incredibly slow)
Hope this makes sense
Do not put a MapView in a ScrollView. It simply does not work, as you are discovering. Do not put anything that knows how to vertically scroll (MapView, ListView, WebView) in a ScrollView.
Or is there someway to have the up down left and right arrows on the map like the standard google maps do?
You are welcome to create something, but there is no built-in capability for this.

Categories

Resources