Skip to content

Commit

Permalink
2.0.0 - Material Design 3
Browse files Browse the repository at this point in the history
Add new example.
  • Loading branch information
HeaTTheatR committed Dec 19, 2023
1 parent 9ecdb45 commit 2dd6b46
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions examples/bottomsheet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from kivy.lang import Builder

from kivymd.app import MDApp

from examples.common_app import CommonApp

KV = """
MDScreen:
md_bg_color: self.theme_cls.backgroundColor
MDIconButton:
on_release: app.open_menu(self)
pos_hint: {"top": .98}
x: root.width - (self.width + dp(24))
icon: "menu"
MDNavigationLayout:
MDScreenManager:
MDScreen:
MDBoxLayout:
spacing: "24dp"
pos_hint: {"center_x": .5, "center_y": .7}
adaptive_size: True
MDButton:
on_release: app.open_sheet(sheet, "standard")
MDButtonText:
text: "Open standard sheet"
MDButton:
on_release: app.open_sheet(sheet, "modal")
MDButtonText:
text: "Open modal sheet"
MDBottomSheet:
id: sheet
size_hint_y: None
height: "320dp"
background_color: self.theme_cls.surfaceColor
drawer_type: "standard"
MDBottomSheetDragHandle:
MDBottomSheetDragHandleTitle:
text: "MDBottomSheet"
adaptive_height: True
pos_hint: {"center_y": .5}
MDBottomSheetDragHandleButton:
icon: "close"
on_release: sheet.set_state("toggle")
BoxLayout:
orientation: "vertical"
Widget:
"""


class Example(MDApp, CommonApp):
def build(self):
self.theme_cls.primary_palette = "Olive"
return Builder.load_string(KV)

def open_sheet(self, sheet, drawer_type):
sheet.drawer_type = drawer_type
sheet.set_state("toggle")

def disabled_widgets(self):
...


Example().run()

0 comments on commit 2dd6b46

Please sign in to comment.