XPopup icon indicating copy to clipboard operation
XPopup copied to clipboard

RTL 阿拉伯语言 BubbleAttachPopupView 弹出有问题

Open changjiashuai opened this issue 3 years ago • 0 comments

XPopup版本 2.8.14

手机系统和型号 one plus 7 pro

描述你的问题

RTL 阿拉伯语言 BubbleAttachPopupView 弹出有问题, LTR语言弹出正常。


// 使用代码
 XPopup.Builder(context)
                .isDestroyOnDismiss(true)
                .atView(binding.root)
                .hasShadowBg(false)
                .popupPosition(PopupPosition.Top)
                .isCenterHorizontal(true)
                .offsetY(-XPopupUtils.dp2px(context, 70f))
                .asCustom(copyView)
                .show()

// 改动这里 可以正常显示
                        //水平居中
//                        if (isShowLeft)
//                            if (isRTL) {
//                                translationX -= (rect.width() - getPopupContentView().getMeasuredWidth()) / 2f;
//                            } else {
//                                translationX += (rect.width() - getPopupContentView().getMeasuredWidth()) / 2f;
//                            }
//                        else {
//                            if (isRTL) {
//                                translationX += (rect.width() - getPopupContentView().getMeasuredWidth()) / 2f;
//                            } else {
//                                translationX -= (rect.width() - getPopupContentView().getMeasuredWidth()) / 2f;
//                            }
//                        }
                        //水平居中
                        if (isShowLeft) {
                            translationX += (rect.width() - getPopupContentView().getMeasuredWidth()) / 2f;
                        } else {
                            translationX -= (rect.width() - getPopupContentView().getMeasuredWidth()) / 2f;
                        }

changjiashuai avatar Jul 26 '22 02:07 changjiashuai