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

setPadding not working correctly on MapboxMap #9672

Closed
haydenkaizeta opened this issue Aug 1, 2017 · 4 comments
Closed

setPadding not working correctly on MapboxMap #9672

haydenkaizeta opened this issue Aug 1, 2017 · 4 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@haydenkaizeta
Copy link

Platform:
AndroidSDK
Mapbox SDK version:
5.1.1
Devices:
Nexus5, Nexus7, S7
AndroidSDK:
20-24

Steps to trigger behavior

  1. Use setPadding(0, 0, 0, 0) (and other pixel values)
  2. Set the value again, or use LatLngBounding box camera animations

Expected behavior

setPadding() will override current padding and set to given values (set rather than add)

Actual behavior

setPadding() does multiple weird things:

  1. If you set the padding twice most of the time it will add to itself. This is not expected Android behavior
  2. If you use different kinds of padding on animations and objects sometimes the padding adds onto itself.
    These issues effect the placement of attribution and compass in addition to mapobjects

I can add examples of this, but it is easy to try setPadding(0, value, 0, 0) to reproduce the issue

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Aug 1, 2017
@tobrun
Copy link
Member

tobrun commented Aug 2, 2017

This is fixed with #9391 and scheduled for the 5.2.0 release.

@tobrun tobrun closed this as completed Aug 2, 2017
@tobrun
Copy link
Member

tobrun commented Aug 2, 2017

fwiw, you can workaround this issue as shown in #9379 (comment)

@BoD
Copy link

BoD commented Aug 28, 2017

If I'm not mistaken, the fix is available in v5.1.3.
I can confirm that we no longer see the weird "added" padding.

However, it seems that the top padding is ignored when changing the camera bounds.
The bottom padding is correctly used.

Is this a new/different issue?

@tobrun
Copy link
Member

tobrun commented Aug 28, 2017

@BoD thank you for testing and reporting.
We are following up on this in #9751.
I added a note with your findings here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

3 participants