0

The mapview only scrolls sideways, as if you try to scroll vertically the ScrollView is taking the action. I've tried requestDisallowInterceptTouchEvent(true); but it didn't help.

PS. Yandex MapView extends RelativeLayout

halfer
  • 19,824
  • 17
  • 99
  • 186
MJakhongir
  • 2,101
  • 2
  • 16
  • 27
  • Answering my own question... this answer worked !! https://stackoverflow.com/questions/16974983/google-maps-api-v2-supportmapfragment-inside-scrollview-users-cannot-scroll-th – MJakhongir Nov 13 '17 at 13:27

1 Answers1

1

You have to create custom MapView. Follow the code snippet provided below

public class AppMapView extends MapView {

    public AppMapView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        switch (ev.getAction()) {
            case MotionEvent.ACTION_UP:
               System.out.println("unlocked");
               this.getParent().requestDisallowInterceptTouchEvent(false);
               break;

            case MotionEvent.ACTION_DOWN:
               System.out.println("locked");
               this.getParent().requestDisallowInterceptTouchEvent(true);
               break;
       }
       return super.dispatchTouchEvent(ev);
   }
}
Hantash Nadeem
  • 458
  • 6
  • 10