ColorDialog icon indicating copy to clipboard operation
ColorDialog copied to clipboard

Cancel Button is not proper aligned if there is no image assigned

Open Rahul1d opened this issue 4 years ago • 1 comments

If there is no image provided in ColorDialog, Cancel button is not aligned properly :

 ColorDialog dialog = new ColorDialog(this);
        dialog.setTitle(getString(R.string.operation));
        dialog.setAnimationEnable(true);
        dialog.setAnimationIn(getInAnimationTest(this));
        dialog.setAnimationOut(getOutAnimationTest(this));
//        dialog.setContentImage(getResources().getDrawable(R.mipmap.sample_img));  //REMOVED IMAGE
        dialog.setPositiveListener(getString(R.string.delete), new ColorDialog.OnPositiveListener() {
            @Override
            public void onClick(ColorDialog dialog) {
                Toast.makeText(MainActivity.this, dialog.getPositiveText().toString(), Toast.LENGTH_SHORT).show();
            }
        })
        .setNegativeListener(getString(R.string.cancel), new ColorDialog.OnNegativeListener() {
            @Override
            public void onClick(ColorDialog dialog) {
                Toast.makeText(MainActivity.this, dialog.getNegativeText().toString(), Toast.LENGTH_SHORT).show();
                dialog.dismiss();
            }
        }).show();

Cancel Button Not Aligned

Rahul1d avatar Apr 01 '20 14:04 Rahul1d

This issue is solved if layout of positive & negative button is set to "match_parent". See below: I have created a pull request for this

Cancel Button Algned

Rahul1d avatar Apr 01 '20 15:04 Rahul1d