Bug 994456 - Add a preview surface for webrtc in webapps. r=gcp, a=sledru
authorWes Johnston <wjohnston@mozilla.com>
Fri, 11 Apr 2014 14:19:12 -0700
changeset 183745 4dd58172981ccebd2e663ec0862d6ffbc60adb59
parent 183744 13a97e892449319962dda00edfbf528e2ef01e5a
child 183746 756b592c869f3767a4bb5fbc6458202550163e92
push id3467
push userryanvm@gmail.com
push dateMon, 14 Apr 2014 14:29:30 +0000
treeherdermozilla-beta@756b592c869f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp, sledru
bugs994456
milestone29.0
Bug 994456 - Add a preview surface for webrtc in webapps. r=gcp, a=sledru
mobile/android/base/GeckoApp.java
mobile/android/base/resources/layout/gecko_app.xml
mobile/android/base/resources/layout/shared_ui_components.xml
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1774,28 +1774,28 @@ public abstract class GeckoApp
         // Try to make it fully transparent.
         if (mCameraView instanceof SurfaceView) {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                 mCameraView.setAlpha(0.0f);
             }
         } else if (mCameraView instanceof TextureView) {
             mCameraView.setAlpha(0.0f);
         }
-        RelativeLayout mCameraLayout = (RelativeLayout) findViewById(R.id.camera_layout);
+        ViewGroup mCameraLayout = (ViewGroup) findViewById(R.id.camera_layout);
         // Some phones (eg. nexus S) need at least a 8x16 preview size
         mCameraLayout.addView(mCameraView,
                               new AbsoluteLayout.LayoutParams(8, 16, 0, 0));
     }
 
     public void disableCameraView() {
         if (mCameraOrientationEventListener != null) {
             mCameraOrientationEventListener.disable();
             mCameraOrientationEventListener = null;
         }
-        RelativeLayout mCameraLayout = (RelativeLayout) findViewById(R.id.camera_layout);
+        ViewGroup mCameraLayout = (ViewGroup) findViewById(R.id.camera_layout);
         mCameraLayout.removeView(mCameraView);
     }
 
     public String getDefaultUAString() {
         return HardwareUtils.isTablet() ? AppConstants.USER_AGENT_FENNEC_TABLET :
                                           AppConstants.USER_AGENT_FENNEC_MOBILE;
     }
 
--- a/mobile/android/base/resources/layout/gecko_app.xml
+++ b/mobile/android/base/resources/layout/gecko_app.xml
@@ -60,23 +60,16 @@
 
         <org.mozilla.gecko.MediaCastingBar android:id="@+id/media_casting"
                                            android:layout_width="fill_parent"
                                            android:layout_height="wrap_content"
                                            android:layout_alignParentBottom="true"
                                            style="@style/FindBar"
                                            android:visibility="gone"/>
 
-        <RelativeLayout android:id="@+id/camera_layout"
-                        android:layout_height="wrap_content"
-                        android:layout_width="wrap_content"
-                        android:layout_alignParentRight="true"
-                        android:layout_alignParentBottom="true">
-        </RelativeLayout>
-
         <FrameLayout android:id="@+id/search_container"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent"
                      android:layout_below="@+id/browser_actionbar"
                      android:background="@android:color/white"
                      android:visibility="invisible"/>
 
         <!-- When focus is cleared from from BrowserToolbar's EditText to
--- a/mobile/android/base/resources/layout/shared_ui_components.xml
+++ b/mobile/android/base/resources/layout/shared_ui_components.xml
@@ -21,9 +21,16 @@
 
     <org.mozilla.gecko.FormAssistPopup android:id="@+id/form_assist_popup"
                                        android:layout_width="fill_parent"
                                        android:layout_height="fill_parent"
                                        android:visibility="gone"/>
 
     <include layout="@layout/text_selection_handles"/>
 
+    <FrameLayout android:id="@+id/camera_layout"
+                 android:layout_height="wrap_content"
+                 android:layout_width="wrap_content"
+                 android:layout_alignParentRight="true"
+                 android:layout_alignParentBottom="true">
+    </FrameLayout>
+
 </merge>