title: Unwanted padding around buttons in dialog
body: <p><strong>The Problem:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/n0SZw.png" alt="Unwanted Padding"></p>
  
  <p>You can clearly see the padding around the button</p>
  
  <p><strong>The Code:</strong></p>
  
  <pre><code>public void startGameDialog(){
  
      Context context = GameBoardActivity.this;
  
      ContextThemeWrapper ctw = new ContextThemeWrapper(context, R.style.AppBaseTheme);
  
      AlertDialog.Builder startGameDialog = new AlertDialog.Builder(ctw);
      startGameDialog.setTitle(getResources().getString(R.string.whats_your_name));
  
      LinearLayout dialogLayout = new LinearLayout(context);
  
          LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
  
          dialogLayout.setOrientation(LinearLayout.VERTICAL);
  
          final EditText newName = new EditText(context);
          newName.setLayoutParams(params);
  
          newName.setText("");
  
          final Button submit = new Button(context);
          submit.setText(getString(R.string.done));
          submit.setLayoutParams(params);
  
      dialogLayout.addView(newName);
      dialogLayout.addView(submit);
  
      startGameDialog.setView(dialogLayout);
      final Dialog dialog = startGameDialog.create();
  
      OnClickListener onClick = new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              GameBoardActivity.NAME = newName.getText().toString();
              dialog.dismiss();
              setUpPlayers();
  
          }
      };
      submit.setOnClickListener(onClick);     
  
      dialog.show();
      dialog.setCancelable(false);        
  
  }
  </code></pre>
  
  <p><strong>Attempted solutions</strong> (Both failed):</p>
  
  <ol>
  <li><p>Using the builder <code>.create()</code> method to build to <code>AlertDialog</code> and setting <code>.setView(dialogLayout, 0, 0, 0, 0)</code>.</p></li>
  <li><p>Removing parent's padding by trying <code>ViewGroup parent = (ViewGroup) dialogLayout.getParent()</code> then trying <code>parent.setPadding(0, 0, 0, 0);</code> (This returned a <code>NullPointerException</code> error because you can't set padding for <code>Dialog</code> nor <code>AlertDialog</code>.</p></li>
  </ol>
  
  <p>Any other ideas!?</p>
  
  <p>Thanks in advance!</p>
  
  <p>JRad the Bad</p>