title: Unwanted spacing between android viewgroups added programmatically
body: <p>I'm adding a <code>RelativeLayout</code> in a <code>FrameLayout</code> ( added in xml ) and I attach a <code>LinearLayout</code> in this RelativeLayout.</p>
  
  <p>The problem is I get an unwanted left/right spacing/padding between the RelativeLayout and its child LinearLayout as you can see here from the uiautomator dump.
  The weird thing is that spacing is <strong>always</strong> 11 pixels from each side tested on emulator N5, N4, N7 images and Moto G and N4 devices. 
  Thank you</p>
  
  <p><img src="https://i.stack.imgur.com/tNz1S.png" alt="enter image description here"></p>
  
  <p>The code is :</p>
  
  <pre><code>       rlBottomBarContainer = new RelativeLayout(this);
      rlBottomBarContainer.setId(R.id.bottomBarContainer);
      rlBottomBarContainer.setClipToPadding(false);
      rlBottomBarContainer.setClipChildren(false);
      rlBottomBarContainer.setBackground(getResources().getDrawable(R.drawable.bara));
  
      int topMargin = whiteTowerContainerHeight /2 + tower_height/2 + 100;
      int containerHeight = whiteTowerContainerHeight - topMargin;
      FrameLayout.LayoutParams containerParams = new FrameLayout.LayoutParams(
              FrameLayout.LayoutParams.MATCH_PARENT,
               containerHeight);
      containerParams.topMargin = topMargin;
  
      rlBottomBarContainer.setLayoutParams(containerParams);
      frameLayoutRoot.addView(rlBottomBarContainer);     // parentLayout
  
      llBottomBarContainer = new LinearLayout(this);
      llBottomBarContainer.setId(R.id.upper_bottombar_ID);
      llBottomBarContainer.setClipChildren(false);
      llBottomBarContainer.setClipToPadding(false);
      llBottomBarContainer.setBackgroundColor(Color.parseColor("#00FFFFFF"));
      llBottomBarContainer.setOrientation(LinearLayout.HORIZONTAL);
  
      RelativeLayout.LayoutParams bottomBarParams = new RelativeLayout.LayoutParams(
              RelativeLayout.LayoutParams.MATCH_PARENT,
               getBottomBarTextSize());
  
      llBottomBarContainer.setLayoutParams(bottomBarParams);
      rlBottomBarContainer.addView(llBottomBarContainer);
  </code></pre>
  
  <p>As you can see from the code the <code>LinearLayout</code> is added with match_parent for the width. RelativeLayout width is from 0 to 720px but LinearLayout is from 11 to 709pixels.</p>