B4A Library toasty lib

I want to share my first b4a lib.This is from github:https://github.com/GrenderG/Toasty
and i have made some changes.

how to use:
1. copy all the addRes folders to your project folder,and add #AdditionalRes:addRes-path in your project,like this:#AdditionalRes:..\addRes
2. copy the lib files to B4A Libraries.
3. there are five types toasty:success,error,info,warning,normal.
4. there is libtoastyconfig class,you can change some parameters,and then apply.

Have fun.
collage.png
 

Attachments

  • libtoasty.zip
    6.8 KB · Views: 211
  • toastyExample.zip
    32.1 KB · Views: 210
Last edited:

DonManfred

Expert
Licensed User
Longtime User
1. copy all the res\drawable folders,layout and values to your project res folder,and set all to READONLY.
the correct way is to create a new Folder in the projectdir with the same folderstructure

add
B4X:
#additionalres: ..\yourresfoldername
to your project to add a reference to this resourcefolder.
Note that files in this Folders do not need to be READONLY
 

rkxo

Active Member
Licensed User
Longtime User
hi,
i get error
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:225)
at android.content.res.Resources.getDrawableForDensity(Resources.java:887)
at android.content.res.Resources.getDrawable(Resources.java:827)
at android.content.Context.getDrawable(Context.java:626)
at com.cary.ToastyUtils.getDrawable(ToastyUtils.java:56)
at com.cary.Toasty.info(Toasty.java:106)
at com.cary.Toasty.info(Toasty.java:101)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:6597)
at android.view.View.performClickInternal(View.java:6574)
at android.view.View.access$3100(View.java:778)
at android.view.View$PerformClick.run(View.java:25885)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

thanks
 

carycai

Member
Licensed User
Longtime User
the correct way is to create a new Folder in the projectdir with the same folderstructure

add
B4X:
#additionalres: ..\yourresfoldername
to your project to add a reference to this resourcefolder.
Note that files in this Folders do not need to be READONLY
got.I have changed the example.Thank you.
 

carycai

Member
Licensed User
Longtime User
hi,
i get error


thanks
I modified the example,you can download and try again.Please set the res path with this command:
1. copy all the addRes folders to your project folder,and add #AdditionalRes:addRes-path in your project,like this:#AdditionalRes:..\addRes
 

DonManfred

Expert
Licensed User
Longtime User
1. copy all the addRes folders to your project folder,and add #AdditionalRes:addRes-path in your project,like this:#AdditionalRes:..\addRes
Note that "Projects exported with FILE Export as ZIP" does not contains any additionalres folders! You need to provide these res-folder(s) in an additional ZIP or manually add them to the project-export zip before uploading.

None of the uploaded ZIPs from you contains any res-folder
 

carycai

Member
Licensed User
Longtime User
Note that "Projects exported with FILE Export as ZIP" does not contains any additionalres folders! You need to provide these res-folder(s) in an additional ZIP or manually add them to the project-export zip before uploading.

None of the uploaded ZIPs from you contains any res-folder
;)I uploaded again.
 
Top