Bug 1236232 - Only use root layout as snackbar parent if it exists (Webapps). r=mcomella draft
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 12 Jan 2016 12:27:02 +0100
changeset 320731 d3b88a6cf94a7b596a2523593786ab271b2dc15b
parent 320714 cb7c2921600c63de1595eb0ff24c47c208d41817
child 512819 3dee0e0583d3227cb5c7b7539164e948d510a17f
push id9291
push users.kaspari@gmail.com
push dateTue, 12 Jan 2016 11:29:48 +0000
reviewersmcomella
bugs1236232
milestone46.0a1
Bug 1236232 - Only use root layout as snackbar parent if it exists (Webapps). r=mcomella
mobile/android/base/java/org/mozilla/gecko/SnackbarHelper.java
--- a/mobile/android/base/java/org/mozilla/gecko/SnackbarHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/SnackbarHelper.java
@@ -127,14 +127,17 @@ public class SnackbarHelper {
     }
 
     /**
      * Find the best parent view to hold the Snackbar's view. The Snackbar implementation of the support
      * library will use this view to walk up the view tree to find an actual suitable parent (if needed).
      */
     private static View findBestParentView(Activity activity) {
         if (activity instanceof GeckoApp) {
-            return activity.findViewById(R.id.root_layout);
+            final View view = activity.findViewById(R.id.root_layout);
+            if (view != null) {
+                return view;
+            }
         }
 
         return activity.findViewById(android.R.id.content);
     }
 }