Android Question "Like" Whatsapp Keyboard


Licensed User
This is a PREVIEW ALFA version of a Whatsapp "Like" keyboard.


Screenshot 1

Screenshot 2

Requiere this libraries:

-msEmoji (by DonManfred):
-FontAwesome (by NJDude):
-IME (by Erel):

You can DONATE them if you find this usefull.

The question is that the load of the grid of icons is very slow, and I tried:

-Reduce the size of the picteres
-Use an ImageView instead EmojiViewText

But its slow load. If anyone can contribute to speed the load, it might be a good keyboard.

SOURCE CODE - Click Here (> 4Mb)

And this is the part that load the images in a ScrollView

Sub PrecargaScrollView (ScrollViewTmp As ScrollView, Lista As List)

   Dim now As Long
   now = DateTime.Now
   Log("TIEMPO INICIO 1: " & DateTime.Time(now))

   Dim NumeroIconosFila As Int
   NumeroIconosFila = (100%x) / 45dip
   Dim NumeroFilas As Int
   NumeroFilas = (Lista.Size / NumeroIconosFila)

   ScrollViewTmp.Initialize(40dip * NumeroFilas)

   Dim i As Int = 0
   For x = 1 To NumeroFilas '+1 Falta retocar para que la última fila, si tiene 3 iconos p.ej., funcions.
     For y = 1 To NumeroIconosFila

       EmojiTextView1.Text = Lista.Get(i) & " "

       BotonTransparente.Color = Colors.Transparent

       BotonTransparente.Tag = Lista.Get(i)
       ScrollViewTmp.Color = Colors.White
       ScrollViewTmp.Panel.AddView(BotonTransparente, 45dip*(y-1) + 5dip, 40dip * (x-1) + 5dip, 40dip, 40dip)
       ScrollViewTmp.Panel.AddView(EmojiTextView1, 45dip*(y-1) + 5dip, 40dip * (x-1) + 5dip, 40dip, 40dip)
       EmojiTextView1.Height = 40dip : EmojiTextView1.Width = 40dip
       BotonTransparente.Width = 40dip : BotonTransparente.Height = 40dip

'       Imagen.Initialize("Imagen")
'       Dim Cad As String = Lista.Get(i)
'       ScrollViewTmp.Color = Colors.White
'       Imagen.Bitmap = CreateScaledBitmap(LoadBitmap(File.DirAssets, "imagenes/" & Cad.SubString2(1, Cad.Length -1) & ".png"), 35, 35, True)
'       ScrollViewTmp.Panel.AddView(Imagen, 45dip*(y-1) + 5dip, 40dip * (x-1) + 5dip, 40dip, 40dip)
'       Imagen.Tag = Lista.Get(i)
       i = i + 1


   now = DateTime.Now
   Log("TIEMPO FINAL 1: " & DateTime.Time(now))

End Sub



Licensed User
What is the size of the list and how long does it take to load them?
What device are you testing on?
I attached the source code in the post.

The list is about 900 elements ( 5 lists of 200 elements, aprox)

The total size of the images to load is about 4 Mb

I am testing in a Galaxy S5 Mini. Its a good device. ;)

The load time in this device is about 4 seconds. I know that are a lot of images, but when you open whatsapp, the load time is instantaneous.


Licensed User
Your source is in a language unfortunately I cannot follow with both comments and variable names not meaning anything to me.
I think you are loading too many images, 900 elements wont show at the same time. But again it should not be that slow.
TDS, I has only one comment in all the code and it's a bug. All is B4A. ;)


Licensed User
Whatsapp does load the icons in a recycle-grid-view. It does not load 900 images

I will use this TDS library of this thread with and XmlLayoutBuilder for not repeat the resources.

MSDynamicGridView :


Is the correct way?

I am autoresponding.

Yes, is the correct way. The keyboard loads very fast if I put the images in the MSDynamicGridView

Thanks to @thedesolatesoul
Last edited: