How to use the kivymd.icon_definitions.md_icons.keys function in kivymd

To help you get started, we’ve selected a few kivymd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HeaTTheatR / KivyMD / demos / kitchen_sink / main.py View on Github external
f"for show example apps\n\n"
            f"Author - [b][color={self.hex_primary_color}]"
            f"Andrés Rodríguez[/color][/b]\n"
            f"[u][b][color={self.hex_primary_color}]"
            f"andres.rodriguez@lithersoft.com[/color][/b][/u]\n\n\n"
            f"Authors this Fork:\n\n"
            f"[b][color={self.hex_primary_color}]"
            f"Ivanov Yuri[/color][/b]\n"
            f"[u][b][color={self.hex_primary_color}]"
            f"kivydevelopment@gmail.com[/color][/b][/u]\n\n"
            f"[b][color={self.hex_primary_color}]Artem S. Bulgakov[/color][/b]\n"
            f"[u][b][color={self.hex_primary_color}]"
            f"bulgakov-a-s@yandex.ru[/color][/b][/u]\n\n"
            f"and contributors..."
        )
        self.list_name_icons = list(md_icons.keys())[0:15]
        Window.bind(on_keyboard=self.events, on_resize=self.window_resize)
        crop_image(
            (Window.width, int(dp(Window.height * 35 // 100))),
            f"{os.environ['KITCHEN_SINK_ASSETS']}guitar-1139397_1280.png",
            f"{os.environ['KITCHEN_SINK_ASSETS']}guitar-1139397_1280_crop.png",
        )
github HeaTTheatR / KivyMD / demos / kitchen_sink / libs / baseclass / tabs.py View on Github external
from kivy.factory import Factory
from kivy.uix.screenmanager import Screen

from kivymd.icon_definitions import md_icons


class KitchenSinkTabs(Screen):
    list_name_icons = list(md_icons.keys())[0:15]
    tabs_created = False

    def on_enter(self):
        if not self.tabs_created:
            for name_tab in self.list_name_icons:
                self.ids.android_tabs.add_widget(
                    Factory.KitchenSinkTabItem(text=name_tab)
                )
            self.tabs_created = True

    def switch_tabs_to_text(self, istance_android_tabs):
        for instance_tab in istance_android_tabs.ids.scrollview.children[
            0
        ].children:
            for k, v in md_icons.items():
                if v == instance_tab.text:
github HeaTTheatR / KivyMD / kivymd / uix / tab.py View on Github external
"""

if __name__ == "__main__":
    from kivy.factory import Factory


    class MyTab(BoxLayout, MDTabsBase):
        pass

    class Example(App):
        title = "Example Tabs"
        theme_cls = ThemeManager()
        theme_cls.primary_palette = "BlueGray"
        theme_cls.theme_style = "Dark"
        theme_cls.accent_palette = "Gray"
        list_name_icons = list(md_icons.keys())[0:15]

        def switch_tabs_to_icon(self, istance_android_tabs):
            for i, instance_tab in enumerate(
                istance_android_tabs.ids.scrollview.children[0].children
            ):
                istance_android_tabs.ids.scrollview.children[0].remove_widget(
                    instance_tab
                )
                istance_android_tabs.add_widget(MyTab(text=self.list_name_icons[i]))

        def switch_tabs_to_text(self, istance_android_tabs):
            for instance_tab in istance_android_tabs.ids.scrollview.children[
                0
            ].children:
                for k, v in md_icons.items():
                    if v == instance_tab.text:
github HeaTTheatR / KivyMD / kivymd / uix / tab.py View on Github external
text: 'Content'
            halign: 'center'
            theme_text_color: 'Primary'
            font_style: 'H6'
"""

if __name__ == "__main__":
    from kivy.factory import Factory
    from kivymd.app import MDApp

    class MyTab(BoxLayout, MDTabsBase):
        pass

    class Example(MDApp):
        title = "Example Tabs"
        list_name_icons = list(md_icons.keys())[0:15]

        def switch_tabs_to_icon(self, istance_android_tabs):
            for i, instance_tab in enumerate(
                istance_android_tabs.ids.scrollview.children[0].children
            ):
                istance_android_tabs.ids.scrollview.children[0].remove_widget(
                    instance_tab
                )
                istance_android_tabs.add_widget(
                    MyTab(text=self.list_name_icons[i])
                )

        def switch_tabs_to_text(self, istance_android_tabs):
            for instance_tab in istance_android_tabs.ids.scrollview.children[
                0
            ].children:
github HeaTTheatR / KivyMD / demos / kitchen_sink / main.py View on Github external
async def set_list_for_refresh_layout():
            names_icons_list = list(md_icons.keys())[self.x : self.y]
            for name_icon in names_icons_list:
                await asynckivy.sleep(0)
                self.data["Refresh Layout"]["object"].ids.box.add_widget(
                    ItemForListRefreshLayout(icon=name_icon, text=name_icon)
                )
            self.data["Refresh Layout"][
                "object"
            ].ids.refresh_layout.refresh_done()
github HeaTTheatR / KivyMD / demos / kitchen_sink / main.py View on Github external
def set_list_md_icons(self, text="", search=False):
        """Builds a list of icons for the screen MDIcons."""

        def add_icon_item(name_icon):
            self.root.ids.scr_mngr.get_screen("md icons").ids.rv.data.append(
                {
                    "viewclass": "MDIconItemForMdIconsList",
                    "icon": name_icon,
                    "text": name_icon,
                    "callback": self.callback_for_menu_items,
                }
            )

        self.root.ids.scr_mngr.get_screen("md icons").ids.rv.data = []
        for name_icon in md_icons.keys():
            if search:
                if text in name_icon:
                    add_icon_item(name_icon)
            else:
                add_icon_item(name_icon)