B4A Library Iconify (Button, Label, Togglebutton, Toast with IconFont Icons)

Mark Hollingworth

Member
Licensed User
Longtime User
Great Lib, not sure if I have missed something but how do you center text in the IconTextView? Is it possible?

Thanks,
 

Mark Hollingworth

Member
Licensed User
Longtime User
Should we be able to access the Down and Up events for the IconButton?

(suddenly I am finding many more uses for this library )
 

devpialkt

Member
Licensed User
Longtime User



confused .. which the last library update (Iconify.jar)

too many zip ..
 

DonManfred

Expert
Licensed User
Longtime User
The most are updates... just use the newest one...


You need:
- IconifyEx.zip (The Example)
- IconifyV2.22.zip (the libfiles; put them all in additional libs)
- IconifyFonts1.zip (fontfiles. put them all in additional libs)
- IconifyFonst2.zip (more fontfiles. put them all in additional libs)
 

devpialkt

Member
Licensed User
Longtime User

problem here :
conflict ???

 

inakigarm

Well-Known Member
Licensed User
Longtime User
@devpialkt, it seems that new version of library has new methods on some objects (you can see it on IDE help as you write the code)

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    icfy.Initialize()
    Entypo.Initialize
    icfy.with(Entypo)

    FontAwesome.Initialize
    icfy.with(FontAwesome)

    Ionicons.Initialize
    icfy.with(Ionicons)

    MaterialCommunity.Initialize
    icfy.with(MaterialCommunity)

    Material.Initialize
    icfy.with(Material)

    Meteocons.Initialize
    icfy.with(Meteocons)

    SimpleLineIcons.Initialize
    icfy.with(SimpleLineIcons)

    Typicons.Initialize
    icfy.with(Typicons)

    Weathericons.Initialize
    icfy.with(Weathericons)




    Activity.LoadLayout("Layout1")

    IconButton1.Text = "I {fa-heart-o 200% #ff0000} to {fa-code} on {fa-android 400% spin #ccddaa}"
    IconTextView1.Text = "I {fa-heart-o spin 32dp #ff0000} to {fa-code} on {fa-android 400% #ccddaa}"
    IconToggleButton1.Text = "{ion-social-github 675% #00cc00}"

    Dim g As ToastGravity
    g.Initialize(Gravity.TOP,10dip,10dip)

    toastbuilder.Initialize().withGravity(g)

    bar.Initialize("bar")
    bar.NavigationMode = bar.NAVIGATION_MODE_STANDARD 'change to list to see the other mode

    bar.Subtitle = "This is the subtitle"
    Activity.Title = "This is the title"
    'Activity.AddMenuItem3("MenuItem", "mi", LoadBitmap(File.DirAssets, "ic_small.png"), True)





    bar.NavigationMode = bar.NAVIGATION_MODE_STANDARD
    Dim dbl As IconDrawable
    dbl.Initialize ("fa-android")
    dbl.actionBarSize
    dbl.color(Colors.Green)



    ImageView1.Background = dbl

    Dim bmp As Bitmap
    bmp.InitializeMutable(50dip,50dip)
    
    Dim dbl As IconDrawable
    dbl.Initialize ("fa-code")
    dbl.actionBarSize
    dbl.color(Colors.Yellow)


    Dim r As Rect
    r.Initialize(0,0,50dip,50dip)
    Dim c As Canvas
    c.Initialize2(bmp)
    c.DrawDrawable(dbl,r)

    bar.Icon = bmp


End Sub

Also, you'll have to modify toast_custom.xml on Resources/layout and delete or modify drawable/ukraineflag (I've modified with android:src="@drawable/ok"/ to work)

Great job Don !
 
Last edited:

Rusty

Well-Known Member
Licensed User
Longtime User
I'm trying to use your example and have created a ukraine_flag.png, which was missing.
It compiles and then abends on the loadlayout.
I have edited and saved the layout (without changes) and it still aborts.
Any suggestions?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…