Android Dialog 客製化 自製化 跳出 對話框

public void btn_DialogEditText(View view) {
    

    final Dialog alertDialog = new Dialog(this);
    alertDialog.setTitle("請輸入標題");
    alertDialog.setContentView(R.layout.alertdialog_use);
    alertDialog.setCancelable(false);
    //FindViews
    final Button btnMinus = alertDialog.findViewById(R.id.button2);
    final Button btnPlus = alertDialog.findViewById(R.id.button3);
    final Button btnEnter = alertDialog.findViewById(R.id.button4);
    final Button btnCancel = alertDialog.findViewById(R.id.button5);
    final EditText editText =alertDialog.findViewById(R.id.editText1);
    btnMinus.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            editText.setText(String.valueOf(Integer.parseInt(editText.getText().toString())-1));
        }
    });
    btnPlus.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            editText.setText(String.valueOf(Integer.parseInt(editText.getText().toString())+1));
        }
    });
    btnEnter.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            Toast.makeText(getApplicationContext(),editText.getText().toString(),Toast.LENGTH_SHORT).show();
            alertDialog.dismiss(); //關閉客製化Dialog
        }
    });
    btnCancel.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            alertDialog.dismiss(); //關閉客製化Dialog
        }
    });
    alertDialog.show();


}

客製化View
alertdialog_use.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <Button
        android:id="@+id/button2"
        android:layout_width="50dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp"
        android:text="–"
        app:layout_constraintEnd_toStartOf="@+id/editText1"
        app:layout_constraintTop_toTopOf="@+id/editText1" />

    <Button
        android:id="@+id/button3"
        android:layout_width="50dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="24dp"
        android:layout_marginTop="60dp"
        android:text="+"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="60dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp"
        android:ems="10"
        android:inputType="number"
        android:text="0"
        android:textAlignment="center"
        android:textSize="20dp"
        app:layout_constraintEnd_toStartOf="@+id/button3"
        app:layout_constraintTop_toTopOf="@+id/button3" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="32dp"
        android:layout_marginTop="16dp"
        android:text="TextView"
        android:textSize="20dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/button4"
        android:layout_width="70dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginTop="16dp"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        android:text="確定"
        android:textColor="@color/colorAccent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/button3" />

    <Button
        android:id="@+id/button5"
        android:layout_width="70dp"
        android:layout_height="wrap_content"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        android:text="取消"
        android:textColor="@color/colorAccent"
        app:layout_constraintEnd_toStartOf="@+id/button4"
        app:layout_constraintTop_toTopOf="@+id/button4" />
</android.support.constraint.ConstraintLayout>