-
-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
from kivy.clock import Clock | ||
from kivy.core.clipboard import Clipboard | ||
from kivy.input.providers.mouse import MouseMotionEvent | ||
from kivy.lang.builder import Builder | ||
|
||
from kivymd.app import MDApp | ||
|
||
KV = """ | ||
MDScreen: | ||
MDBoxLayout: | ||
orientation: 'vertical' | ||
MDListItem: | ||
id: item1 | ||
MDListItemLeadingIcon: | ||
icon: "account" | ||
MDListItemHeadlineText: | ||
text: "Headline1" | ||
MDListItemSupportingText: | ||
text: "Supporting text" | ||
MDListItemTertiaryText: | ||
text: "Tertiary text" | ||
MDListItemTrailingCheckbox: | ||
MDListItem: | ||
id: item2 | ||
MDListItemHeadlineText: | ||
text: "Headline2" | ||
MDListItemSupportingText: | ||
text: "Supporting text" | ||
MDListItemTertiaryText: | ||
text: "Tertiary text" | ||
MDListItem: | ||
id: item3 | ||
MDListItemHeadlineText: | ||
text: "Headline3" | ||
MDListItem: | ||
id: item4 | ||
""" | ||
|
||
|
||
class TestDisableList(MDApp): | ||
def build(self): | ||
return Builder.load_string(KV) | ||
|
||
def on_start(self): | ||
def _enabled(*args): | ||
self.root.ids.item1.disabled = False | ||
self.root.ids.item2.disabled = False | ||
self.root.ids.item3.disabled = False | ||
self.root.ids.item4.disabled = False | ||
self.stop() | ||
|
||
def _disable(*args): | ||
self.root.ids.item1.disabled = True | ||
self.root.ids.item2.disabled = True | ||
self.root.ids.item3.disabled = True | ||
self.root.ids.item4.disabled = True | ||
Clock.schedule_once(_enabled, 1) | ||
|
||
super().on_start() | ||
Clock.schedule_once(_disable, 1) | ||
|
||
|
||
TestDisableList().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters