Commit c7cb2270 authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Commit Bot

[vr] Fix RTL Android popups

Bug: 817169
Change-Id: I7ccf4c43d139f79d0a2be9a6f7a0ab964b222649
Reviewed-on: https://chromium-review.googlesource.com/960580Reviewed-by: default avatarAmirhossein Simjour <asimjour@chromium.org>
Reviewed-by: default avatarBiao She <bshe@chromium.org>
Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543093}
parent f8e2ba43
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
package org.chromium.chrome.browser.vr_shell; package org.chromium.chrome.browser.vr_shell;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.text.InputType; import android.text.InputType;
import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
...@@ -22,10 +24,13 @@ public class VrDialog extends FrameLayout { ...@@ -22,10 +24,13 @@ public class VrDialog extends FrameLayout {
* Constructor of VrDialog. Sets the DialogManager that will be used to * Constructor of VrDialog. Sets the DialogManager that will be used to
* communicate with the vr presentation of the dialog. * communicate with the vr presentation of the dialog.
*/ */
// For some reason we have to use Gravity.LEFT instead of Gravity.{START|END}. This works for
// both LTR and RTL languages.
@SuppressLint("RtlHardcoded")
public VrDialog(Context context, VrDialogManager vrDialogManager) { public VrDialog(Context context, VrDialogManager vrDialogManager) {
super(context); super(context);
setLayoutParams( setLayoutParams(new FrameLayout.LayoutParams(
new FrameLayout.LayoutParams(DIALOG_WIDTH, ViewGroup.LayoutParams.WRAP_CONTENT)); DIALOG_WIDTH, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.LEFT));
mVrDialogManager = vrDialogManager; mVrDialogManager = vrDialogManager;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment