iamageo / BeautifulDialog

🌈 A Beautiful Dialog Library for Android 🗨️
Apache License 2.0
40 stars 6 forks source link

is there no way to hide cancel button ? #4

Closed IanLaFlair closed 2 years ago

iamageo commented 2 years ago

Hi @IanLaFlair, thanks for your problem! ❤

I updated the library to support your problem, now you can call .hideNegativeButton(hide = true) you must use version 1.0.2

//Simple example
  BeautifulDialog.build(this)
      .title("Title success", titleColor = R.color.black)
      .body("Description success", color = R.color.black)
      .type(type = BeautifulDialog.TYPE.SUCCESS)
      .position(BeautifulDialog.POSITIONS.CENTER)
      .onPositive("Confirm") {
          Toast.makeText(this, "confirm", Toast.LENGTH_SHORT).show()
      }
      .onNegative("Cancel") {
          Toast.makeText(this, "cancel", Toast.LENGTH_SHORT).show()
      }
      .hideNegativeButton(hide = true)

will have the following result

image

IanLaFlair commented 2 years ago

sorry, if i upgrade to 1.0.2, beautifuldialog turn into unresolved reference

iamageo commented 2 years ago

try this, I removed the release prefix:

implementation 'com.github.iamageo:beautiful-dialog:1.0.2'

see on Jitpack: https://jitpack.io/#iamageo/beautiful-dialog/1.0.2