Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix set attribute margin to use left margin #714

Conversation

alextychan
Copy link
Contributor

The following is the merge request is the same as #681, but placed into a separate branch. @felix-ht, please have a look.

Attribution margins is inconsistent with how it is initialized and is not working as of this writing.

// In MapboxMapBuilder.java; It is initialized with left and bottom margins.
  @Override
  public void setAttributionButtonMargins(int x, int y) {
    options.attributionMargins(new int[] {
            (int) x, //left
            (int) 0, //top
            (int) 0, //right
            (int) y, //bottom
    });
  }

// In MapboxMapController.java
  @Override
  public void setAttributionButtonMargins(int x, int y) {
    mapboxMap.getUiSettings().setAttributionMargins(0, 0, x, y);
  }

Changes:

// In MapboxMapController.java
  @Override
  public void setAttributionButtonMargins(int x, int y) {
    // Use left margins as right margins doesn't work.
    mapboxMap.getUiSettings().setAttributionMargins(x, 0, 0, y); 
  }

@felix-ht
Copy link
Collaborator

@alextychan with this changes do the Attribution Margins behave the same on ios and android?

@alextychan
Copy link
Contributor Author

alextychan commented Oct 18, 2021

@felix-ht as I do not own any iOS devices, I am unable to verify if iOS has the same issue. But I do know that it will work correctly or "as expected" after this change for Android.

Copy link
Collaborator

@m0nac0 m0nac0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot! The fix works for me.

I think it's unlikely that a similar issue exists on iOS, but even if so, we can merge this and ticket iOS work out.

@felix-ht felix-ht merged commit 58a5d7a into flutter-mapbox-gl:master Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants