B4A Library SweetAlertDialog

DonManfred

Expert
Licensed User
Longtime User
android.content.res.Resources$NotFoundException: Resource ID #0x0
You did forgot to add the additionalres lines? Or the res folders???
See Example-Code...

The res-Folders are in the example zip.
The #additionalres lines are in the project-code too.

Make sure to use them
 

Jaco vd Walt

Member
Licensed User
Longtime User
Thank you for a great lib / wrap. I use it as standard with all my apps. I was wondering if someone might have had the following scenario : Whenever the wait wheel is turning (Progress Type), I want to prevent the user from pressing the back button and in effect canceling the dialog. I tried catching the back key, but it is ignored since sweetalert consumes the event. I dont think it is possible, was just wondering

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
How to use the ProgressHelper? Could you
explain it please?
- You should always start a new thread for your questions.
- See the example in #1. It is using it and showing how you can update the progress. It is using a timer but you can implement your own progress for sure.
 
Last edited:

BarryW

Active Member
Licensed User
Longtime User
????? WHAT exactly is the question?
Additionally you should ALWAYS create a new thread for any question you have.

B4X:
Sweet.Initialize("Sweet")
Sweet.AlertType = Sweet.TypeInfo

'---------------------- OR 

Sweet.Initialize("Sweet")
Sweet.AlertType = Sweet.TypeConfirmation

Like that
 

SMR

New Member
Hi dear,
Please Update Lib by below feature:
1- Replace CharSequence instead of string for (message & title & buttons)
2- add text size feature
3- add html text for message & title
4- can add custom view(panel) instead of message

thanks
 

Nestor Castro Jr

Member
Licensed User
Hello there,

I made a very simple example to explain my problem. In this code, I show one alert every time that user clicks on Activity. It works in the first time, but in the second time, the app freezes and do not show the alert box.

Sample:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

'
' WARNING!!!!
' The order of the following #AdditionalRes-lines
' must be exact like this
#AdditionalRes: ..\res.MaterialIshProgress
#AdditionalRes: ..\res.SweetAlertDialog

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim sweet As SweetAlertDialog
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    sweet.Initialize("Alert")
    sweet.AlertType = sweet.TypeWarning
    
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Click
    sweet.showCancelButton(True).showContentText(True).withCancelText("Not yet").withConfirmText("Yo man").withContentText("Bla bla bla bla").withTitleText("DonManfred present").show   
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Alert_onCancel()   
    Log($"Alert_onCancel()"$)
    sweet.AlertType = sweet.TypeError
    'sweet.withContentText("BLA bla BLA bla BLA")
    sweet.dismissWithAnimation
End Sub

Sub Alert_onConfirm()   
    Log($"Alert_onConfirm()"$)
    
    sweet.dismissWithAnimation
End Sub
 

mangojack

Well-Known Member
Licensed User
Longtime User
@Nestor Castro Jr , Please do not make duplicate posts. Your issue has been solved here...
 

Nestor Castro Jr

Member
Licensed User
Sorry! I only did this because I had no answer to my question in Library Forum for one week.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…