Skip to content

Fix attribution/logo jumble when RTL layout is configured#674

Merged
ank27 merged 2 commits intomainfrom
ziziRTLLayoutFix
Sep 29, 2021
Merged

Fix attribution/logo jumble when RTL layout is configured#674
ank27 merged 2 commits intomainfrom
ziziRTLLayoutFix

Conversation

@ZiZasaurus
Copy link
Copy Markdown
Contributor

@ZiZasaurus ZiZasaurus commented Sep 24, 2021

Created to resolve #635

Before:
Screen Shot 2021-09-27 at 9 19 44 AM

After:
Screen Shot 2021-09-27 at 9 20 16 AM

@ZiZasaurus ZiZasaurus requested a review from tobrun September 24, 2021 15:19
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 24, 2021

CLA assistant check
All committers have signed the CLA.

@ZiZasaurus ZiZasaurus requested a review from Chaoba September 24, 2021 18:02
@Chaoba
Copy link
Copy Markdown
Contributor

Chaoba commented Sep 26, 2021

@ZiZasaurus Did you verify this fix could take effect?

@tobrun tobrun changed the title Fix attribution/logo jumble when RTL layout is cofigured Fix attribution/logo jumble when RTL layout is configured Sep 27, 2021
Copy link
Copy Markdown
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

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

@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 fix to 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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious, why not use leftMargin and rightMargin to be consistent with others?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@ank27 ank27 requested a review from Chaoba September 28, 2021 07:29
@ank27 ank27 merged commit 75a0211 into main Sep 29, 2021
@ank27 ank27 deleted the ziziRTLLayoutFix branch September 29, 2021 09:21
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.

"Mapbox" word overlaps blue click button in RTL

6 participants