Skip to content

Commit

Permalink
removed jcenter as it is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
samwelnyandoro committed Jun 2, 2024
1 parent 10d022a commit d46b042
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void onCreate(Bundle savedInstanceState) {
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.basic_test) {// default title "Here's a message!"
if (id == R.id.basic_test) {
SweetAlertDialog sd = new SweetAlertDialog(this);
sd.setCancelable(true);
sd.setCanceledOnTouchOutside(true);
Expand All @@ -53,7 +53,6 @@ public void onClick(View v) {
.setContentText("Won't be able to recover this file!")
.setConfirmText("Yes,delete it!")
.setConfirmClickListener(sDialog -> {
// reuse previous dialog instance
sDialog.setTitleText("Deleted!")
.setContentText("Your imaginary file has been deleted!")
.setConfirmText("OK")
Expand All @@ -69,22 +68,13 @@ public void onClick(View v) {
.setConfirmText("Yes,delete it!")
.showCancelButton(true)
.setCancelClickListener(sDialog -> {
// reuse previous dialog instance, keep widget user state, reset them if you need
sDialog.setTitleText("Cancelled!")
.setContentText("Your imaginary file is safe :)")
.setConfirmText("OK")
.showCancelButton(false)
.setCancelClickListener(null)
.setConfirmClickListener(null)
.changeAlertType(SweetAlertDialog.ERROR_TYPE);

// or you can new a SweetAlertDialog to show
/* sDialog.dismiss();
new SweetAlertDialog(SampleActivity.this, SweetAlertDialog.ERROR_TYPE)
.setTitleText("Cancelled!")
.setContentText("Your imaginary file is safe :)")
.setConfirmText("OK")
.show();*/
})
.setConfirmClickListener(sDialog -> sDialog.setTitleText("Deleted!")
.setContentText("Your imaginary file has been deleted!")
Expand Down

0 comments on commit d46b042

Please sign in to comment.