B4A Library StickerView2

This is a wrap for this Github project. This is not a Version 2. It is a totally different Library which i wrapped here then the other StickerView i already wrapped.

Thanx to @susu for "motivating" me to write a second wrap for a StickerView. :D

StickerView2
Author:
DonManfred (wrapper)
Version: 1.02
  • BubbleInputDialog
    Events:
    • onComplete (Text As String)
    Methods:
    • Initialize (EventName As String)
    • IsInitialized As Boolean
    • dismiss
    • show
    Properties:
    • BubbleTextView As BubbleTextView [write only]
  • BubbleTextView
    Events:
    • onClick ( As )
    • onDeleteClick ( As )
    • onEdit ( As )
    • onTop ( As )
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • calculate (model As BubblePropertyModel) As BubblePropertyModel
    • setBitmap (bitmap As Bitmap, model As BubblePropertyModel)
    • setImageResource (resId As Int, model As BubblePropertyModel)
    Properties:
    • Background As Drawable
    • Bitmap As Bitmap [write only]
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • InEdit As Boolean [write only]
    • Left As Int
    • Parent As Object [read only]
    • Tag As Object
    • Text As String
    • Top As Int
    • Visible As Boolean
    • Width As Int
  • StickerView
    Events:
    • onDeleteClick ( As )
    • onEdit ( As )
    • onTop ( As )
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • calculate (model As StickerPropertyModel) As StickerPropertyModel
    Properties:
    • Background As Drawable
    • Bitmap As Bitmap [write only]
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • ImageResource As String [write only]
    • InEdit As Boolean [write only]
    • Left As Int
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int


You can download the Example here.

stickerGIF.gif


If you want to donate for my work building the wrapper you can do it here:
 

Attachments

  • StickerView2V1.0.2.zip
    36.8 KB · Views: 556

DonManfred

Expert
Licensed User
Longtime User
It IS firing

LogCat connected to: 9885e6514556383552
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
lib:Raising.. sticker_ondeleteclick()
lib:Raising.. sticker_onedit()
lib:Raising.. sticker_onedit()
** Activity (main) Pause, UserClosed = true **
 
Last edited:

tuhatinhvn

Active Member
Licensed User
Longtime User
anyone can give example about BubbleInputDialog and BubbleTextView
and how to combine all sticke into a bitmap???
 

tuhatinhvn

Active Member
Licensed User
Longtime User
anyone can help me how to show BubbleInputDialog ????
And how to change color of text ??
Only back color text in default?

B4X:
    Dim edittextok As BubbleInputDialog
Dim a As StickerView
Dim b1 As BubbleTextView


Dim cat As Bitmap

    cat.Initialize(File.DirAssets,"a.jpg")

    a.Initialize("Sticker")
    a.Bitmap = cat

    Activity.AddView(a,0,0,100%x,100%y)

    b1.Initialize("text")
    b1.Bitmap=cat
    b1.Text="MY TEXT" 'how to change color of this text???
  Activity.AddView(b1,0,0,100%x,100%y)
    edittextok.Initialize("phong")
    edittextok.BubbleTextView=b1
edittextok.show

It is error android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
at android.view.ViewRootImpl.setView(ViewRootImpl.java:593)
 
Last edited:

ykucuk

Well-Known Member
Licensed User
Longtime User
anyone can help me how to show BubbleInputDialog ????
And how to change color of text ??
Only back color text in default?

B4X:
    Dim edittextok As BubbleInputDialog
Dim a As StickerView
Dim b1 As BubbleTextView


Dim cat As Bitmap

    cat.Initialize(File.DirAssets,"a.jpg")

    a.Initialize("Sticker")
    a.Bitmap = cat

    Activity.AddView(a,0,0,100%x,100%y)

    b1.Initialize("text")
    b1.Bitmap=cat
    b1.Text="MY TEXT" 'how to change color of this text???
  Activity.AddView(b1,0,0,100%x,100%y)
    edittextok.Initialize("phong")
    edittextok.BubbleTextView=b1
edittextok.show

It is error android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
at android.view.ViewRootImpl.setView(ViewRootImpl.java:593)
any news about solution this problem?
 

demasi

Active Member
Licensed User
Longtime User
hello @DonManfred I'm trying do download your example above, but it was possibly deleted. Could you please post it again? I'm trying to use your library but it seams it does not work in the new versions of the IDE. As some functions are missing in the view, like the onClick event, can you post the java code?

PS: to make you motivated I sent you a little donation. :) thank you for your help

this error happens when I try to load the layout, where I have added a stickerview.

this is the error:

at com.example.abner.stickerdemo.view.BubbleTextView.<init>(BubbleTextView.java:109)
at de.donmanfred.BubbleTextViewWrapper._initialize(BubbleTextViewWrapper.java:68)
... 21 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 31 (Main)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at br.demasi.sticker.main._activity_create(main.java:396)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
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 br.demasi.sticker.main.afterFirstLayout(main.java:105)
at br.demasi.sticker.main.access$000(main.java:17)
at br.demasi.sticker.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
 
Last edited:
Top