Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[android] disabling gestures while animation is in progress #9172

@LukasPaczos

Description

@LukasPaczos

Platform: Android
Mapbox SDK version: v5.1.0-beta.3

I'm trying to block gestures while animation is in progress, but unfortunatelly cannot achieve that in any way.
On v4.2.0 I had no problems with this.

animation_queue_issue

    public void tilt(View view) {
        map.getUiSettings().setAllGesturesEnabled(false);
        Log.d("Map", "disabling gestures");
        CameraPosition position = map.getCameraPosition();
        CameraPosition.Builder builder = new CameraPosition.Builder(position);
        if (tilted) {
            tilted = false;
            builder.tilt(0);
        }
        else {
            builder.tilt(60);
            tilted = true;
        }

        map.animateCamera(CameraUpdateFactory.newCameraPosition(builder.build()), 1500, new MapboxMap.CancelableCallback() {
            @Override
            public void onCancel() {
                Log.d("Map", "animation - canceled - enabling gestures");
                map.getUiSettings().setAllGesturesEnabled(true);
            }

            @Override
            public void onFinish() {
                map.getUiSettings().setAllGesturesEnabled(true);
                Log.d("Map", "animation - finished - enabling gestures");
            }
        });
    }
Map: disabling gestures
Map: animation - finished - enabling gestures
Map: disabling gestures
Map: animation - finished - enabling gestures
Map: disabling gestures
Map: animation - canceled - enabling gestures
Map: scrolling
Map: scrolling
Map: scrolling
Map: scrolling
Map: scrolling

Metadata

Metadata

Assignees

Labels

AndroidMapbox Maps SDK for Android

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions