Index: remoting/android/java/src/org/chromium/chromoting/Desktop.java |
diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
index 4ad4324d816408f6fb351b04a96647f7a5e4ec69..62a84f7bef3ce51c1de1bdf3f4a4d3982fefebf2 100644 |
--- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
+++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
@@ -24,6 +24,7 @@ import android.view.MotionEvent; |
import android.view.View; |
import android.view.View.OnLayoutChangeListener; |
import android.view.View.OnTouchListener; |
+import android.view.ViewGroup; |
import android.view.inputmethod.InputMethodManager; |
import org.chromium.chromoting.cardboard.DesktopActivity; |
@@ -104,7 +105,11 @@ public class Desktop |
mToolbar = (Toolbar) findViewById(R.id.toolbar); |
setSupportActionBar(mToolbar); |
- DesktopView remoteHostDesktop = (DesktopView) findViewById(R.id.desktop_view); |
+ DesktopViewInterface remoteHostDesktop = |
+ mClient.getDisplay().createDesktopView(getApplicationContext()); |
Lambros
2016/07/08 02:13:41
When creating Views, it's important to use the act
Yuwei
2016/07/08 19:58:56
Done
|
+ remoteHostDesktop.setLayoutParams(new ViewGroup.LayoutParams( |
+ ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); |
+ ((ViewGroup) findViewById(R.id.desktop_view_placeholder)).addView((View) remoteHostDesktop); |
Lambros
2016/07/08 02:13:41
The cast to (View) is ugly, maybe indicates a desi
Yuwei
2016/07/08 19:58:56
Actually I have considered making it an abstract c
Lambros
2016/07/08 22:02:36
I think this is fine. As long as you are rendering
Yuwei
2016/07/08 23:07:54
This sounds like a better approach, but also requi
Yuwei
2016/07/08 23:35:53
CC zijiehe@. There is a discussion about making De
|
remoteHostDesktop.init(this, mClient); |
mSwitchToCardboardDesktopActivity = false; |
@@ -163,8 +168,6 @@ public class Desktop |
super.onStart(); |
mActivityLifecycleListener.onActivityStarted(this); |
mClient.enableVideoChannel(true); |
- DesktopView desktopView = (DesktopView) findViewById(R.id.desktop_view); |
Yuwei
2016/07/08 00:30:00
This logic is unnecessary since attachRedrawCallba
|
- desktopView.attachRedrawCallback(); |
mClient.getCapabilityManager().addListener(this); |
} |