Skip to content

Commit

Permalink
Fix video projection menu position Media Controls (#1927)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Oct 7, 2019
1 parent dc39a84 commit 860995b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Expand Up @@ -154,6 +154,7 @@ public void run() {
private AudioManager mAudioManager;
private Widget mActiveDialog;
private Set<String> mPoorPerformanceWhiteList;
private float mCurrentCylinderDensity = 0;

private boolean callOnAudioManager(Consumer<AudioManager> fn) {
if (mAudioManager == null) {
Expand Down Expand Up @@ -1358,12 +1359,18 @@ public void setCylinderDensity(final float aDensity) {
if (mWindows != null && aDensity == 0.0f && mWindows.getWindowsCount() > 1) {
return;
}
mCurrentCylinderDensity = aDensity;
queueRunnable(() -> setCylinderDensityNative(aDensity));
if (mWindows != null) {
mWindows.updateCurvedMode(false);
}
}

@Override
public float getCylinderDensity() {
return mCurrentCylinderDensity;
}

@Override
public void setCPULevel(int aCPULevel) {
queueRunnable(() -> setCPULevelNative(aCPULevel));
Expand Down
Expand Up @@ -106,6 +106,11 @@ private void initialize(Context aContext) {
placement.worldWidth = 0.5f;
placement.parentAnchorX = 0.65f;
placement.parentAnchorY = 0.4f;
placement.cylinderMapRadius = 0.0f;
if (mWidgetManager.getCylinderDensity() > 0) {
placement.rotationAxisY = 1.0f;
placement.rotation = (float) Math.toRadians(-7);
}
mProjectionMenu.getPlacement().visible = !mProjectionMenu.getPlacement().visible;
mWidgetManager.updateWidget(mProjectionMenu);
});
Expand Down
Expand Up @@ -69,6 +69,7 @@ interface WorldClickListener {
void hideVRVideo();
void resetUIYaw();
void setCylinderDensity(float aDensity);
float getCylinderDensity();
void setCPULevel(@VRBrowserActivity.CPULevelFlags int aCPULevel);
void addFocusChangeListener(@NonNull FocusChangeListener aListener);
void removeFocusChangeListener(@NonNull FocusChangeListener aListener);
Expand Down

0 comments on commit 860995b

Please sign in to comment.