GithubHelp home page GithubHelp logo

kivymd / kivymd Goto Github PK

View Code? Open in Web Editor NEW
2.1K 97.0 655.0 167.03 MB

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications. https://youtube.com/c/KivyMD https://twitter.com/KivyMD https://habr.com/ru/users/kivymd https://stackoverflow.com/tags/kivymd

Home Page: https://kivymd.readthedocs.io

License: MIT License

Python 91.93% Shell 0.28% PowerShell 0.04% kvlang 7.75%
kivymd kivy cross-platform material-design ui python app android ios windows

kivymd's Introduction

KivyMD 2.0.0

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications.

The project's goal is to approximate Google's Material Design spec as close as possible without sacrificing ease of use. This library is a fork of the KivyMD project. We found the strength and brought this project to a new level.

Join the project! Just fork the project, branch out and submit a pull request when your patch is ready. If any changes are necessary, we'll guide you through the steps that need to be done via PR comments or access to your for may be requested to outright submit them.

If you wish to become a project developer (permission to create branches on the project without forking for easier collaboration), have at least one PR approved and ask for it. If you contribute regularly to the project the role may be offered to you without asking too.

PyPI version Supported Python versions Downloads Code style: Black

Discord Twitter YouTube Habr StackOverflow Open Collective

Coverage status Build workflow Test workflow Documentation status Repository size

Installation

pip install kivymd==2.0.0

Dependencies:

How to install

Command above will install latest release version of KivyMD from PyPI.

If you want to install development version from master branch, you should specify link to zip archive:

pip install https://github.com/kivymd/KivyMD/archive/master.zip

Tip: Replace master.zip with <commit hash>.zip (eg 51b8ef0.zip) to download KivyMD from specific commit.

Also you can install manually from sources. Just clone the project and run pip:

git clone https://github.com/kivymd/KivyMD.git --depth 1
cd KivyMD
pip install .

Speed Tip: If you don't need full commit history (about 1.14 GiB), you can use a shallow clone (git clone https://github.com/kivymd/KivyMD.git --depth 1) to save time. If you need full commit history, then remove --depth 1.

How to use with Buildozer

requirements = python3,
    kivy,
    https://github.com/kivymd/KivyMD/archive/master.zip,
    materialyoucolor,
    exceptiongroup,
    asyncgui,
    asynckivy

This will download latest release version of KivyMD from PyPI.

If you want to use development version from master branch, you should specify link to zip archive:

requirements = kivy, https://github.com/kivymd/KivyMD/archive/master.zip

Do not forget to run buildozer android clean or remove .buildozer directory before building if version was updated (Buildozer doesn't update already downloaded packages).

On Linux

On Windows 10

Build automatically via GitHub Actions

How to use with kivy-ios

toolchain build python3 kivy pillow
toolchain pip install --no-deps kivymd

Documentation

Demos

Kitchen sink app demonstrates every KivyMD widget. You can see how to use widget in code of app.

Comparison of Flutter & KivyMD

Sky View Concept Healthy Food Delivery
Asics Shoes Concept Facebook Desktop Redesign

Use MVC and Hot Reload

Support

If you need assistance or you have a question, you can ask for help on our mailing list:

Settings

Promo Video

Contributing

We always welcome your Bug reports, Feature requests and Pull requests! Check out CONTRIBUTING.md and feel free to improve KivyMD.

Setup environment

We recommend you to use PyCharm to work with KivyMD code. Install Kivy and development dependencies to your virtual environment:

pip install -e .[dev,docs]
pre-commit install

Format all files and run tests:

pre-commit run --all-files
pytest kivymd/tests --timeout=600 --cov=kivymd --cov-report=term

pre-commit will format modified files with Black and sort imports with isort.

Sister projects

KivyMD Extensions

Additional extensions for the KivyMD library.

https://github.com/kivymd-extensions

KivyMDBuilder

Build apps visually.

https://github.com/kivymd/KivyMDBuilder

License

Contributors

KivyMD Team

They spent a lot of time to improve KivyMD.

  • Yuri Ivanov @HeaTTheatR - Core developer
  • Artem Bulgakov @ArtemSBulgakov - Technical administrator, contributor
  • Andrés Rodríguez @mixedCase - First author of KivyMD project, contributor

Code Contributors

This project exists thanks to all the people who contribute. How to contribute

Financial Contributors

Become a financial contributor on OpenCollective and help us sustain our community.

Gold Sponsors

Become a Gold Sponsor and get your logo on our Readme with a link to your website.

Backers

Become a Backer if you want to help develop this project.

kivymd's People

Contributors

adityabhawsingka avatar artemsbulgakov avatar bananamasterz avatar coelhonl avatar david-fischer avatar dwmoffatt avatar gbm001 avatar heattheatr avatar homdx avatar ibrahimcetin avatar ikus060 avatar inna-voig avatar juacywillian avatar kevin-schumann avatar kivymd-bot avatar kulothunganug avatar lemousehunter avatar nanouasyn avatar neizvestnyj avatar p0lygun avatar pakal avatar podraco avatar quitegreensky avatar runette avatar shashi278 avatar t-dynamos avatar vpvn avatar wasimafser avatar zianioussama avatar zworkb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kivymd's Issues

get_hex_from_color

Please insert:
in load_string:
#:import get_hex_from_color kivy.utils.get_hex_from_color

in header:
from kivy.utils import get_hex_from_color

For correct functionality.

Unable to update kivymd.button.text

Standard ways of updating widget properties do not seem to work with the KivyMD buttons. Simply updating the text value fails to produce any updates.

Either setting the text property by .kv or by binding it to a class defined StringProperty does not seem to change the behavior at all. Accessing the value produces an empty string, updating the value does change the property, but the displayed text remains unchanged.

Ill add some code and the console output to show you what I mean. Please note that the standard kivy buttons act as expected and update the displayed text. I may just be missing something very obvious...

from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.uix.scrollview import ScrollView
from kivy.properties import StringProperty
from kivymd.theming import ThemeManager

Builder.load_string('''
#:import MDRectangleFlatIconButton kivymd.button
<ScreenOne@BoxLayout>:
    orientation: 'vertical'
    ScrollView:
        BoxLayout:
            orientation: 'vertical'
            size_hint_y: None
            height: self.minimum_height
            padding: dp(48)
            spacing: dp(20)
            
            Button:
                id: kivy_button
                text: 'Kivy Button'
                size_hint: [None, None]
                size: kivymd_button.size
                on_release: root.kivy_button_tap()
            MDRectangleFlatIconButton:
                id: kivymd_button
                text: 'KivyMD Button'
                icon: 'calendar'
                on_release: root.kivymd_button_tap()
            Button:
                id: kivy_button_bound
                text: root.bind_text_kv
                size_hint: [None, None]
                size: kivymd_button.size
                on_release: root.kivy_button_bound_tap()
            MDRectangleFlatIconButton:
                id: kivymd_button_bound
                text: root.bind_text_kvmd
                icon: 'calendar'
                on_release: root.kivymd_button_bound_tap()
    ''')


class ScreenOne(Screen):
    bind_text_kvmd = StringProperty('KivyMD bound')
    bind_text_kv = StringProperty('Kivy bound')

    def kivy_button_tap(self):
        print('Kivy text value = {}'.format(self.ids.kivy_button.text))
        self.ids.kivy_button.text = 'Updated'
        print('Kivy text value = {}'.format(self.ids.kivy_button.text))

    def kivymd_button_tap(self):
        print('KivyMD text value = {}'.format(self.ids.kivymd_button.text))
        self.ids.kivymd_button.text = 'Updated'
        print('KivyMD text value = {}'.format(self.ids.kivymd_button.text))

    def kivy_button_bound_tap(self):
        print('StringProperty bind_text_kv value = {}'.format(self.bind_text_kv))
        print('Kivy bound text value = {}'.format(self.ids.kivy_button_bound.text))
        self.bind_text_kv = 'Updated'
        print('StringProperty bind_text_kv value = {}'.format(self.bind_text_kv))
        print('Kivy bound text value = {}'.format(self.ids.kivy_button_bound.text))
        
    def kivymd_button_bound_tap(self):
        print('StringProperty bind_text_kvmd value = {}'.format(self.bind_text_kvmd))
        print('Kivy bound text value = {}'.format(self.ids.kivymd_button_bound.text))
        self.bind_text_kvmd = 'Updated'
        print('StringProperty bind_text_kvmd value = {}'.format(self.bind_text_kvmd))
        print('Kivy bound text value = {}'.format(self.ids.kivymd_button_bound.text))


class Test(App):
    theme_cls = ThemeManager()
    theme_cls.primary_palette = 'Indigo'
    title = 'Button Text Update Testing'

    def build(self):
        self.sm = ScreenManager()
        s1 = ScreenOne(name='one')
        self.sm.add_widget(s1)
        return self.sm

if __name__ == '__main__':
    Test().run()

Console Output:

Kivy text value = Kivy Button
Kivy text value = Updated

KivyMD text value =
KivyMD text value = Updated

StringProperty bind_text_kv value = Kivy bound
Kivy bound text value = Kivy bound
StringProperty bind_text_kv value = Updated
Kivy bound text value = Updated

StringProperty bind_text_kvmd value = KivyMD bound
Kivy bound text value =
StringProperty bind_text_kvmd value = Updated
Kivy bound text value = Updated

Error in type variable oin class MDTextFieldRound

I found declaration error in the file textfield.py in the class MDTextFieldRound the property icon_color (line 688) is declarate with type StringProperty, and this shoul be type ListProperty .

Regards and thanks son much for excelent job.

Crash on creating disabled MDSwitch

Creating an MDSwitch which is initially set disabled: True (in Kivy language) leads to a crash:

AttributeError: 'MDSwitch' object has no attribute 'thumb_color_disabled'

This is because in selectioncontrols.py:

Thumb:
    id: thumb
    size_hint: None, None
    size: dp(24), dp(24)
    pos: root._thumb_pos
    color:
        root.thumb_color_disabled if root.disabled else\
        (root.thumb_color_down if root.active else root.thumb_color)
    elevation:    4 if root.active else 2
    on_release: setattr(root, 'active', not root.active)

root.thumb_color_disabled is not initialized when the MDSwitch is first created.
I have worked around in my MDSwitch subclasses with:

from kivy.utils import get_color_from_hex
from kivymd.color_definitions import colors
class MyMDSwitch(MDSwitch):
    def __init__(self, **kwargs):
        self.thumb_color_disabled = get_color_from_hex(colors['Gray']['400'])
        super().__init__(**kwargs)

Need example for Date Picker

Are you able to provide an example of how to implement a DatePicker to the wiki. I was trying to use the KitchenSink project but it jumps around a lot. What is required and how do I access the data that is set - is that the self.previous_date?

Thanks!

MDRaisedButton behavior is not correct after updating its text

As stated in the title, after updating the text of a MDRaisedButton, its size and position changes, that it's not intended.

Alt Text

If I swap to a Button, it behaves correctly:
Alt Text

on_press:

def test(self, *args):
        args[0].text = 'teste'

EDIT: Every MDButton behaves this way, the problem should be on a class that all of them inherit.

Can KivyMD change font family?

I use KivyMD to display other languages using a special character not limited to roman, but the program did not display the character from other languages. In KIvy, I can add default font to the program, but KivyMD dit not display it. Is KivyMD support other fonts?

FloatingButton with custom icon

How do I use a custom icon in KivyMD elements? From what I've seen the library has his own custom icon selections and I don't see a possibility to add an icon from a custom directory rather than the predefined icons given by the library.

Here is my FloatingButton kv class:

    FloatLayout:
        callback: lambda x: None
        FloatingButton:
            id: floating_icon
            icon: "assets/language-cpp.png" #this crashes the app
            on_release: root.manager.current = "language"

kitchen sink crash: No module named 'demo_apps.swipecards'

Running the kitchen sink demo (main.py) crashes:

Traceback (most recent call last):
File "./main.py", line 30, in
from screens import Screens
File "/home/amcleod/android/KivyMD/demos/kitchen_sink/screens.py", line 22, in
from demo_apps.swipecards import screen_swipe_cards, SwipeCards
ModuleNotFoundError: No module named 'demo_apps.swipecards'

There is no 'swipecards.py' file in demo_apps.

Не работает код из вики

Запустил код отсюда и возникла следующая ошибка:

Traceback (most recent call last):
   File "/Users/User/PycharmProjects/mobileapp/main.py", line 71, in <module>
     Example().run()
   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/app.py", line 829, in run
     root = self.build()
   File "/Users/User/PycharmProjects/mobileapp/main.py", line 68, in build
     return Builder.load_string(KV)
   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/lang/builder.py", line 368, in load_string
     parser = Parser(content=string, filename=fn)
   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/lang/parser.py", line 401, in __init__
     self.parse(content)
   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/lang/parser.py", line 507, in parse
     self.execute_directives()
   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/kivy/lang/parser.py", line 476, in execute_directives
     mod = getattr(mod, part)
 AttributeError: module 'kivymd.tabs' has no attribute 'MDBottomNavigation'

Error building following README instructions on master

Followed instructions for installing, errors compiling

sudo python ./setup.py install

=============
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/progressbar.py to progressbar.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/ripplebehavior.py to ripplebehavior.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/vendor/circleLayout/init.py to init.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/vendor/circularTimePicker/init.py to init.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/vendor/init.py to init.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/vendor/navigationdrawer/init.py to init.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/backgroundcolorbehavior.py to backgroundcolorbehavior.pyc
File "/usr/local/lib/python2.7/dist-packages/kivymd/backgroundcolorbehavior.py", line 48
options=['Primary', 'Accent', *palette])
^
SyntaxError: invalid syntax

byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/imagelists.py to imagelists.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/snackbars.py to snackbars.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/kivymd/font_definitions.py to font_definitions.pyc
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/kivymd-0.97_.2.egg-info
$ python --version
Python 2.7.12

Buildozer build issue

Hello,
When I tried to build app with buildozer I have this error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 340: ordinal not in range(128)
who's triggered by these lines of the setup.py:

VERSION_FILE = "kivymd/__init__.py"
ver_file_data = open(VERSION_FILE, "rt").read()
ver_regex = r"^__version__ = ['\"]([^'\"]*)['\"]"
ver_reg_search = re.search(ver_regex, ver_file_data, re.M)

No cursor blink with kivy 1.10.1 in MDTextField

Hi,
I upgraded from kivy 1.10.0 to 1.10.1 which caused the cursor in MDTextField to disappear. It can be reproduced with the Kitchen_sink demo set. I tried to change the cursor color but that did not help.
I am running Windows 10.

Add example List with Icon and Checkbox to Wiki

Could you add an example to the Wiki for Lists? Specifically the one that you have in the sample app where you have a logo, text and checkbox.

I want to have a list of items and have check boxes, I want to select the ones I want and then hit a button on the page outside of the List itself that then does work with the list of data but I'm not sure how to do it.

Thank you for all your work and quick responses!

OSError: File .....\kivymd\fonts/Roboto-Regular.ttf not found

Hello, I created a package for windows with pyinstaller (pyinstaller --onefile myscript.py). After that, when I try to open the .exe file within dist directory, I get that error

OSError: File C:\Users\HP\AppData\Local\Temp\_MEI131442\kivymd\fonts/Roboto-Regular.ttf not found

The app doesn't startup. It immediately crash. I also tried to create the package from example scripts. No luck, get the same error whenever I try to open .exe

Is there any fix? Thanks

UI lag and random freeze

Hello!
I use latest kivy, KivyMD and tried to build application kitchen_sink, but this application UI looks slow. All touch actions occur with notable delay, even clicking on buttons
I install KIvyMD Demo from Google Play and it works fine.
I also tried to build the kivy showcase with same buildozer.spec and it works perfectly.
Could you suggest me what is wrong?
I use latest kivy/buildozer on Ubuntu 18.04
Attached video and buildozer.spec file
kivy-data.zip

Suggestion: Opening an English Support Group

Hello , thanks for creating this library. It has enabled me to create beautiful apps. Please consider opening a support group for english users (vk group is in russian so i dont understand anything).Telegram or discord group will do.

Text field helper text on error

xclip - FileNotFoundError: [Errno 2] No such file or directory: 'xclip': 'xclip'
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/core/init.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/core/clipboard/clipboard_xclip.py", line 17, in
p = subprocess.Popen(['xclip', '-version'], stdout=subprocess.PIPE)
File "/usr/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)

xsel - FileNotFoundError: [Errno 2] No such file or directory: 'xsel': 'xsel'
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/core/init.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/core/clipboard/clipboard_xsel.py", line 16, in
p = subprocess.Popen(['xsel'], stdout=subprocess.PIPE)
File "/usr/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)

[WARNING] [MDBottomNavigation] 50.0dp is less than the minimum size of 80dp for a MDBottomNavigationItem. We must now expand to 168dp.
[INFO ] [Loader ] using a thread pool of 2 workers
[INFO ] [GL ] Unpack subimage support is available
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "kivy/properties.pyx", line 838, in kivy.properties.ObservableDict.getattr (/tmp/pip-install-lbzi7uqi/kivy/kivy/properties.c:12019)
KeyError: 'text_field_error'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/matheus/PycharmProjects/KivyMD/demos/kitchen_sink/main.py", line 1059, in
KitchenSink().run()
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/app.py", line 826, in run
runTouchApp()
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/base.py", line 502, in runTouchApp
EventLoop.window.mainloop()
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/core/window/window_sdl2.py", line 727, in mainloop
self._mainloop()
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/core/window/window_sdl2.py", line 662, in _mainloop
self.modifiers):
File "kivy/_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:7682)
File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:13525)
File "kivy/_event.pyx", line 1138, in kivy._event.EventObservers._dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:13051)
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/core/window/init.py", line 162, in _on_window_key_down
return self.dispatch('on_key_down', keycode, text, modifiers)
File "kivy/_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:7682)
File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:13525)
File "kivy/_event.pyx", line 1138, in kivy._event.EventObservers._dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:13051)
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/uix/textinput.py", line 2468, in keyboard_on_key_down
self._key_down(key)
File "/home/matheus/.virtualenvs/k37/lib/python3.6/site-packages/kivy/uix/textinput.py", line 2332, in _key_down
self.dispatch('on_text_validate')
File "kivy/_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:7682)
File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:13525)
File "kivy/_event.pyx", line 1138, in kivy._event.EventObservers._dispatch (/tmp/pip-install-lbzi7uqi/kivy/kivy/_event.c:13051)
File "/home/matheus/PycharmProjects/KivyMD/demos/kitchen_sink/main.py", line 956, in set_error_message
if len(self.root.ids.text_field_error.text) == 2:
File "kivy/properties.pyx", line 841, in kivy.properties.ObservableDict.getattr (/tmp/pip-install-lbzi7uqi/kivy/kivy/properties.c:12125)
AttributeError: 'super' object has no attribute 'getattr'

Cannot install on Lubuntu 18

Cannot install the program. When I run:
sudo python3 /home/.../setup.py install

It throws:
Traceback (most recent call last):
File "/home/aleksei/KivyMD-master/setup.py", line 7, in
ver_file_data = open(VERSION_FILE, "rt").read()
FileNotFoundError: [Errno 2] No such file or directory: 'kivymd/init.py'

When I changed "kivymd/init.py" to the full path in setup.py (line 7) and run setup.py again, it throws:

running install
running build
running build_py
error: package directory 'kivymd' does not exist

Error in selecting toolbar

Traceback (most recent call last):
File "C:/Users/mcroni/KivyMD/demos/kitchen_sink/main.py", line 1033, in
KitchenSink().run()
File "C:\Python37\lib\site-packages\kivy\app.py", line 826, in run
runTouchApp()
File "C:\Python37\lib\site-packages\kivy\base.py", line 502, in runTouchApp
EventLoop.window.mainloop()
File "C:\Python37\lib\site-packages\kivy\core\window\window_sdl2.py", line 727, in mainloop
self._mainloop()
File "C:\Python37\lib\site-packages\kivy\core\window\window_sdl2.py", line 460, in _mainloop
EventLoop.idle()
File "C:\Python37\lib\site-packages\kivy\base.py", line 337, in idle
Clock.tick()
File "C:\Python37\lib\site-packages\kivy\clock.py", line 581, in tick
self._process_events()
File "kivy_clock.pyx", line 384, in kivy._clock.CyClockBase._process_events
File "kivy_clock.pyx", line 414, in kivy._clock.CyClockBase._process_events
File "kivy_clock.pyx", line 412, in kivy._clock.CyClockBase._process_events
File "kivy_clock.pyx", line 167, in kivy._clock.ClockEvent.tick
File "C:\Python37\lib\site-packages\kivy\uix\scrollview.py", line 1125, in _do_touch_up
super(ScrollView, self).on_touch_up(touch)
File "C:\Python37\lib\site-packages\kivy\uix\widget.py", line 482, in on_touch_up
if child.dispatch('on_touch_up', touch):
File "kivy_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "C:\Python37\lib\site-packages\kivy\uix\widget.py", line 482, in on_touch_up
if child.dispatch('on_touch_up', touch):
File "kivy_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "C:\Users\mcroni\KivyMD\kivymd\list.py", line 449, in on_touch_up
super().on_touch_up(touch)
File "C:\Users\mcroni\KivyMD\kivymd\ripplebehavior.py", line 83, in on_touch_up
return super().on_touch_up(touch)
File "C:\Python37\lib\site-packages\kivy\uix\behaviors\button.py", line 179, in on_touch_up
self.dispatch('on_release')
File "kivy_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch
File "kivy_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
File "kivy_event.pyx", line 1098, in kivy._event.EventObservers._dispatch
File "C:\Python37\lib\site-packages\kivy\lang\builder.py", line 64, in custom_callback
exec(kvlang.co_value, idmap)
File "", line 97, in
File "C:\Users\mcroni\KivyMD\demos\kitchen_sink\screens.py", line 1901, in show_screen
if not self.data[name_screen]['object']:
KeyError: 'Toolbars'

Error in selecting Floating Buttons

Traceback (most recent call last):
File "C:/Users/mcroni/KivyMD/demos/kitchen_sink/main.py", line 1033, in
KitchenSink().run()
File "C:\Python37\lib\site-packages\kivy\app.py", line 826, in run
runTouchApp()
File "C:\Python37\lib\site-packages\kivy\base.py", line 502, in runTouchApp
EventLoop.window.mainloop()
File "C:\Python37\lib\site-packages\kivy\core\window\window_sdl2.py", line 727, in mainloop
self._mainloop()
File "C:\Python37\lib\site-packages\kivy\core\window\window_sdl2.py", line 460, in _mainloop
EventLoop.idle()
File "C:\Python37\lib\site-packages\kivy\base.py", line 337, in idle
Clock.tick()
File "C:\Python37\lib\site-packages\kivy\clock.py", line 581, in tick
self._process_events()
File "kivy_clock.pyx", line 384, in kivy._clock.CyClockBase._process_events
File "kivy_clock.pyx", line 414, in kivy._clock.CyClockBase._process_events
File "kivy_clock.pyx", line 412, in kivy._clock.CyClockBase._process_events
File "kivy_clock.pyx", line 167, in kivy._clock.ClockEvent.tick
File "C:\Python37\lib\site-packages\kivy\uix\scrollview.py", line 1125, in _do_touch_up
super(ScrollView, self).on_touch_up(touch)
File "C:\Python37\lib\site-packages\kivy\uix\widget.py", line 482, in on_touch_up
if child.dispatch('on_touch_up', touch):
File "kivy_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "C:\Python37\lib\site-packages\kivy\uix\widget.py", line 482, in on_touch_up
if child.dispatch('on_touch_up', touch):
File "kivy_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "C:\Users\mcroni\KivyMD\kivymd\list.py", line 449, in on_touch_up
super().on_touch_up(touch)
File "C:\Users\mcroni\KivyMD\kivymd\ripplebehavior.py", line 83, in on_touch_up
return super().on_touch_up(touch)
File "C:\Python37\lib\site-packages\kivy\uix\behaviors\button.py", line 179, in on_touch_up
self.dispatch('on_release')
File "kivy_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch
File "kivy_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
File "kivy_event.pyx", line 1098, in kivy._event.EventObservers._dispatch
File "C:\Python37\lib\site-packages\kivy\lang\builder.py", line 64, in custom_callback
exec(kvlang.co_value, idmap)
File "", line 97, in
File "C:\Users\mcroni\KivyMD\demos\kitchen_sink\screens.py", line 1901, in show_screen
if not self.data[name_screen]['object']:
KeyError: 'Floating Buttons'

toggle_nav_drawer()

in line 254 of the kitchen_sink main.py
[['menu', lambda x: app.root.toggle_nav_drawer()]]
I did not see the function toggle_nav_drawer() been defined anywhere nor been imported.
How can this function be used???

Accordionlistitem - change avatar to iconbutton and create an action

Hello,
In the file accordionlistitem.py

I changed AvatarLeft from:
class AvatarLeft(ILeftBody, Image):
pass
to:
class AvatarLeft(ILeftBodyTouch, MDIconButton):
source = StringProperty()

And the result was a black circle icon in the left of each MDAccordionListItem (look at the picture)

How can I program an action 'on_release' to use in my application using this button? and also change the icon.

Thanks in advance!

image

Adding MDThemePicker messes the UI

Just using the import:

from kivymd.theme_picker import MDThemePicker

My screen goes from this:
https://imgur.com/bXsp2hK

To this:
https://imgur.com/5vXqnrJ

It introduces a new ScreenManager even though I've just used the import, I didn't even create a widget.

For example doing this print(self.children[0].children), outputs:
[<kivymd.tabs.MDBottomNavigationBar object at 0x7f84a993f6c8>, <kivy.uix.screenmanager.ScreenManager object at 0x7f84a993f388>, <kivymd.tabs.MDBottomNavigationBar object at 0x7f84a993f458>, <kivy.uix.screenmanager.ScreenManager object at 0x7f84a993f2b8>]

Without the import I don't have the last ScreenManager and the layout is fine.

Also, using the picker, something is not right:
https://imgur.com/xyXYzzS

That blank space isn't supposed to be there.

MDDropdownMenu on_press event

I want to call a function when o click on one of the MDDropdownMenu's item, but i dont know how?

Thats how i added MDDropdownMenu.

Toolbar:
    id: toolbar
    elevation: 9
    pos_hint: {'top':1}
    title: 'Test App'
    md_bg_color: [.2, .3, .5, 1]
    background_palette: 'Primary'
    background_hue: '700'
    right_action_items: [['dots-vertical', lambda x: MDDropdownMenu(items=app.menu_items, width_mult=4).open(self)]]


And menu_items

    menu_items = [
        {'viewclass': 'MDMenuItem',
         'text': 'About'},]

lets say i have a fuction in main class

    def example(self,*args):
        pass

how can i call this with on_press event over one of the MDDropdownMenu item?

MDAccordionListItem - annimation

The shadow used in annimation was not a good choice. It returns to other AccordionListItem when some AccordionListItem is closed.

MDInputDialog displays widgets in background

When I run the KivyMD Test everything works fine, but when I try to use the MDInputDialog in my code the buttons and textfields show only up in the background (If I set the size_hint to None, None the window is small enough that I can see that the widgets are only behind the window... if I set a specific size_hint the widgets disappear again). The solution for this issue didn't help me. I didn't really change much of the code used in the Example in the dialog.py module but if you need the source code just ask.

Thanks in advance!

MDTextField' object has no attribute '_cursor_blink

When playing with the kitchen_sink and i try to open the TextField screen, upon touching or clicking on any of the textfields, the app crushes with this error
File "kivy\weakproxy.pyx", line 30, in kivy.weakproxy.WeakProxy.__getattr__ (kivy\weakproxy.c:1386) AttributeError: 'MDTextField' object has no attribute '_cursor_blink'

I updated my python version to 3.7 and this issues didnt occur but it did occur witih python 3.4

Is it possible to have 2 datepickers on the same screen?

Is it possible to have 2 datepickers on the same screen? I need to be able to set an upper and lower date for a query to an api but because the datepicker is using self.previous date my two datepickers are linked up.

How do I have two datepickers that are working independently from each other?

Or can I have a single datepicker choose two dates?

Thanks for all your work!

'kivy.graphics.context_instructions.BindTexture' object has no attribute 'children'

I'm making an app for my phone and I noticed this strange error popping out. I removed almost everything of my code and is the error still comes back somehow unless I delete the GridLayout import.

main.kv

#:kivy 1.10.1

#:import MDTextField kivymd.textfields.MDTextFieldRect

GridLayout:
    cols: 1
    MDTextFieldRect:
        id: code_field
        multiline: True

    MDTextFieldRect:
        id: result_field
        multiline: True
        readonly: True

main.py:

from kivy.lang import Builder
import logging
from kivy.uix.gridlayout import GridLayout


logging.basicConfig(level=logging.DEBUG)

class RextesterApp(App):

    def build(self):
        return Builder.load_file("main.kv")
        #return self.root

if __name__ == "__main__":
    RextesterApp().run()

MDIconButton

How can i change MDIConButton's icon with a custom one?

i tried

icon: 'example.png'
source: 'example.png'
image: 'example.png'

but none of them work. it only accepts main icons like icon: 'sd' etc.

search icon

How can I put the "search" icon with a single magnifier as the MD Icons 'search'?

Demo app doesn't work on Android 8.0

Hello. I installed Python 3 version of demo, when the app is opening with splash screen, it crashes on Android 8.0 Mi6. It also clashes for Python 2.7 version.

'kivymd.tabs' has no attribute 'MDTabbedPanel'

Clicking on the timepicker throws this error

[INFO ] [Logger ] Record log in C:\Users\mcroni.kivy\logs\kivy_19-05-15_18.txt
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'4.5.0 - Build 24.20.100.6025'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Intel(R) UHD Graphics 620'>
[INFO ] [GL ] OpenGL parsed version: 4, 5
[INFO ] [GL ] Shading version <b'4.50 - Build 24.20.100.6025'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [KivyMD ] KivyMD version: 0.99.6
[INFO ] [Text ] Provider: sdl2
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Base ] Start application main loop
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "C:/Users/mcroni/KivyMD/demos/kitchen_sink/main.py", line 1033, in
KitchenSink().run()
File "C:\Python37\lib\site-packages\kivy\app.py", line 826, in run
runTouchApp()
File "C:\Python37\lib\site-packages\kivy\base.py", line 502, in runTouchApp
EventLoop.window.mainloop()
File "C:\Python37\lib\site-packages\kivy\core\window\window_sdl2.py", line 727, in mainloop
self._mainloop()
File "C:\Python37\lib\site-packages\kivy\core\window\window_sdl2.py", line 460, in _mainloop
EventLoop.idle()
File "C:\Python37\lib\site-packages\kivy\base.py", line 340, in idle
self.dispatch_input()
File "C:\Python37\lib\site-packages\kivy\base.py", line 325, in dispatch_input
post_dispatch_input(*pop(0))
File "C:\Python37\lib\site-packages\kivy\base.py", line 291, in post_dispatch_input
wid.dispatch('on_touch_up', me)
File "kivy_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "C:\Users\mcroni\KivyMD\kivymd\ripplebehavior.py", line 83, in on_touch_up
return super().on_touch_up(touch)
File "C:\Users\mcroni\KivyMD\kivymd\button.py", line 572, in on_touch_up
return super().on_touch_up(touch)
File "C:\Users\mcroni\KivyMD\kivymd\button.py", line 464, in on_touch_up
return super().on_touch_up(touch)
File "C:\Python37\lib\site-packages\kivy\uix\behaviors\button.py", line 179, in on_touch_up
self.dispatch('on_release')
File "kivy_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch
File "kivy_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
File "kivy_event.pyx", line 1098, in kivy._event.EventObservers._dispatch
File "C:\Python37\lib\site-packages\kivy\lang\builder.py", line 64, in custom_callback
exec(kvlang.co_value, idmap)
File "", line 26, in
File "C:/Users/mcroni/KivyMD/demos/kitchen_sink/main.py", line 801, in show_example_time_picker
from kivymd.pickers import MDTimePicker
File "C:\Users\mcroni\KivyMD\kivymd\pickers.py", line 858, in
''')
File "C:\Python37\lib\site-packages\kivy\lang\builder.py", line 368, in load_string
parser = Parser(content=string, filename=fn)
File "C:\Python37\lib\site-packages\kivy\lang\parser.py", line 392, in init
self.parse(content)
File "C:\Python37\lib\site-packages\kivy\lang\parser.py", line 498, in parse
self.execute_directives()
File "C:\Python37\lib\site-packages\kivy\lang\parser.py", line 467, in execute_directives
mod = getattr(mod, part)
AttributeError: module 'kivymd.tabs' has no attribute 'MDTabbedPanel'

Custom & text_color - MDRectangleFlatIconButton & MDRoundFlatIconButton

Problem
Unable to change the text colour for MDRectangleFlatIconButton and MDRoundFlatIconButton with the following attributes:

    MDRectangleFlatIconButton:
        theme_text_color: 'Custom'
        text_color: [1,0,0,1]
        text: "MDRectangleFlatIconButton"
        icon: "language-python"
        pos_hint: {'center_x': .5, 'center_y': .45}
        width: dp(230)

    MDRoundFlatIconButton:
        theme_text_color: 'Custom'
        text_color: [1,0,0,1]
        text: "MDRoundFlatIconButton"
        icon: "language-python"
        pos_hint: {'center_x': .5, 'center_y': .25}
        width: dp(200)

kvMD-0 100 2-IconButton-textColor-Screenshot at 2019-08-03 17-01-10

Solution
I made the following changes in button.py by
Replace:

            theme_text_color: 'Custom'
            text_color: root.theme_cls.primary_color

with:

            theme_text_color: root.theme_text_color   
            text_color: root.text_color                 

Snippets: button.py - kv

<MDRectangleFlatIconButton>
    ...
    theme_text_color: 'Custom'
    text_color: root.theme_cls.primary_color

    BoxLayout:
        ...

        MDIcon:
            ...

        MDLabel:
            ..
            theme_text_color: root.theme_text_color    
            text_color: root.text_color                 
            markup: root.markup
            
<MDRoundFlatIconButton>
    ...
    theme_text_color: 'Custom'
    text_color: root.theme_cls.primary_color

    BoxLayout:
        ...
        MDIcon:
            ...

        MDLabel:
            ...
            theme_text_color: root.theme_text_color     
            text_color: root.text_color                 
            markup: root.markup

kvMD-myFix-Screenshot at 2019-08-03 17-28-53

MDTextField: "Select all | Copy | Paste" bubble disappearing

When using long tap on the MDTextField, the bubble "Select all | Copy | Paste" appearing for less than 1 second.
There is not possible to paste something on this field.

Android 8.1
KivyMD 0.99.0

Gif:
video_2019-05-10_21-42-59

<AauthForm>
    name: 'Auth Form'
    on_pre_enter: root.custom_on_pre_enter(app)

    MySpinner:
        id: update_spinner_layout

    BoxLayout:
        orientation: 'vertical'
        padding: dp(app.padding), dp(app.padding)
        spacing: dp(30)
        size_hint_y: 1
        size_hint_x: 1


        AnchorLayout:
            anchor_x: 'center'
            anchor_y: 'center'
            size_hint_y: 1
            size_hint_x: 1

            BoxLayout:
                orientation: 'vertical'
                size_hint_y: .2
                size_hint_x: .5
                spacing: 20

                BoxLayout:
                    size_hint_y: .5
                    size_hint_x: 1

                    MDTextField:
                        id: token_input
                        hint_text: app.transl_text("Enter your Token")
                        pos_hint: {'center_y': .5, 'center_x': .5}

                BoxLayout:
                    size_hint_y: .4
                    size_hint_x: .4
                    pos_hint: {'center_y': .5, 'center_x': .5}

                    MDRaisedButton:
                        id: login_button
                        text: app.transl_text('Login')
                        size_hint_x: .4
                        size_hint_y: .9
                        on_press: root.login()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.