Upstream version 8.36.169.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / android / core_internal / src / org / xwalk / core / internal / XWalkLaunchScreenManager.java
index 67f26bb..4467121 100644 (file)
@@ -394,7 +394,6 @@ public class XWalkLaunchScreenManager
         Bitmap img = BitmapFactory.decodeResource(mActivity.getResources(), imgResId);
         if (img == null) return null;
 
-        // Create the 9-piece layout as spec defined.
         RelativeLayout root = new RelativeLayout(mActivity);
         root.setLayoutParams(new RelativeLayout.LayoutParams(
                 ViewGroup.LayoutParams.MATCH_PARENT,
@@ -402,6 +401,20 @@ public class XWalkLaunchScreenManager
         RelativeLayout.LayoutParams params;
         ImageView subImageView;
 
+        // If no border specified, display the foreground image centered horizontally and vertically.
+        if (borders.size() == 0) {
+            subImageView = new ImageView(mActivity);
+            subImageView.setImageBitmap(img);
+            params = new RelativeLayout.LayoutParams(
+                    RelativeLayout.LayoutParams.WRAP_CONTENT,
+                    RelativeLayout.LayoutParams.WRAP_CONTENT);
+            params.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
+            root.addView(subImageView, params);
+            return root;
+        }
+
+        // Create the 9-piece layout as spec defined.
+
         // Get Screen width and height.
         Display display = mActivity.getWindowManager().getDefaultDisplay();
         Point size = new Point();