Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/213.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在android中为RTL和LTR语言环境设计聊天泡泡_Android_Xml_Textview_Right To Left - Fatal编程技术网

在android中为RTL和LTR语言环境设计聊天泡泡

在android中为RTL和LTR语言环境设计聊天泡泡,android,xml,textview,right-to-left,Android,Xml,Textview,Right To Left,我试图使用android的“Actor”开源Messenger应用程序,但它在显示RTL语言的聊天泡泡时有一个bug。提供了针对英语文本和RTL语言文本显示的气泡 我希望它像“Whatsapp”这样的信使一样 这是气泡视图的xml文件: <im.actor.sdk.controllers.conversation.view.BubbleContainer xmlns:android="http://schemas.android.com/apk/res/android" android:i

我试图使用android的“Actor”开源Messenger应用程序,但它在显示RTL语言的聊天泡泡时有一个bug。提供了针对英语文本和RTL语言文本显示的气泡

我希望它像“Whatsapp”这样的信使一样

这是气泡视图的xml文件:

<im.actor.sdk.controllers.conversation.view.BubbleContainer xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true">

<im.actor.sdk.controllers.conversation.view.BubbleTextContainer
    android:id="@+id/fl_bubble"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:duplicateParentState="true">

    <TextView
        android:id="@+id/tv_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="top|left"
        android:includeFontPadding="false"
        android:textSize="15sp" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:layout_marginBottom="-4dp"
        android:layout_marginRight="-4dp"
        android:baselineAligned="false"
        android:gravity="center_vertical"
        android:paddingLeft="4dp">

        <TextView
            android:id="@+id/tv_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:includeFontPadding="false"
            android:textSize="13sp" />

        <im.actor.sdk.view.TintImageView
            android:id="@+id/stateIcon"
            android:layout_width="16dp"
            android:layout_height="9dp"
            android:layout_marginLeft="2dp" />
    </LinearLayout>

</im.actor.sdk.controllers.conversation.view.BubbleTextContainer>

我试图将“左”和“右”重力参数更改为“开始”和“结束”,但没有成功


如何更改此布局文件?

请确保清单中的应用程序标记的rtlSupport设置为true

确保清单中的应用程序标记的rtlSupport设置为true

这些气泡测量是在“BubbleTextContainer”类中完成的。
你应该在那里做些改变。看到代码,我想你会明白的。更具体地说,onMeasure方法中有fullContentH和fullContentW变量。根据您的需要在此处进行更改。

这些气泡测量是在“BubbleTextContainer”类中完成的。
你应该在那里做些改变。看到代码,我想你会明白的。更具体地说,onMeasure方法中有fullContentH和fullContentW变量。根据您的需要在那里进行更改。

仍然没有更改!:(还是没有变化!:(