Merge changes I282ed7eb,I4e9ca9ed into tm-dev
* changes: Fix a padding issue for bubble user education in RTL Fix position of bubble education views on large screen in RTL
This commit is contained in:
@@ -108,8 +108,16 @@ class ManageEducationView constructor(context: Context, positioner: BubblePositi
|
|||||||
alpha = 0f
|
alpha = 0f
|
||||||
visibility = View.VISIBLE
|
visibility = View.VISIBLE
|
||||||
expandedView.getManageButtonBoundsOnScreen(realManageButtonRect)
|
expandedView.getManageButtonBoundsOnScreen(realManageButtonRect)
|
||||||
|
val isRTL = mContext.resources.configuration.layoutDirection == LAYOUT_DIRECTION_RTL
|
||||||
|
if (isRTL) {
|
||||||
|
val rightPadding = positioner.screenRect.right - realManageButtonRect.right -
|
||||||
|
expandedView.manageButtonMargin
|
||||||
|
manageView.setPadding(manageView.paddingLeft, manageView.paddingTop,
|
||||||
|
rightPadding, manageView.paddingBottom)
|
||||||
|
} else {
|
||||||
manageView.setPadding(realManageButtonRect.left - expandedView.manageButtonMargin,
|
manageView.setPadding(realManageButtonRect.left - expandedView.manageButtonMargin,
|
||||||
manageView.paddingTop, manageView.paddingRight, manageView.paddingBottom)
|
manageView.paddingTop, manageView.paddingRight, manageView.paddingBottom)
|
||||||
|
}
|
||||||
post {
|
post {
|
||||||
manageButton
|
manageButton
|
||||||
.setOnClickListener {
|
.setOnClickListener {
|
||||||
@@ -122,7 +130,11 @@ class ManageEducationView constructor(context: Context, positioner: BubblePositi
|
|||||||
val offsetViewBounds = Rect()
|
val offsetViewBounds = Rect()
|
||||||
manageButton.getDrawingRect(offsetViewBounds)
|
manageButton.getDrawingRect(offsetViewBounds)
|
||||||
manageView.offsetDescendantRectToMyCoords(manageButton, offsetViewBounds)
|
manageView.offsetDescendantRectToMyCoords(manageButton, offsetViewBounds)
|
||||||
|
if (isRTL && (positioner.isLargeScreen || positioner.isLandscape)) {
|
||||||
|
translationX = (positioner.screenRect.right - width).toFloat()
|
||||||
|
} else {
|
||||||
translationX = 0f
|
translationX = 0f
|
||||||
|
}
|
||||||
translationY = (realManageButtonRect.top - offsetViewBounds.top).toFloat()
|
translationY = (realManageButtonRect.top - offsetViewBounds.top).toFloat()
|
||||||
bringToFront()
|
bringToFront()
|
||||||
animate()
|
animate()
|
||||||
|
|||||||
@@ -146,6 +146,12 @@ class StackEducationView constructor(
|
|||||||
} else {
|
} else {
|
||||||
setPadding(paddingLeft, paddingTop, positioner.bubbleSize + stackPadding,
|
setPadding(paddingLeft, paddingTop, positioner.bubbleSize + stackPadding,
|
||||||
paddingBottom)
|
paddingBottom)
|
||||||
|
if (positioner.isLargeScreen || positioner.isLandscape) {
|
||||||
|
translationX = (positioner.screenRect.right - width - stackPadding)
|
||||||
|
.toFloat()
|
||||||
|
} else {
|
||||||
|
translationX = 0f
|
||||||
|
}
|
||||||
}
|
}
|
||||||
translationY = stackPosition.y + positioner.bubbleSize / 2 - getHeight() / 2
|
translationY = stackPosition.y + positioner.bubbleSize / 2 - getHeight() / 2
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user