title: How do I position a passwordToggleDrawable in android?
body: <p>The following link shows the main problem (<a href="https://i.stack.imgur.com/XhkqQ.jpg" rel="nofollow noreferrer">Link</a>)
  As you can see, there is overlap between the password visibility icon and the validation icon (when it dynamically appears). I want to know a simple way to position the icons so that they will work together, is that possible?</p>
  
  <p><strong>The password toggle</strong></p>
  
  <pre><code>    &lt;com.google.android.material.textfield.TextInputLayout
          android:id="@+id/textInputLayoutWifiPW"
          android:layout_width="600dp"
          android:layout_height="wrap_content"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/textInputLayoutWifiSSID"
          app:passwordToggleDrawable="@drawable/passwordtoggle"
          app:passwordToggleEnabled="true"
          app:passwordToggleTint="@color/md_blue_500"&gt;
  
          &lt;com.google.android.material.textfield.TextInputEditText
              android:id="@+id/password"
              android:layout_width="568dp"
              android:layout_height="wrap_content"
              android:layout_marginStart="16dp"
              android:layout_marginLeft="16dp"
              android:layout_marginTop="16dp"
              android:layout_marginEnd="8dp"
              android:layout_marginRight="8dp"
              android:layout_marginBottom="16dp"
  
              android:fontFamily="sans-serif"
              android:hint="@string/password"
              android:inputType="textPassword"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/SSID" /&gt;
  </code></pre>
  
  <p><strong>Validation methods</strong></p>
  
  <pre><code>private void validateWIFI(final Context context) {
          if (SSID.length() == 0 ) {
              dialogButtonTrueOrFalse(mDialog, false);
              SSID.setError(context.getString(R.string.error_ssid_empty));
          }else if (PWD.length() &gt; 0 &amp;&amp; PWD.length() &lt; 8) {
              dialogButtonTrueOrFalse(mDialog, false);
              PWD.setError(context.getString(R.string.error_pwd_length));
          }else {
              dialogButtonTrueOrFalse(mDialog,true);
          }
      }
      public void dialogButtonTrueOrFalse(AlertDialog mDialog, Boolean button){
          if (button){
              mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setClickable(true);
              mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
          }else if (!button){
              mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setClickable(false);
              mDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
          }
      }
  </code></pre>