Fix attribution/logo jumble when RTL layout is configured#674
Merged
Conversation
Contributor
|
@ZiZasaurus Did you verify this fix could take effect? |
tobrun
reviewed
Sep 27, 2021
Member
tobrun
left a comment
There was a problem hiding this comment.
@ZiZasaurus Did you verify this fix could take effect?
was looking together with @ZiZasaurus and it did.
It would be great though to also include before/after screenshots.
Currently two CI jobs are failing:
- verify-code: this is a ktlint formatting issue: run
make fixto patch this up automatically - run-unit-test: we changed some "business logic" so expected that we also need update some tests:
com.mapbox.maps.plugin.attribution.AttributionViewImplTest > setMargin FAILED
java.lang.AssertionError at AttributionViewImplTest.kt:57
ank27
reviewed
Sep 27, 2021
c820522 to
5382bb9
Compare
ank27
approved these changes
Sep 27, 2021
kiryldz
approved these changes
Sep 27, 2021
Chaoba
reviewed
Sep 28, 2021
| override fun setAttributionMargins(left: Int, top: Int, right: Int, bottom: Int) { | ||
| (layoutParams as FrameLayout.LayoutParams).setMargins(left, top, right, bottom) | ||
| (layoutParams as FrameLayout.LayoutParams).apply { | ||
| marginStart = left |
Contributor
There was a problem hiding this comment.
Just curious, why not use leftMargin and rightMargin to be consistent with others?
Contributor
There was a problem hiding this comment.
in order to support for RTL configuration as well, we use startMargin and endMargin, rather than leftMargin and rightMargin. Android system will ignore left and right in rtl configuration.
Chaoba
approved these changes
Sep 28, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created to resolve #635
Before:

After:
