根据区域设置设置screenOrientation第三方活动

时间:2016-01-20 12:33:31

标签: android zendesk

我在Android应用程序中使用ZopimChat SDK。他们的聊天库包含一个ZopimChatActivity,我从自己的应用程序启动。

由于库中存在本地化问题,当语言环境为阿拉伯语且设备垂直方向时,不会显示聊天气泡。它们仅在设备水平定向时出现。 Zopim没有这方面的解决方案,所以当设备是阿拉伯语时,我想以横向 启动活动。

有办法做到这一点吗?

1 个答案:

答案 0 :(得分:1)

免责声明:这只是一种解决方法,直到Zopim Chat SDK完全支持RTL。

通过在Zopim的SDK布局文件中指定android:layoutDirection来强制执行LTR布局。这将修复破碎的布局,但仍然允许使用阿拉伯语。

通过在布局下创建zopim_chat_activity.xml并将以下内容复制到其中来执行此操作:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:id="@+id/root_container"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layoutDirection="ltr">

    <include
        android:id="@+id/toolbar"
        layout="@layout/zopim_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"/>

    <FrameLayout
        android:id="@+id/chat_fragment_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/toolbar"/>

</RelativeLayout>

有关Android Layout DocsZopim's Developer Guide

的更多详情

Arabic with LTR