From 931021ddef456e0f756c1ed05e0c4454b583fc8e Mon Sep 17 00:00:00 2001 From: Christopher Robert Van Wiemeersch Date: Fri, 19 Apr 2019 17:04:07 -0700 Subject: [PATCH] update icon for "Controller Options" in Settings (#1091) --- .../ui/widgets/dialogs/SettingsWidget.java | 20 +++++++++++++++++ ...ttings_controlleroptions_oculusvr_3dof.xml | 7 ++++++ ...ttings_controlleroptions_oculusvr_6dof.xml | 5 +++++ .../res/drawable/ic_settings_environment.xml | 2 +- app/src/main/res/layout/settings.xml | 22 +++++++++++++++++-- 5 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/drawable/ic_settings_controlleroptions_oculusvr_3dof.xml create mode 100644 app/src/main/res/drawable/ic_settings_controlleroptions_oculusvr_6dof.xml 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 8c8af61fe..8eaad2aee 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 @@ -23,6 +23,7 @@ import org.mozilla.vrbrowser.audio.AudioEngine; import org.mozilla.vrbrowser.browser.SessionStore; import org.mozilla.vrbrowser.browser.SettingsStore; +import org.mozilla.vrbrowser.input.DeviceType; import org.mozilla.vrbrowser.ui.views.HoneycombButton; import org.mozilla.vrbrowser.ui.views.HoneycombSwitch; import org.mozilla.vrbrowser.ui.widgets.UIWidget; @@ -194,6 +195,25 @@ private void initialize(Context aContext) { }); HoneycombButton controllerOptionsButton = findViewById(R.id.controllerOptionsButton); + int deviceTypeId = DeviceType.getType(); + switch (deviceTypeId) { + case DeviceType.OculusGo: + Log.d(LOGTAG, "Using Oculus 3DoF icon for Controller Options"); + controllerOptionsButton.setVisibility(View.GONE); + controllerOptionsButton = findViewById(R.id.controllerOptionsButtonOculus3dof); + controllerOptionsButton.setVisibility(View.VISIBLE); + break; + case DeviceType.OculusQuest: + Log.d(LOGTAG, "Using Oculus 6DoF icon for Controller Options"); + controllerOptionsButton.setVisibility(View.GONE); + controllerOptionsButton = findViewById(R.id.controllerOptionsButtonOculus6dof); + controllerOptionsButton.setVisibility(View.VISIBLE); + break; + default: + Log.d(LOGTAG, "Using default icon for Controller Options"); + controllerOptionsButton.setVisibility(View.VISIBLE); + break; + } controllerOptionsButton.setOnClickListener(view -> { if (mAudio != null) { mAudio.playSound(AudioEngine.Sound.CLICK); diff --git a/app/src/main/res/drawable/ic_settings_controlleroptions_oculusvr_3dof.xml b/app/src/main/res/drawable/ic_settings_controlleroptions_oculusvr_3dof.xml new file mode 100644 index 000000000..06d58ef76 --- /dev/null +++ b/app/src/main/res/drawable/ic_settings_controlleroptions_oculusvr_3dof.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_settings_controlleroptions_oculusvr_6dof.xml b/app/src/main/res/drawable/ic_settings_controlleroptions_oculusvr_6dof.xml new file mode 100644 index 000000000..47bdfd8c5 --- /dev/null +++ b/app/src/main/res/drawable/ic_settings_controlleroptions_oculusvr_6dof.xml @@ -0,0 +1,5 @@ + + + + diff --git a/app/src/main/res/drawable/ic_settings_environment.xml b/app/src/main/res/drawable/ic_settings_environment.xml index 6f5cebceb..0f9fd9c88 100644 --- a/app/src/main/res/drawable/ic_settings_environment.xml +++ b/app/src/main/res/drawable/ic_settings_environment.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/layout/settings.xml b/app/src/main/res/layout/settings.xml index 44510ac0e..647fc1404 100644 --- a/app/src/main/res/layout/settings.xml +++ b/app/src/main/res/layout/settings.xml @@ -94,7 +94,7 @@ android:layout_marginRight="10dp" app:honeycombButtonIcon="@drawable/ic_settings_language" app:honeycombButtonText="@string/settings_language" - app:honeycombButtonTextSize="@dimen/settings_main_button_text_width"/> + app:honeycombButtonTextSize="@dimen/settings_main_button_text_width" /> + app:honeycombSwitchTextSize="@dimen/settings_main_button_text_width" /> + + +