+ // 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.
+