B4A Library msEmoji V1.0.0

msEmoji
Version:
1
  • EmojiEditText
    Fields:
    • ba As BA
    Methods:
    • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
    • 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)
    Properties:
    • Background As Drawable
    • Backgroundcolor As Int [write only]
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Tag As Object
    • Text As String
    • Textcolor As Int [write only]
    • Top As Int
    • Visible As Boolean
    • Width As Int
  • EmojiParser
    Methods:
    • GetEmojiDrawable (DrawableName As String) As Drawable
      Get a Drawable from the Application Resources.
      Returns Null if the Drawable is not found.
    • Initialize (EventName As String)
    • ListEmoji As List
    • demojizedText (text As String) As String
      Return the text with emoticons changed to android code
    • emojiText (text As String) As String
      Parse the text and change emoticons characters to chearsheet characters
      param text
      Input text to be parsed
      returns the Text parsed
  • EmojiTextView
    Fields:
    • ba As BA
    Methods:
    • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
    • 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)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Tag As Object
    • Text As String [write only]
    • Top As Int
    • Visible As Boolean
    • Width As Int
This is a wrapper for this Github project.

This Library comes basically with three Objects. All three of them are used in the Example.
EmojiParser, EmojiTextView and EmojiEditText

For the normal work you dont need the EmojiParser. It is only used in the example to get the list of all available Emojis

The Mainobjects are the other two. The EmojiTextview and the EmojiEditText
A Emoji always starts with a [ and ends with a ]. All chars between is the name of the Emoji.

This library is Donationware. You can download the library, you can test the library. But if you want to USE the library in your App you need to Donate for it.
Please click here to donate (You can donate any amount you want to donate for the library (or my work) :)


msEmoji001.png
msEmoji002.png


Due to the size of the needed resources (the example archive is 4mb in size) the Example can be downloaded from my Dropbox.

You can find a overview of all supported Emojis here.

B4X:
    Activity.LoadLayout("Layout1")
    lv.Clear
  Emoji.Initialize("")
    Dim emojilist As List = Emoji.ListEmoji
    For i = 0 To emojilist.Size-1
        Dim s As String = emojilist.Get(i)
        Dim d As BitmapDrawable = Emoji.GetEmojiDrawable(s)
        lv.AddTwoLinesAndBitmap2(s,"Type ["&s&"] to get this Image",d.Bitmap,"["&s&"]")
    Next
 
    lblEmoji.Text = "[de] [uk] [us] [wine_glass] [p1] [see_no_evil] [yellow_heart]"
    edtEmoji.Backgroundcolor = Colors.White
    edtEmoji.Text = "[de][uk][us] Donate much [dollar] [grin] [heart_eyes]"
    edtEmoji.Textcolor = Colors.Black
 

Attachments

  • libmsEmojiV1.0.0.zip
    37.5 KB · Views: 434
Last edited:

jotaele

Member
Licensed User
Longtime User
I was watching those threads a lot of time yesterday. :)

Like this?

maybe is IS in the lib but set to private... I only wrapped public methods... Will check later.

Are you looking for expose the private methods or you mean that is imposible to wrap this methods. I don't understand you. Sorry.

Yesterdayk, I was thinking about, and I tried to use Reflection, but was imposible to access this methods, events, ...

If you can't wrap them, I can use the iconic font and use a EditText with all the methods. Its the only option that I thinked.

The "whatsapp keyboard" is near to be finished but in black and white.

I will stay for your response before changing to a iconic font.

Thanks by you efforts.
 

jotaele

Member
Licensed User
Longtime User
I was watching those threads a lot of time yesterday. :)

Like this?



Are you looking for expose the private methods or you mean that is imposible to wrap this methods. I don't understand you. Sorry.

Yesterdayk, I was thinking about, and I tried to use Reflection, but was imposible to access this methods, events, ...

If you can't wrap them, I can use the iconic font and use a EditText with all the methods. Its the only option that I thinked.

The "whatsapp keyboard" is near to be finished but in black and white.

I will stay for your response before changing to a iconic font.

Thanks by you efforts.

From the thread:

https://www.b4x.com/android/forum/threads/wrapped-library-inheritance.54830/#post-345343

I will clean and then post the code of the keyboard.

Anyway, it's working, but don't put the icons in the correct position, only in the begining or a the end, but can help to some one.
 

jotaele

Member
Licensed User
Longtime User
From the thread:

https://www.b4x.com/android/forum/threads/wrapped-library-inheritance.54830/#post-345343

I will clean and then post the code of the keyboard.

Anyway, it's working, but don't put the icons in the correct position, only in the begining or a the end, but can help to some one.

Here is the link of the "Like Whatsapp Keyboard" that I tried to do.

It's only a test, but can help anyone.

https://drive.google.com/file/d/0B4cxOc_dZWIgbEY2WnNuMncwZkU/view?usp=sharing
 

Reids

Member
Licensed User
Longtime User
Hello this library is cool!!
but how I can add this emoji on the listview, text wont replaced with emoji when emoji was added in listview
 

Reids

Member
Licensed User
Longtime User
Yes I mean customlist view, the emoji won't appear too, text only displayed as [de] [uk] [us] [wine_glass] tag
wont replaced as image, I make sure label defined as emojitextview, and this emoji label has added to customlistview

Private lblEmoji As EmojiTextView

pnl.AddView(lblEmoji , 10dip, minHeight, sv.Width - 5dip, h1)
 

jotaele

Member
Licensed User
Longtime User
Yes I mean customlist view, the emoji won't appear too, text only displayed as [de] [uk] [us] [wine_glass] tag
wont replaced as image, I make sure label defined as emojitextview, and this emoji label has added to customlistview

Private lblEmoji As EmojiTextView

pnl.AddView(lblEmoji , 10dip, minHeight, sv.Width - 5dip, h1)

Paste the code of your project.
 

DonManfred

Expert
Licensed User
Longtime User
Yes I mean customlist view, the emoji won't appear too, text only displayed as [de] [uk] [us] [wine_glass] tag
wont replaced as image, I make sure label defined as emojitextview, and this emoji label has added to customlistview

https://www.dropbox.com/s/krblaweyi5pio4j/emoji_clv.zip?dl=0

emoji_clv001.png


The first item is placed in designer and the layout is loaded to a panel and the panel added to the clv.
The second item is added to a panel by code and the panel is added to the clv
 

Reids

Member
Licensed User
Longtime User
Here I attached the file, we working on line 179 at customlistview module
I do the same as example you attached but why it still not replaced as image :(
therefore I forget to tell please add more properties like :
-TextColor
-Gravity
to the emojitextview :D
Thankyou :)

ps : attached file doesn't contain of image smilies due my lack of internet connection here :(
 

Attachments

  • chatemojiproblem.zip
    64.3 KB · Views: 147

DonManfred

Expert
Licensed User
Longtime User
ps : attached file doesn't contain of image smilies due my lack of internet connection here
It is also missing the line to INCLUDE the images to your app.

I uses your example. Added the resource folder AND the additionalres command
B4X:
#AdditionalRes: ..\Resources

It looks like this
reidsemoji001.png
 

Reids

Member
Licensed User
Longtime User
How stupid, I'm missing that piece line of code
now it work! sorry :'( ahahaha
This is great library!
please add more properties like TextColor & Gravity, the textcolor properties is most usefull properties
 

jotaele

Member
Licensed User
Longtime User
Hi another time @DonManfred

Are you added more properties to EmojiTextView, like Gravity, ...? Are you thinking in release more versions with the standard methods of the standard EditText, Events, or this is the final version?
 

DonManfred

Expert
Licensed User
Longtime User
Are you added more properties to EmojiTextView, like Gravity, ...?
Not as yet. Did not have the time the last days/weeks and still have not much time in near future
Are you thinking in release more versions with the standard methods of the standard EditText, Events, or this is the final version?
I don´t think it is the final version... But: as the wrapping of libraries for b4a is kind of a hobby for me sometimes i do not have the right mood to work on a specific wrapper.

I´ll do more on it when i have time; just keep reminding me ;)
 

Reids

Member
Licensed User
Longtime User
Is it possible to replace text like smilies one using () instead [] forexample
B4X:
:D or :)
instead [smile]
 
Top