Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
update icon for "Controller Options" in Settings (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan authored and bluemarvin committed Apr 20, 2019
1 parent 506bb96 commit 931021d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<vector android:height="24dp" android:viewportHeight="200"
android:viewportWidth="200" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFFFF" android:pathData="M183.31,156.74c-1.69,-3.73 -47.45,-62.51 -50.13,-66 -2,-2.53 -50,-62.29 -52.63,-64.91C76.28,21.59 71.8,18 66.48,16c-14.2,-5.18 -30.23,-2.59 -41.62,8.8s-14,27.46 -8.78,41.67c1.94,5.3 5.55,9.77 9.81,14 2.65,2.66 62.17,50.53 65,52.7 3.71,2.8 62.07,48.45 66,50.1 4.24,1.77 14.27,7.35 24,-2.38S184.89,160.19 183.31,156.74ZM110.31,93.82c-0.24,4.79 -3.3,9 -5.36,11.07s-6.39,5.31 -11.23,5.66a27.46,27.46 0,0 1,-9 -0.86c-6.56,-1.6 -14.19,-5.76 -15.67,-6.55 -1.8,-1 -34.83,-21.88 -41.49,-28.54A33.28,33.28 0,0 1,74.63 27.53c6.75,6.75 27,40.32 27.84,42.35 0.68,1.61 4.85,8.51 6.82,15.54A26.2,26.2 0,0 1,110.28 93.82Z"/>
<path android:fillColor="#FFFFFFFF" android:pathData="M51.1,51.08m-30.93,0a30.93,30.93 0,1 1,61.86 0a30.93,30.93 0,1 1,-61.86 0"/>
<path android:fillColor="#FFFFFFFF" android:pathData="M91.36,82.31a6.38,6.38 0,1 0,0 9A6.38,6.38 0,0 0,91.36 82.31Z"/>
<path android:fillColor="#FFFFFFFF" android:pathData="M93.35,93.32a6.37,6.37 0,1 0,9 0A6.37,6.37 0,0 0,93.35 93.32Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="32dp" android:viewportHeight="200"
android:viewportWidth="200" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFFFF" android:pathData="M185.62,123.57c-6.3,-8.77 -21.6,-22 -22.05,-22.49s-10.57,-3.15 -12.14,-3.6a92.45,92.45 0,0 0,16.64 -18.67c7.65,-11.92 6.05,-16.86 4.73,-20.46 -5,-13.5 -21.4,-12.46 -23.17,-12.15 -3.82,0.67 -11.16,2.11 -23.73,13.83 -13.38,12.48 -17.43,24.86 -17,30 0.81,9.33 12.15,17.54 12.82,18a38.63,38.63 0,0 1,2.93 13.72c0,1.58 3.82,1.13 4.72,0.9a3.62,3.62 0,0 0,1.8 1.57c1.8,0.68 5.4,-0.44 7.19,-1.57s2.7,-0.22 3.15,0.23a1.44,1.44 0,0 1,0.2 0.23,3.13 3.13,0 0,0 0.37,2.13c0.9,1.35 3.19,4.46 3.37,4.72a3.62,3.62 0,0 0,3.54 1.9c4.89,5.59 11.49,12.56 17.71,17.11 8.8,6.42 14.4,4.94 15.52,4.49a15.35,15.35 0,0 0,9 -9.44C193.49,137.29 191.91,132.34 185.62,123.57ZM128,93.21c7.87,-20.25 30.09,-33.89 29.24,-31.94C147.61,83.31 129.61,92.76 128,93.21Z"/>
<path android:fillColor="#FFFFFFFF" android:pathData="M8.76,144a15.35,15.35 0,0 0,9 9.44c1.12,0.45 6.72,1.93 15.52,-4.49C39.5,144.44 46.1,137.47 51,131.88a3.62,3.62 0,0 0,3.54 -1.9c0.18,-0.26 2.47,-3.37 3.37,-4.72a3.13,3.13 0,0 0,0.37 -2.13,1.44 1.44,0 0,1 0.2,-0.23c0.45,-0.45 1.35,-1.35 3.15,-0.23s5.39,2.25 7.19,1.57a3.62,3.62 0,0 0,1.8 -1.57c0.9,0.23 4.72,0.68 4.72,-0.9a38.63,38.63 0,0 1,2.93 -13.72c0.67,-0.45 12,-8.66 12.82,-18 0.45,-5.17 -3.6,-17.55 -17,-30C61.53,48.31 54.19,46.87 50.37,46.2c-1.77,-0.31 -18.22,-1.35 -23.17,12.15 -1.32,3.6 -2.92,8.54 4.73,20.46A92.45,92.45 0,0 0,48.57 97.48c-1.57,0.45 -11.7,3.15 -12.14,3.6s-15.75,13.72 -22,22.49S6.51,137.29 8.76,144ZM42.76,61.23C41.87,59.32 64.09,73 72,93.21 70.39,92.76 52.39,83.31 42.72,61.27Z"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_settings_environment.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<vector android:height="24dp" android:viewportHeight="200"
android:viewportWidth="200" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFFFF" android:pathData="M73.3,96.6c0.2,-0.4 0.3,-0.7 0.3,-0.9c7.4,-21.9 14.8,-43.7 22.2,-65.6c0.6,-1.6 1.6,-2.8 3.3,-3.2c2.3,-0.6 4.6,0.7 5.3,2.9c0.7,2.1 1.4,4.2 2.1,6.3l26,76.6c0.1,0.2 0.2,0.5 0.3,0.8c0.1,-0.2 0.3,-0.3 0.4,-0.5c4,-7.3 8.1,-14.6 12.1,-21.9c0.3,-0.6 0.6,-1.1 0.9,-1.7c0.8,-1.5 2.3,-2.4 3.9,-2.3c1.6,0 3.2,0.9 3.9,2.3c3,5.5 6.1,11 9.1,16.5l33,59.9c0.2,0.4 0.4,0.8 0.6,1.1c1.1,2.2 0.2,4.8 -2,5.9c-0.6,0.3 -1.2,0.4 -1.9,0.4c-0.3,0 -0.7,0 -1,0H8.1c-0.4,0 -0.8,0 -1.1,0c-2.4,-0.1 -4.3,-2.2 -4.2,-4.6c0,-0.4 0.1,-0.7 0.2,-1.1c0.1,-0.3 0.2,-0.6 0.3,-0.8l33.5,-75.2c4.3,-9.7 8.6,-19.3 12.9,-29c0.4,-1.1 1.2,-2 2.3,-2.5c2.2,-1.1 4.8,-0.2 5.9,2c0,0.1 0.1,0.1 0.1,0.2c0.9,1.9 1.7,3.9 2.6,5.8l12.4,27.8C73,96 73.1,96.2 73.3,96.6z"/>
<path android:fillColor="@color/fog" android:pathData="M73.3,96.6c0.2,-0.4 0.3,-0.7 0.3,-0.9c7.4,-21.9 14.8,-43.7 22.2,-65.6c0.6,-1.6 1.6,-2.8 3.3,-3.2c2.3,-0.6 4.6,0.7 5.3,2.9c0.7,2.1 1.4,4.2 2.1,6.3l26,76.6c0.1,0.2 0.2,0.5 0.3,0.8c0.1,-0.2 0.3,-0.3 0.4,-0.5c4,-7.3 8.1,-14.6 12.1,-21.9c0.3,-0.6 0.6,-1.1 0.9,-1.7c0.8,-1.5 2.3,-2.4 3.9,-2.3c1.6,0 3.2,0.9 3.9,2.3c3,5.5 6.1,11 9.1,16.5l33,59.9c0.2,0.4 0.4,0.8 0.6,1.1c1.1,2.2 0.2,4.8 -2,5.9c-0.6,0.3 -1.2,0.4 -1.9,0.4c-0.3,0 -0.7,0 -1,0H8.1c-0.4,0 -0.8,0 -1.1,0c-2.4,-0.1 -4.3,-2.2 -4.2,-4.6c0,-0.4 0.1,-0.7 0.2,-1.1c0.1,-0.3 0.2,-0.6 0.3,-0.8l33.5,-75.2c4.3,-9.7 8.6,-19.3 12.9,-29c0.4,-1.1 1.2,-2 2.3,-2.5c2.2,-1.1 4.8,-0.2 5.9,2c0,0.1 0.1,0.1 0.1,0.2c0.9,1.9 1.7,3.9 2.6,5.8l12.4,27.8C73,96 73.1,96.2 73.3,96.6z"/>
</vector>
22 changes: 20 additions & 2 deletions app/src/main/res/layout/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

<org.mozilla.vrbrowser.ui.views.HoneycombSwitch
android:id="@+id/crashReportingSwitch"
Expand All @@ -116,7 +116,7 @@
style="?attr/honeycombButtonStyle"
android:layout_marginRight="10dp"
app:honeycombSwitchText="@string/settings_telemetry"
app:honeycombSwitchTextSize="@dimen/settings_main_button_text_width"/>
app:honeycombSwitchTextSize="@dimen/settings_main_button_text_width" />

<org.mozilla.vrbrowser.ui.views.HoneycombButton
android:id="@+id/environmentButton"
Expand Down Expand Up @@ -157,10 +157,28 @@
android:id="@+id/controllerOptionsButton"
style="?attr/honeycombButtonStyle"
android:layout_marginRight="10dp"
android:visibility="gone"
app:honeycombButtonIcon="@drawable/ic_settings_controlleroptions"
app:honeycombButtonText="@string/settings_controller_options"
app:honeycombButtonTextSize="@dimen/settings_main_button_text_width" />

<org.mozilla.vrbrowser.ui.views.HoneycombButton
android:id="@+id/controllerOptionsButtonOculus3dof"
style="?attr/honeycombButtonStyle"
android:layout_marginRight="10dp"
android:visibility="gone"
app:honeycombButtonIcon="@drawable/ic_settings_controlleroptions_oculusvr_3dof"
app:honeycombButtonText="@string/settings_controller_options"
app:honeycombButtonTextSize="@dimen/settings_main_button_text_width" />

<org.mozilla.vrbrowser.ui.views.HoneycombButton
android:id="@+id/controllerOptionsButtonOculus6dof"
style="?attr/honeycombButtonStyle"
android:layout_marginRight="10dp"
android:visibility="gone"
app:honeycombButtonIcon="@drawable/ic_settings_controlleroptions_oculusvr_6dof"
app:honeycombButtonText="@string/settings_controller_options"
app:honeycombButtonTextSize="@dimen/settings_main_button_text_width" />

<org.mozilla.vrbrowser.ui.views.HoneycombButton
android:id="@+id/reportButton"
Expand Down

0 comments on commit 931021d

Please sign in to comment.