diff --git a/app/build.gradle b/app/build.gradle
index cf224cf59..b5f75ab35 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -61,6 +61,9 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
+ debug {
+ pseudoLocalesEnabled true
+ }
}
externalNativeBuild {
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/settings/ButtonSetting.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/settings/ButtonSetting.java
index bea09c17d..4d9c61cb1 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/settings/ButtonSetting.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/settings/ButtonSetting.java
@@ -46,12 +46,7 @@ private void initialize(Context aContext) {
mButton.setOnClickListener(mInternalClickListener);
}
- private View.OnClickListener mInternalClickListener = new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- onClickListener(v);
- }
- };
+ private View.OnClickListener mInternalClickListener = v -> onClickListener(v);
protected void onClickListener(View v) {
if (mAudio != null) {
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/settings/SingleEditSetting.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/settings/SingleEditSetting.java
index 0369d58da..abe78befb 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/settings/SingleEditSetting.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/settings/SingleEditSetting.java
@@ -140,7 +140,7 @@ protected boolean updateTouchTextSelection(View v) {
}
editText.requestFocusFromTouch();
-
+
return false;
}
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SettingsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SettingsWidget.java
index 63c3aed81..6f89c5b62 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SettingsWidget.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SettingsWidget.java
@@ -361,16 +361,7 @@ private void onOptionsDialogDismissed() {
// WindowManagerDelegate.FocusChangeListener
@Override
public void onGlobalFocusChanged(View oldFocus, View newFocus) {
- boolean dismiss = false;
- UIWidget widget = getChild(mCurrentlyOpenedDialogHandle);
- if (widget != null && oldFocus == widget && widget.isVisible()) {
- dismiss = true;
-
- } else if (oldFocus == this && isVisible()) {
- dismiss = true;
- }
-
- if (dismiss) {
+ if (oldFocus == this && isVisible()) {
onDismiss();
}
}
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/DeveloperOptionsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/DeveloperOptionsWidget.java
index 3d45cb9a5..a2079b2e1 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/DeveloperOptionsWidget.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/DeveloperOptionsWidget.java
@@ -18,13 +18,16 @@
import org.mozilla.vrbrowser.ui.views.settings.ButtonSetting;
import org.mozilla.vrbrowser.ui.views.settings.RadioGroupSetting;
import org.mozilla.vrbrowser.ui.views.settings.SwitchSetting;
+import org.mozilla.vrbrowser.ui.widgets.WidgetManagerDelegate;
import org.mozilla.vrbrowser.ui.widgets.dialogs.RestartDialogWidget;
import org.mozilla.vrbrowser.ui.widgets.UIWidget;
import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement;
import static org.mozilla.vrbrowser.utils.ServoUtils.isServoAvailable;
-public class DeveloperOptionsWidget extends UIWidget {
+public class DeveloperOptionsWidget extends UIWidget implements
+ WidgetManagerDelegate.WorldClickListener,
+ WidgetManagerDelegate.FocusChangeListener {
private AudioEngine mAudio;
private UIButton mBackButton;
@@ -63,8 +66,11 @@ private void initialize(Context aContext) {
mAudio = AudioEngine.fromContext(aContext);
+ mWidgetManager.addFocusChangeListener(this);
+ mWidgetManager.addWorldClickListener(this);
+
mBackButton = findViewById(R.id.backButton);
- mBackButton.setOnClickListener((OnClickListener) view -> {
+ mBackButton.setOnClickListener(view -> {
if (mAudio != null) {
mAudio.playSound(AudioEngine.Sound.CLICK);
}
@@ -125,6 +131,14 @@ protected void initializeWidgetPlacement(WidgetPlacement aPlacement) {
aPlacement.translationZ = WidgetPlacement.unitFromMeters(getContext(), R.dimen.restart_dialog_world_z);
}
+ @Override
+ public void releaseWidget() {
+ mWidgetManager.removeFocusChangeListener(this);
+ mWidgetManager.removeWorldClickListener(this);
+
+ super.releaseWidget();
+ }
+
@Override
public void show() {
super.show();
@@ -282,4 +296,22 @@ private void setPointerColor(int checkedId, boolean doApply) {
}
}
+ // WindowManagerDelegate.FocusChangeListener
+
+ @Override
+ public void onGlobalFocusChanged(View oldFocus, View newFocus) {
+ if (oldFocus == this && isVisible() && findViewById(newFocus.getId()) == null) {
+ onDismiss();
+ }
+ }
+
+ // WorldClickListener
+
+ @Override
+ public void onWorldClick() {
+ if (isVisible()) {
+ onDismiss();
+ }
+ }
+
}
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/DisplayOptionsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/DisplayOptionsWidget.java
index d540140d4..33e8a4cc5 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/DisplayOptionsWidget.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/DisplayOptionsWidget.java
@@ -7,6 +7,7 @@
import android.content.Context;
import android.util.AttributeSet;
+import android.view.View;
import android.widget.ScrollView;
import org.mozilla.vrbrowser.R;
@@ -18,11 +19,14 @@
import org.mozilla.vrbrowser.ui.views.settings.DoubleEditSetting;
import org.mozilla.vrbrowser.ui.views.settings.RadioGroupSetting;
import org.mozilla.vrbrowser.ui.views.settings.SingleEditSetting;
+import org.mozilla.vrbrowser.ui.widgets.WidgetManagerDelegate;
import org.mozilla.vrbrowser.ui.widgets.dialogs.RestartDialogWidget;
import org.mozilla.vrbrowser.ui.widgets.UIWidget;
import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement;
-public class DisplayOptionsWidget extends UIWidget {
+public class DisplayOptionsWidget extends UIWidget implements
+ WidgetManagerDelegate.WorldClickListener,
+ WidgetManagerDelegate.FocusChangeListener {
private AudioEngine mAudio;
private UIButton mBackButton;
@@ -60,8 +64,11 @@ private void initialize(Context aContext) {
mAudio = AudioEngine.fromContext(aContext);
+ mWidgetManager.addFocusChangeListener(this);
+ mWidgetManager.addWorldClickListener(this);
+
mBackButton = findViewById(R.id.backButton);
- mBackButton.setOnClickListener((OnClickListener) view -> {
+ mBackButton.setOnClickListener(view -> {
if (mAudio != null) {
mAudio.playSound(AudioEngine.Sound.CLICK);
}
@@ -126,6 +133,14 @@ protected void initializeWidgetPlacement(WidgetPlacement aPlacement) {
aPlacement.translationZ = WidgetPlacement.unitFromMeters(getContext(), R.dimen.restart_dialog_world_z);
}
+ @Override
+ public void releaseWidget() {
+ mWidgetManager.removeFocusChangeListener(this);
+ mWidgetManager.removeWorldClickListener(this);
+
+ super.releaseWidget();
+ }
+
@Override
public void show() {
super.show();
@@ -329,4 +344,22 @@ private void setMaxWindowSize(int newMaxWindowWidth, int newMaxWindowHeight, boo
String newMaxWindowHeightStr = Integer.toString(newMaxWindowHeight);
mMaxWindowSizeEdit.setSecondText(newMaxWindowHeightStr);
}
+
+ // WindowManagerDelegate.FocusChangeListener
+
+ @Override
+ public void onGlobalFocusChanged(View oldFocus, View newFocus) {
+ if (oldFocus == this && isVisible() && findViewById(newFocus.getId()) == null) {
+ onDismiss();
+ }
+ }
+
+ // WorldClickListener
+
+ @Override
+ public void onWorldClick() {
+ if (isVisible()) {
+ onDismiss();
+ }
+ }
}
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/VoiceSearchLanguageOptionsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/VoiceSearchLanguageOptionsWidget.java
index 1e55495a5..fbe6e71d6 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/VoiceSearchLanguageOptionsWidget.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/options/VoiceSearchLanguageOptionsWidget.java
@@ -7,6 +7,7 @@
import android.content.Context;
import android.util.AttributeSet;
+import android.view.View;
import android.widget.ScrollView;
import org.mozilla.vrbrowser.R;
@@ -16,10 +17,13 @@
import org.mozilla.vrbrowser.ui.views.settings.ButtonSetting;
import org.mozilla.vrbrowser.ui.views.settings.RadioGroupSetting;
import org.mozilla.vrbrowser.ui.widgets.UIWidget;
+import org.mozilla.vrbrowser.ui.widgets.WidgetManagerDelegate;
import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement;
import org.mozilla.vrbrowser.utils.LocaleUtils;
-public class VoiceSearchLanguageOptionsWidget extends UIWidget {
+public class VoiceSearchLanguageOptionsWidget extends UIWidget implements
+ WidgetManagerDelegate.WorldClickListener,
+ WidgetManagerDelegate.FocusChangeListener {
private AudioEngine mAudio;
private UIButton mBackButton;
@@ -50,6 +54,9 @@ private void initialize(Context aContext) {
mAudio = AudioEngine.fromContext(aContext);
+ mWidgetManager.addFocusChangeListener(this);
+ mWidgetManager.addWorldClickListener(this);
+
mBackButton = findViewById(R.id.backButton);
mBackButton.setOnClickListener(view -> {
if (mAudio != null) {
@@ -83,6 +90,14 @@ protected void initializeWidgetPlacement(WidgetPlacement aPlacement) {
aPlacement.translationZ = WidgetPlacement.unitFromMeters(getContext(), R.dimen.restart_dialog_world_z);
}
+ @Override
+ public void releaseWidget() {
+ mWidgetManager.removeFocusChangeListener(this);
+ mWidgetManager.removeWorldClickListener(this);
+
+ super.releaseWidget();
+ }
+
@Override
public void show() {
super.show();
@@ -109,4 +124,22 @@ private void setLanguage(int checkedId, boolean doApply) {
SettingsStore.getInstance(getContext()).setVoiceSearchLanguage(mLanguage.getValueForId(checkedId).toString());
}
+ // WindowManagerDelegate.FocusChangeListener
+
+ @Override
+ public void onGlobalFocusChanged(View oldFocus, View newFocus) {
+ if (oldFocus == this && isVisible() && findViewById(newFocus.getId()) == null) {
+ onDismiss();
+ }
+ }
+
+ // WorldClickListener
+
+ @Override
+ public void onWorldClick() {
+ if (isVisible()) {
+ onDismiss();
+ }
+ }
+
}
diff --git a/app/src/main/res/layout/crash_dialog.xml b/app/src/main/res/layout/crash_dialog.xml
index 38f1f52c8..8e435e19d 100644
--- a/app/src/main/res/layout/crash_dialog.xml
+++ b/app/src/main/res/layout/crash_dialog.xml
@@ -72,21 +72,21 @@
diff --git a/app/src/main/res/layout/honeycomb_button.xml b/app/src/main/res/layout/honeycomb_button.xml
index a731f4099..c2affc330 100644
--- a/app/src/main/res/layout/honeycomb_button.xml
+++ b/app/src/main/res/layout/honeycomb_button.xml
@@ -19,22 +19,23 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:layout_marginLeft="15dp"
- android:layout_marginRight="15dp"
+ android:layout_marginStart="15dp"
+ android:layout_marginEnd="15dp"
+ android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="@string/settings_privacy"
- android:textSize="@dimen/text_smaller_size"
- android:fontFamily="sans-serif-light"/>
+ android:textSize="@dimen/text_smaller_size" />
+
+ android:textSize="@dimen/text_smaller_size" />
diff --git a/app/src/main/res/layout/honeycomb_switch.xml b/app/src/main/res/layout/honeycomb_switch.xml
index 401519a3b..c9a739fa6 100644
--- a/app/src/main/res/layout/honeycomb_switch.xml
+++ b/app/src/main/res/layout/honeycomb_switch.xml
@@ -1,16 +1,19 @@
+
+ tool:text="Description" />
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+ android:paddingBottom="10dp">
+
+
+ android:layout_above="@+id/separatorBottom"
+ android:layout_below="@+id/separatorTop">
@@ -80,17 +86,26 @@
+
+
diff --git a/app/src/main/res/layout/options_display.xml b/app/src/main/res/layout/options_display.xml
index fe06bb403..2fee43a4e 100644
--- a/app/src/main/res/layout/options_display.xml
+++ b/app/src/main/res/layout/options_display.xml
@@ -1,7 +1,6 @@
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+ android:paddingBottom="10dp">
+
+
+ android:layout_above="@+id/separatorBottom"
+ android:layout_below="@+id/separatorTop">
@@ -50,7 +56,7 @@
@@ -58,35 +64,44 @@
+
+
diff --git a/app/src/main/res/layout/options_language.xml b/app/src/main/res/layout/options_language.xml
index 68c0d1765..ee2cf5814 100644
--- a/app/src/main/res/layout/options_language.xml
+++ b/app/src/main/res/layout/options_language.xml
@@ -9,9 +9,9 @@
android:layout_height="match_parent"
android:background="@drawable/dialog_background"
android:paddingStart="30dp"
- android:paddingTop="20dp"
+ android:paddingTop="10dp"
android:paddingEnd="30dp"
- android:paddingBottom="20dp">
+ android:paddingBottom="10dp">
+
+
@@ -39,8 +47,8 @@
style="@style/scrollbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_above="@+id/resetButton"
- android:layout_below="@+id/voice_search_language_title">
+ android:layout_above="@+id/separatorBottom"
+ android:layout_below="@+id/separatorTop">
+
+
diff --git a/app/src/main/res/layout/setting_button.xml b/app/src/main/res/layout/setting_button.xml
index f2d496b95..b0e691449 100644
--- a/app/src/main/res/layout/setting_button.xml
+++ b/app/src/main/res/layout/setting_button.xml
@@ -3,7 +3,7 @@
diff --git a/app/src/main/res/layout/setting_edit.xml b/app/src/main/res/layout/setting_edit.xml
index 76497d8d1..85a0b4619 100644
--- a/app/src/main/res/layout/setting_edit.xml
+++ b/app/src/main/res/layout/setting_edit.xml
@@ -3,14 +3,9 @@
-
-
-
-
-
-
-
-
+ android:orientation="horizontal">
+
+
diff --git a/app/src/main/res/layout/settings.xml b/app/src/main/res/layout/settings.xml
index d277036c0..0657a0069 100644
--- a/app/src/main/res/layout/settings.xml
+++ b/app/src/main/res/layout/settings.xml
@@ -89,7 +89,7 @@
android:layout_marginRight="10dp"
app:honeycombButtonIcon="@drawable/ic_settings_display"
app:honeycombButtonText="@string/settings_display"
- app:honeycombButtonTextSize="52dp" />
+ app:honeycombButtonTextSize="@dimen/settings_button_text_width" />
+ app:honeycombButtonText="@string/settings_language"
+ app:honeycombButtonTextSize="@dimen/settings_button_text_width"/>
+ app:honeycombSwitchTextSize="@dimen/settings_button_text_width" />
+ app:honeycombSwitchText="@string/settings_telemetry"
+ app:honeycombSwitchTextSize="@dimen/settings_button_text_width"/>
@@ -128,7 +130,7 @@
android:layout_marginRight="10dp"
app:honeycombButtonIcon="@drawable/ic_settings_privacypolicy"
app:honeycombButtonText="@string/settings_privacy"
- app:honeycombButtonTextSize="52dp" />
+ app:honeycombSwitchTextSize="@dimen/settings_button_text_width" />
+ app:honeycombSwitchTextSize="@dimen/settings_button_text_width" />
+ app:honeycombSecondaryText="@string/bug_report_url"
+ app:honeycombSwitchTextSize="@dimen/settings_button_text_width" />
diff --git a/app/src/main/res/layout/voice_search_dialog.xml b/app/src/main/res/layout/voice_search_dialog.xml
index 7b58630cb..fc572aeab 100644
--- a/app/src/main/res/layout/voice_search_dialog.xml
+++ b/app/src/main/res/layout/voice_search_dialog.xml
@@ -41,7 +41,7 @@
android:id="@+id/voiceSearchText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
+ android:layout_marginTop="5dp"
android:text="@string/voice_search_start"
android:textAlignment="viewStart"
android:textColor="@color/white"
diff --git a/app/src/main/res/values/dimen.xml b/app/src/main/res/values/dimen.xml
index ae652c003..275d0988b 100644
--- a/app/src/main/res/values/dimen.xml
+++ b/app/src/main/res/values/dimen.xml
@@ -53,6 +53,7 @@
580dp
520dp
320dp
+ 100dp
88dp
@@ -76,7 +77,7 @@
- 1.6
- -1.8
- 380dp
+ 420dp
280dp
@@ -92,12 +93,14 @@
40dp
- 470dp
- 380dp
+ 585dp
+ 385dp
+ 120dp
+ 40dp
- 400dp
- 275dp
+ 460dp
+ 280dp
20dp
25dp
30dp
@@ -112,13 +115,14 @@
380dp
- 450dp
+ 640dp
350dp
- - 1.5
+ - 1.2
- -1.8
- 100dp
+ 156dp
+ 175dp
35dp
20dp
14dip
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 5fc51be11..af6fef2a9 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -176,7 +176,7 @@
+
+
+
+