Icon

Screenshot

Icon - Reference - Enaml-native - CodeLV

Example

import importlib
from enamlnative.core.api import *
from enamlnative.widgets.api import *

import iconify
iconify.install(*iconify.BUILTIN_ICON_PACKS)

from iconify import (
    #cryptocoins,
    entypo, ionicons, fontawesome, material, material_community,
    simplelineicons, meteocons, weathericons
)

ICON_PACKS = {
  #'Cryptocoins': cryptocoins,
  'Entypo': entypo,
  'Fontawesome': fontawesome,
  'Ionicons': ionicons,
  'Material': material,
  'Material community': material_community,
  'Meteocons': meteocons,
  'Simple line icons': simplelineicons,
  'Weather': weathericons,
}

enamldef Text(TextView):
    #: Add Spacing
    padding = (0, 20, 0, 0)

enamldef ContentView(ScrollView): finder:
    attr icons << ICON_PACKS[icon_pack.items[icon_pack.selected]].ICONS.keys()
    padding = (10, 10, 10, 10)
    Flexbox:
        flex_direction = "column"
        CardView:
            Flexbox:
                flex_direction = "column"
                height = "wrap_content"
                Text:
                    text = "Icons"
                    text_size = 32
                Text:
                    text = "Use {icon-name} within the text. Uses android-iconify. Browse an icon pack below" \
                         "or pick an icon from the pack here"
                Text:
                  text = "Icon packs"
                Spinner: icon_pack:
                  items = list(ICON_PACKS.keys())

                Text:
                  text = "Icon"
                AutoCompleteTextView: search:
                    choices << list(finder.icons)
                    text << choices[0]

                Flexbox: display:
                    padding = (0, 20, 0, 20)
                    attr text << "{%s}" % search.text if search.text in finder.icons else ""
                    Looper:
                        iterable = [72, 64, 48, 32, 24, 18]
                        Icon:
                            text_size = loop_item
                            padding =  (8, 0, 8, 0)
                            text << display.text

                Text:
                    text = "Manual"
                EditText: manual:
                    editor_actions = True
                    placeholder = "Put your icon code here"
                    editor_action ::
                        if change['value']['key'] == 6:
                            display.text = self.text
                            #: Keep keyboard open
                            change['value']['result'] = True
                Text:
                    text = "Warning: it's easy to blow up with a typo here!"
                    text_color = "#f00"


                #: Use one because it's way f,aster than a looper
                Text:
                  text = "Icons"
                Icon:
                  text_size = 32
                  text << " ".join(["{%s}" % n for n in finder.icons])

Declaration

class enamlnative.widgets.iconify.Icon(parent=None, **kwargs)[source]

Bases: enamlnative.widgets.text_view.TextView

A simple control for displaying a Icon.

proxy

A reference to the ProxyIcon object.

Android Implementation

class enamlnative.android.android_iconify.AndroidIcon[source]

Bases: enamlnative.android.android_text_view.AndroidTextView, enamlnative.widgets.iconify.ProxyIcon

An Android implementation of an Enaml ProxyIcon.

widget

A reference to the widget created by the proxy.

create_widget()[source]

Create the underlying widget.

No iOS implementation found.