| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chromoting.cardboard; | 5 package org.chromium.chromoting.cardboard; |
| 6 | 6 |
| 7 import android.content.Intent; | 7 import android.content.Intent; |
| 8 import android.graphics.PointF; | 8 import android.graphics.PointF; |
| 9 import android.os.Bundle; | 9 import android.os.Bundle; |
| 10 import android.speech.RecognitionListener; | 10 import android.speech.RecognitionListener; |
| 11 import android.speech.RecognizerIntent; | 11 import android.speech.RecognizerIntent; |
| 12 import android.speech.SpeechRecognizer; | 12 import android.speech.SpeechRecognizer; |
| 13 | 13 |
| 14 import com.google.vrtoolkit.cardboard.CardboardActivity; | 14 import com.google.vrtoolkit.cardboard.CardboardActivity; |
| 15 import com.google.vrtoolkit.cardboard.CardboardView; | 15 import com.google.vrtoolkit.cardboard.CardboardView; |
| 16 | 16 |
| 17 import org.chromium.chromoting.InputStub; |
| 17 import org.chromium.chromoting.R; | 18 import org.chromium.chromoting.R; |
| 18 import org.chromium.chromoting.TouchInputHandler; | |
| 19 import org.chromium.chromoting.jni.Client; | 19 import org.chromium.chromoting.jni.Client; |
| 20 | 20 |
| 21 import java.util.ArrayList; | 21 import java.util.ArrayList; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Virtual desktop activity for Cardboard. | 24 * Virtual desktop activity for Cardboard. |
| 25 */ | 25 */ |
| 26 public class DesktopActivity extends CardboardActivity { | 26 public class DesktopActivity extends CardboardActivity { |
| 27 // Flag to indicate whether the current activity is going to switch to norma
l | 27 // Flag to indicate whether the current activity is going to switch to norma
l |
| 28 // desktop activity. | 28 // desktop activity. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 mRenderer.moveAwayFromDesktop(); | 73 mRenderer.moveAwayFromDesktop(); |
| 74 break; | 74 break; |
| 75 } | 75 } |
| 76 } else { | 76 } else { |
| 77 mRenderer.setMenuBarVisible(false); | 77 mRenderer.setMenuBarVisible(false); |
| 78 } | 78 } |
| 79 } else { | 79 } else { |
| 80 if (mRenderer.isLookingAtDesktop()) { | 80 if (mRenderer.isLookingAtDesktop()) { |
| 81 PointF coordinates = mRenderer.getMouseCoordinates(); | 81 PointF coordinates = mRenderer.getMouseCoordinates(); |
| 82 mClient.sendMouseEvent((int) coordinates.x, (int) coordinates.y, | 82 mClient.sendMouseEvent((int) coordinates.x, (int) coordinates.y, |
| 83 TouchInputHandler.BUTTON_LEFT, true); | 83 InputStub.BUTTON_LEFT, true); |
| 84 mClient.sendMouseEvent((int) coordinates.x, (int) coordinates.y, | 84 mClient.sendMouseEvent((int) coordinates.x, (int) coordinates.y, |
| 85 TouchInputHandler.BUTTON_LEFT, false); | 85 InputStub.BUTTON_LEFT, false); |
| 86 } else { | 86 } else { |
| 87 if (mRenderer.isLookingFarawayFromDesktop()) { | 87 if (mRenderer.isLookingFarawayFromDesktop()) { |
| 88 getCardboardView().resetHeadTracker(); | 88 getCardboardView().resetHeadTracker(); |
| 89 } else { | 89 } else { |
| 90 mRenderer.setMenuBarVisible(true); | 90 mRenderer.setMenuBarVisible(true); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| 197 public void onPartialResults(Bundle partialResults) { | 197 public void onPartialResults(Bundle partialResults) { |
| 198 } | 198 } |
| 199 | 199 |
| 200 public void onEvent(int eventType, Bundle params) { | 200 public void onEvent(int eventType, Bundle params) { |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 } | 203 } |
| OLD | NEW |