diff --git a/examples/bottomappbar.py b/examples/bottomappbar.py index c87caa1e1..2c0121c07 100644 --- a/examples/bottomappbar.py +++ b/examples/bottomappbar.py @@ -172,7 +172,6 @@ async def generate_card(): } ) - super().on_start() self.on_tap_card() fake = Faker() Clock.schedule_once(lambda x: asynckivy.start(generate_card())) diff --git a/examples/button.py b/examples/button.py index ab3c5cc28..c1d9a4104 100644 --- a/examples/button.py +++ b/examples/button.py @@ -191,7 +191,6 @@ def disabled_widgets(self): button.disabled = not button.disabled def on_start(self): - super().on_start() styles = ["standard", "filled", "outlined", "tonal"] color_disabled = [ 0.4627450980392157, diff --git a/examples/card.py b/examples/card.py index 1c828a9cf..3a9dcd8db 100644 --- a/examples/card.py +++ b/examples/card.py @@ -45,7 +45,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() color_disabled = [ 0.4627450980392157, 0.47058823529411764, diff --git a/examples/checkbox.py b/examples/checkbox.py index 8f7159530..29f9c2e98 100644 --- a/examples/checkbox.py +++ b/examples/checkbox.py @@ -11,7 +11,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() self.root.ids.widget_box.add_widget(MDCheckbox()) self.root.ids.custom_widget_box.add_widget( MDCheckbox( diff --git a/examples/chip.py b/examples/chip.py index ff03c16cc..9983f6922 100644 --- a/examples/chip.py +++ b/examples/chip.py @@ -12,7 +12,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for chip_type in ["assist", "input", "suggestion", "filter"]: self.root.ids.widget_box.add_widget( MDChip( diff --git a/examples/dynamic_color_image.py b/examples/dynamic_color_image.py index 9fb96943f..2ddaf7fdb 100644 --- a/examples/dynamic_color_image.py +++ b/examples/dynamic_color_image.py @@ -84,7 +84,6 @@ def generate_cards(self, *args): ) def on_start(self): - super().on_start() Clock.schedule_once(self.generate_cards) diff --git a/examples/dynamic_color_schemes.py b/examples/dynamic_color_schemes.py index c0e22deb4..b6e829289 100644 --- a/examples/dynamic_color_schemes.py +++ b/examples/dynamic_color_schemes.py @@ -57,7 +57,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() parent_widget = self.root.ids.widget_box.parent.parent parent_widget.clear_widgets() self.container = Container() diff --git a/examples/expansionpanel.py b/examples/expansionpanel.py index d9c686955..4a678a66a 100644 --- a/examples/expansionpanel.py +++ b/examples/expansionpanel.py @@ -105,7 +105,6 @@ async def set_panel_list(): await asynckivy.sleep(0) self.root.ids.container.add_widget(ExpansionPanelItem()) - super().on_start() asynckivy.start(set_panel_list()) def build(self): diff --git a/examples/label.py b/examples/label.py index 4e358098d..446016a3a 100644 --- a/examples/label.py +++ b/examples/label.py @@ -61,7 +61,6 @@ def create_widgets(self): ) def on_start(self): - super().on_start() self.create_widgets() diff --git a/examples/list.py b/examples/list.py index e8a3b1864..81a09df98 100644 --- a/examples/list.py +++ b/examples/list.py @@ -24,7 +24,6 @@ def on_tap_list_item(self, list_item: MDListItem): print("on_tap_list_item") def on_start(self): - super().on_start() self.root.ids.widget_box.orientation = "vertical" self.root.ids.widget_box.add_widget( MDListItem( diff --git a/examples/material_scroll.py b/examples/material_scroll.py index 85ec92e02..41d9263f7 100644 --- a/examples/material_scroll.py +++ b/examples/material_scroll.py @@ -83,7 +83,6 @@ def build(self): return Builder.load_string(MAIN_KV) def on_start(self): - super().on_start() info = { "Name": [ os.name, diff --git a/examples/navigation_bar.py b/examples/navigation_bar.py index bfb6fa461..0de30fc80 100644 --- a/examples/navigation_bar.py +++ b/examples/navigation_bar.py @@ -26,7 +26,6 @@ def on_switch_tabs( ... def on_start(self): - super().on_start() self.root.ids.widget_box.height = dp(80) self.root.ids.widget_box.add_widget( MDNavigationBar( diff --git a/examples/slider.py b/examples/slider.py index 212c6a996..c88d298a9 100644 --- a/examples/slider.py +++ b/examples/slider.py @@ -12,7 +12,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() self.root.ids.widget_box.add_widget( MDSlider( MDSliderHandle(), diff --git a/examples/snackbar.py b/examples/snackbar.py index a7c7af0df..29397cad9 100644 --- a/examples/snackbar.py +++ b/examples/snackbar.py @@ -43,7 +43,6 @@ def disabled_widgets(self): ... def on_start(self): - super().on_start() data = { "Single-line snackbar": self.show_snack_single_line, "Single-line snackbar with action": self.show_snack_single_line_with_action, diff --git a/examples/switch.py b/examples/switch.py index 6c8062df5..21405e130 100644 --- a/examples/switch.py +++ b/examples/switch.py @@ -11,7 +11,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() self.root.ids.widget_box.add_widget( MDSwitch( icon_active="check", diff --git a/examples/tab.py b/examples/tab.py index ea96587fb..f20f795df 100644 --- a/examples/tab.py +++ b/examples/tab.py @@ -49,7 +49,6 @@ class Example(MDApp, CommonApp): def on_start(self): - super().on_start() for type_tabs in ["primary", "secondary"]: if type_tabs == "primary": tabs = self.root.ids.primary_tabs diff --git a/examples/textfield.py b/examples/textfield.py index 0c87ef6b3..1c4a54314 100644 --- a/examples/textfield.py +++ b/examples/textfield.py @@ -18,7 +18,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for mode in ["outlined", "filled", "required"]: self.root.ids.widget_box.add_widget( MDTextField( diff --git a/kivymd/app.py b/kivymd/app.py index f9ef372fd..40a31a1e5 100644 --- a/kivymd/app.py +++ b/kivymd/app.py @@ -28,7 +28,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() self.fps_monitor_start() @@ -50,7 +49,6 @@ def build(self): [...] def on_start(self): - super().on_start() [...] """ @@ -135,27 +133,13 @@ def __init__(self, **kwargs): super().__init__(**kwargs) self.theme_cls = ThemeManager() - def on_start(self): - """ - Event handler for the `on_start` event which is fired after - initialization (after build() has been called) but before the - application has started running. - - .. versionadded:: 2.0.0 - """ - - def on_start(*args): - self.theme_cls.bind( - theme_style=lambda *x: Clock.schedule_once( - self.theme_cls.update_theme_colors, 0.1 - ), - primary_palette=lambda *x: Clock.schedule_once( - self.theme_cls.set_colors, 0.1 - ), - ) - self.theme_cls.set_colors() - - Clock.schedule_once(on_start) + def _run_prepare(self): + self.theme_cls.bind( + theme_style=self.theme_cls.update_theme_colors, + primary_palette=self.theme_cls.set_colors + ) + self.theme_cls.set_colors() + super()._run_prepare() def load_all_kv_files(self, path_to_directory: str) -> None: """ diff --git a/kivymd/dynamic_color.py b/kivymd/dynamic_color.py index f67070049..bbe8b2679 100644 --- a/kivymd/dynamic_color.py +++ b/kivymd/dynamic_color.py @@ -163,7 +163,6 @@ def generate_cards(self, *args): ) def on_start(self): - super().on_start() Clock.schedule_once(self.generate_cards) @@ -267,7 +266,6 @@ def generate_cards(self, *args): ) def on_start(self): - super().on_start() Clock.schedule_once(self.generate_cards) diff --git a/kivymd/icon_definitions.py b/kivymd/icon_definitions.py index c5ff64cd2..a45366a49 100755 --- a/kivymd/icon_definitions.py +++ b/kivymd/icon_definitions.py @@ -114,7 +114,6 @@ def build(self): return self.screen def on_start(self): - super().on_start() self.screen.set_list_md_icons() @@ -7669,7 +7668,6 @@ def build(self): return self.screen def on_start(self): - super().on_start() self.screen.set_list_md_icons() MainApp().run() diff --git a/kivymd/tests/button/test_bg_color_after_changed_theme.py b/kivymd/tests/button/test_bg_color_after_changed_theme.py index 4bd6f8c81..1a70ddf82 100644 --- a/kivymd/tests/button/test_bg_color_after_changed_theme.py +++ b/kivymd/tests/button/test_bg_color_after_changed_theme.py @@ -40,7 +40,6 @@ def change_palette(self, *args): Clock.schedule_once(self.check_button_colors, 1.2) def on_start(self): - super().on_start() Clock.schedule_once(self.change_palette, 1.2) diff --git a/kivymd/tests/button/test_fab_size_m3_style.py b/kivymd/tests/button/test_fab_size_m3_style.py index b17256feb..6e0373b7a 100644 --- a/kivymd/tests/button/test_fab_size_m3_style.py +++ b/kivymd/tests/button/test_fab_size_m3_style.py @@ -31,7 +31,6 @@ def check_size_button(self, *args): self.stop() def on_start(self): - super().on_start() styles = ["standard", "small", "large"] for style in styles: self.root.ids.box.add_widget( diff --git a/kivymd/tests/button/test_icon_button_md_bg_color_disabled.py b/kivymd/tests/button/test_icon_button_md_bg_color_disabled.py index c20bd0b23..53e41e883 100644 --- a/kivymd/tests/button/test_icon_button_md_bg_color_disabled.py +++ b/kivymd/tests/button/test_icon_button_md_bg_color_disabled.py @@ -29,7 +29,6 @@ def check_button_md_bg_color_disabled(self, button): ].rgba == [1.0, 0.0, 0.0, 1.0] def on_start(self): - super().on_start() self.generate_buttons() diff --git a/kivymd/tests/button/test_md_icon_button_icon_size.py b/kivymd/tests/button/test_md_icon_button_icon_size.py index ff175da38..eea5f85c8 100644 --- a/kivymd/tests/button/test_md_icon_button_icon_size.py +++ b/kivymd/tests/button/test_md_icon_button_icon_size.py @@ -27,7 +27,6 @@ def check_icon_size(self, *args): self.stop() def on_start(self): - super().on_start() Clock.schedule_once(self.check_icon_size, 1.2) diff --git a/kivymd/tests/button/test_on_release.py b/kivymd/tests/button/test_on_release.py index 74653a36f..5313a71d8 100644 --- a/kivymd/tests/button/test_on_release.py +++ b/kivymd/tests/button/test_on_release.py @@ -32,7 +32,6 @@ def press_button(self, *args): Clock.schedule_once(self.check_release_flag, 2) def on_start(self): - super().on_start() Clock.schedule_once(self.press_button, 1) diff --git a/kivymd/tests/button/test_outline_button_custom_color.py b/kivymd/tests/button/test_outline_button_custom_color.py index b871c4d2c..1ae08e3e9 100644 --- a/kivymd/tests/button/test_outline_button_custom_color.py +++ b/kivymd/tests/button/test_outline_button_custom_color.py @@ -26,7 +26,6 @@ def check_button_colors(self, *args): self.stop() def on_start(self): - super().on_start() Clock.schedule_once(self.check_button_colors, 1.2) diff --git a/kivymd/tests/button/test_outline_button_custom_color_after_disabled.py b/kivymd/tests/button/test_outline_button_custom_color_after_disabled.py index 89679556d..b1761c1c4 100644 --- a/kivymd/tests/button/test_outline_button_custom_color_after_disabled.py +++ b/kivymd/tests/button/test_outline_button_custom_color_after_disabled.py @@ -39,7 +39,6 @@ def check_button_colors_control(dt): Clock.schedule_once(check_button_colors_control, 1.2) def on_start(self): - super().on_start() Clock.schedule_once(self.check_button_colors, 1.2) diff --git a/kivymd/tests/button/test_size_hint.py b/kivymd/tests/button/test_size_hint.py index be5a28c4f..9a0b5f0f7 100644 --- a/kivymd/tests/button/test_size_hint.py +++ b/kivymd/tests/button/test_size_hint.py @@ -22,7 +22,6 @@ def check_button_size(self, button): self.stop() def on_start(self): - super().on_start() self.generate_buttons() diff --git a/kivymd/tests/hero/test_with_first_screen_without_hero.py b/kivymd/tests/hero/test_with_first_screen_without_hero.py index eadce5f51..f0b357928 100644 --- a/kivymd/tests/hero/test_with_first_screen_without_hero.py +++ b/kivymd/tests/hero/test_with_first_screen_without_hero.py @@ -89,7 +89,6 @@ def set_screen_with_hero_from(self, *args): Clock.schedule_once(self.move_hero_to_another_screen, 1) def on_start(self): - super().on_start() Clock.schedule_once(self.set_screen_with_hero_from, 1) diff --git a/kivymd/tests/label/test_allow_copy.py b/kivymd/tests/label/test_allow_copy.py index 5ac5a3ba0..6298095cd 100644 --- a/kivymd/tests/label/test_allow_copy.py +++ b/kivymd/tests/label/test_allow_copy.py @@ -30,7 +30,6 @@ def on_start(*args): touch = MouseMotionEvent("mouse", "button", self.root.ids.label.pos) self.root.ids.label.on_double_tap(touch, ()) - super().on_start() Clock.schedule_once(on_start, 1) diff --git a/kivymd/tests/label/test_color_deselection.py b/kivymd/tests/label/test_color_deselection.py index 0ff3ac6bb..ab9472d2b 100644 --- a/kivymd/tests/label/test_color_deselection.py +++ b/kivymd/tests/label/test_color_deselection.py @@ -26,7 +26,6 @@ def check_selection(self, *args): self.stop() def on_start(self): - super().on_start() self.touch = MouseMotionEvent( "mouse", "button", self.root.ids.label.pos ) diff --git a/kivymd/tests/label/test_color_selection.py b/kivymd/tests/label/test_color_selection.py index f234f4227..c8f088172 100644 --- a/kivymd/tests/label/test_color_selection.py +++ b/kivymd/tests/label/test_color_selection.py @@ -26,7 +26,6 @@ def check_selection(self, *args): self.stop() def on_start(self): - super().on_start() touch = MouseMotionEvent("mouse", "button", self.root.ids.label.pos) self.root.ids.label.on_double_tap(touch, ()) Clock.schedule_once(self.check_selection) diff --git a/kivymd/tests/label/test_default_theme_text_color.py b/kivymd/tests/label/test_default_theme_text_color.py index 99e8a835a..f41f9e7f2 100644 --- a/kivymd/tests/label/test_default_theme_text_color.py +++ b/kivymd/tests/label/test_default_theme_text_color.py @@ -29,7 +29,6 @@ async def generate_labels(self): self.stop() def on_start(self): - super().on_start() asynckivy.start(self.generate_labels()) diff --git a/kivymd/tests/label/test_disabled_color.py b/kivymd/tests/label/test_disabled_color.py index 2f6238964..fd8defdd5 100644 --- a/kivymd/tests/label/test_disabled_color.py +++ b/kivymd/tests/label/test_disabled_color.py @@ -27,7 +27,6 @@ def check_disabled_color(self, *args): self.stop() def on_start(self): - super().on_start() Clock.schedule_once(self.check_disabled_color, 1) diff --git a/kivymd/tests/label/test_font_size_in_python_code.py b/kivymd/tests/label/test_font_size_in_python_code.py index d6872e899..975c2eb7b 100644 --- a/kivymd/tests/label/test_font_size_in_python_code.py +++ b/kivymd/tests/label/test_font_size_in_python_code.py @@ -27,7 +27,6 @@ def build(self): ) def on_start(self): - super().on_start() Clock.schedule_once(self.check_font_size, 1.2) diff --git a/kivymd/tests/label/test_font_style.py b/kivymd/tests/label/test_font_style.py index 7a45ef252..b96cdedbd 100644 --- a/kivymd/tests/label/test_font_style.py +++ b/kivymd/tests/label/test_font_style.py @@ -60,7 +60,6 @@ def on_start(*args): ) self.stop() - super().on_start() Clock.schedule_once(on_start, 2) diff --git a/kivymd/tests/label/test_md_icon_badge_colors.py b/kivymd/tests/label/test_md_icon_badge_colors.py index 6b6bccd90..a12499c23 100644 --- a/kivymd/tests/label/test_md_icon_badge_colors.py +++ b/kivymd/tests/label/test_md_icon_badge_colors.py @@ -27,7 +27,6 @@ def check_badge_colors(self, *args): self.stop() def on_start(self): - super().on_start() Clock.schedule_once(self.check_badge_colors, 2) diff --git a/kivymd/tests/label/test_md_icon_badge_colors_after_disabled.py b/kivymd/tests/label/test_md_icon_badge_colors_after_disabled.py index 162e70cd4..7152518ab 100644 --- a/kivymd/tests/label/test_md_icon_badge_colors_after_disabled.py +++ b/kivymd/tests/label/test_md_icon_badge_colors_after_disabled.py @@ -31,7 +31,6 @@ def check_badge_colors(self, *args): self.stop() def on_start(self): - super().on_start() Clock.schedule_once(self.icon_undisabled, 1) Clock.schedule_once(self.check_badge_colors, 2) diff --git a/kivymd/tests/label/test_switch_theme.py b/kivymd/tests/label/test_switch_theme.py index 1cd4a9839..6814be315 100644 --- a/kivymd/tests/label/test_switch_theme.py +++ b/kivymd/tests/label/test_switch_theme.py @@ -39,7 +39,6 @@ def switch_screen_two(self, *args): self.root.current = "screen two" def on_start(self): - super().on_start() Clock.schedule_once(self.switch_screen_two, 1) def build(self): diff --git a/kivymd/tests/label/test_theme_text_color.py b/kivymd/tests/label/test_theme_text_color.py index 9e9387d67..57b2c9330 100644 --- a/kivymd/tests/label/test_theme_text_color.py +++ b/kivymd/tests/label/test_theme_text_color.py @@ -24,7 +24,6 @@ def on_start(*args): assert self.root.ids.label.text_color == [1.0, 0.0, 0.0, 1.0] self.stop() - super().on_start() Clock.schedule_once(on_start, 2) diff --git a/kivymd/tests/list/test_disable.py b/kivymd/tests/list/test_disable.py index e956d4189..ad406d388 100644 --- a/kivymd/tests/list/test_disable.py +++ b/kivymd/tests/list/test_disable.py @@ -71,7 +71,6 @@ def _disable(*args): self.root.ids.item4.disabled = True Clock.schedule_once(_enabled, 1) - super().on_start() Clock.schedule_once(_disable, 1) diff --git a/kivymd/tests/test_md_bg_color_layouts.py b/kivymd/tests/test_md_bg_color_layouts.py index a917dd00f..874f9bc41 100644 --- a/kivymd/tests/test_md_bg_color_layouts.py +++ b/kivymd/tests/test_md_bg_color_layouts.py @@ -44,7 +44,6 @@ async def generate_layouts(self): self.stop() def on_start(self): - super().on_start() asynckivy.start(self.generate_layouts()) def check_md_bg_color(self, widget): diff --git a/kivymd/tests/textfield/test_disabled_text_color.py b/kivymd/tests/textfield/test_disabled_text_color.py index 3f4cf70ff..3ff5b70eb 100644 --- a/kivymd/tests/textfield/test_disabled_text_color.py +++ b/kivymd/tests/textfield/test_disabled_text_color.py @@ -50,7 +50,6 @@ def check_colors(self, *args): self.stop() def on_start(self): - super().on_start() Clock.schedule_once(self.check_colors, 2) diff --git a/kivymd/tests/textfield/test_disabled_text_color_switch_theme.py b/kivymd/tests/textfield/test_disabled_text_color_switch_theme.py index 6053cceb0..edf78a94c 100644 --- a/kivymd/tests/textfield/test_disabled_text_color_switch_theme.py +++ b/kivymd/tests/textfield/test_disabled_text_color_switch_theme.py @@ -55,7 +55,6 @@ def change_theme(self, *args): Clock.schedule_once(self.check_colors, 3) def on_start(self): - super().on_start() Clock.schedule_once(self.change_theme, 2) diff --git a/kivymd/tests/textfield/test_error_state.py b/kivymd/tests/textfield/test_error_state.py index a4e4c3173..49d11fc3c 100644 --- a/kivymd/tests/textfield/test_error_state.py +++ b/kivymd/tests/textfield/test_error_state.py @@ -72,7 +72,6 @@ def set_max_text_length(self, *args): Clock.schedule_once(self.check_colors, 2) def on_start(self): - super().on_start() Clock.schedule_once(self.set_max_text_length, 2) diff --git a/kivymd/tests/textfield/test_error_state_color_helper_text_mode_on_focus.py b/kivymd/tests/textfield/test_error_state_color_helper_text_mode_on_focus.py index bcb07c693..38a6f9e14 100644 --- a/kivymd/tests/textfield/test_error_state_color_helper_text_mode_on_focus.py +++ b/kivymd/tests/textfield/test_error_state_color_helper_text_mode_on_focus.py @@ -67,7 +67,6 @@ def check_helper_text_focus(self, *args): Clock.schedule_once(self.check_helper_text_focus, 2) def on_start(self): - super().on_start() Clock.schedule_once(self.check_helper_text_focus, 2) diff --git a/kivymd/tests/textfield/test_helper_text_mode_on_focus.py b/kivymd/tests/textfield/test_helper_text_mode_on_focus.py index 87bcec0b2..ce3a63706 100644 --- a/kivymd/tests/textfield/test_helper_text_mode_on_focus.py +++ b/kivymd/tests/textfield/test_helper_text_mode_on_focus.py @@ -69,7 +69,6 @@ def check_helper_text_focus(self, *args): Clock.schedule_once(self.check_helper_text_focus, 2) def on_start(self): - super().on_start() Clock.schedule_once(self.check_helper_text_focus, 2) diff --git a/kivymd/tests/textfield/test_helper_text_mode_persistent.py b/kivymd/tests/textfield/test_helper_text_mode_persistent.py index 8c513b1ff..d87032db5 100644 --- a/kivymd/tests/textfield/test_helper_text_mode_persistent.py +++ b/kivymd/tests/textfield/test_helper_text_mode_persistent.py @@ -50,7 +50,6 @@ def check_helper_text_without_focus(self, *args): Clock.schedule_once(self.check_helper_text_without_focus, 5) def on_start(self): - super().on_start() Clock.schedule_once(self.check_helper_text_without_focus, 2) diff --git a/kivymd/theming.py b/kivymd/theming.py index 4f3811658..5b4692fce 100755 --- a/kivymd/theming.py +++ b/kivymd/theming.py @@ -225,7 +225,6 @@ def callback(permission, results): if all([res for res in results]): Clock.schedule_once(self.set_dynamic_color) - super().on_start() if platform == "android": from android.permissions import Permission, request_permissions @@ -383,7 +382,6 @@ def on_start(self): def on_start(*args): self.root.md_bg_color = self.theme_cls.backgroundColor - super().on_start() Clock.schedule_once(on_start) def switch_theme_style(self, *args): @@ -459,7 +457,6 @@ def on_start(self): def on_start(*args): self.root.md_bg_color = self.theme_cls.backgroundColor - super().on_start() Clock.schedule_once(on_start) diff --git a/kivymd/uix/appbar/appbar.py b/kivymd/uix/appbar/appbar.py index 33c061064..176c98dd1 100755 --- a/kivymd/uix/appbar/appbar.py +++ b/kivymd/uix/appbar/appbar.py @@ -440,7 +440,6 @@ async def generate_card(): } ) - super().on_start() self.on_tap_card() fake = Faker() Clock.schedule_once(lambda x: asynckivy.start(generate_card())) diff --git a/kivymd/uix/behaviors/declarative_behavior.py b/kivymd/uix/behaviors/declarative_behavior.py index 28450c614..de9409307 100644 --- a/kivymd/uix/behaviors/declarative_behavior.py +++ b/kivymd/uix/behaviors/declarative_behavior.py @@ -266,7 +266,6 @@ def on_start(self): # 'box_container_1': , # 'box_container_2': , # } - super().on_start() print(self.root.get_ids()) diff --git a/kivymd/uix/button/button.py b/kivymd/uix/button/button.py index d76c16054..bac35d84a 100755 --- a/kivymd/uix/button/button.py +++ b/kivymd/uix/button/button.py @@ -489,7 +489,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() styles = { "standard": "surface", "small": "secondary", diff --git a/kivymd/uix/card/card.py b/kivymd/uix/card/card.py index 3bb55a0e2..5ecfc8f1a 100755 --- a/kivymd/uix/card/card.py +++ b/kivymd/uix/card/card.py @@ -93,7 +93,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for style in ("elevated", "filled", "outlined"): self.root.ids.box.add_widget( MyCard(style=style, text=style.capitalize()) @@ -135,7 +134,6 @@ def build(self): ) def on_start(self): - super().on_start() for style in ("elevated", "filled", "outlined"): self.root.ids.box.add_widget( MyCard( @@ -353,7 +351,6 @@ def remove_item(self, instance): self.screen.ids.md_list.remove_widget(instance) def on_start(self): - super().on_start() for i in range(20): self.screen.ids.md_list.add_widget( SwipeToDeleteItem(text=f"One-line item {i}") @@ -395,7 +392,6 @@ def build(self): def on_start(self): '''Creates a list of cards.''' - super().on_start() for i in range(20): self.root.ids.scroll.ids.md_list.add_widget( MDCardSwipe( diff --git a/kivymd/uix/chip/chip.py b/kivymd/uix/chip/chip.py index 286f2405a..71d33d39e 100755 --- a/kivymd/uix/chip/chip.py +++ b/kivymd/uix/chip/chip.py @@ -363,7 +363,6 @@ def build(self) -> PreviewIconsScreen: return self.screen def on_start(self) -> None: - super().on_start() self.screen.set_list_md_icons() self.screen.set_filter_chips() @@ -450,7 +449,6 @@ def build(self) -> ChipScreen: return self.screen def on_start(self) -> None: - super().on_start() asynckivy.start(self.screen.create_chips()) @@ -534,7 +532,6 @@ def build(self) -> ChipScreen: return self.screen def on_start(self) -> None: - super().on_start() asynckivy.start(self.screen.create_chips()) diff --git a/kivymd/uix/circularlayout.py b/kivymd/uix/circularlayout.py index cb7345919..f7b343b37 100644 --- a/kivymd/uix/circularlayout.py +++ b/kivymd/uix/circularlayout.py @@ -31,7 +31,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for x in range(1, 49): self.root.ids.container.add_widget(Label(text=f"{x}") @@ -199,7 +198,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for x in range(1, 49): self.root.ids.container.add_widget(Label(text=f"{x}")) diff --git a/kivymd/uix/dialog/dialog.py b/kivymd/uix/dialog/dialog.py index de09b061f..1eddfa145 100755 --- a/kivymd/uix/dialog/dialog.py +++ b/kivymd/uix/dialog/dialog.py @@ -152,7 +152,6 @@ def build(self): return Widget() def on_start(self): - super().on_start() MDDialog( title="Discard draft?", buttons=[ @@ -189,7 +188,6 @@ def build(self): return Widget() def on_start(self): - super().on_start() MDDialog( title="Discard draft?", text="This will reset your device to its default factory settings.", @@ -243,7 +241,6 @@ def build(self): return Widget() def on_start(self): - super().on_start() MDDialog( title="Set backup account", type="simple", @@ -277,7 +274,6 @@ def build(self): return MDWidget(md_bg_color=self.theme_cls.backgroundColor) def on_start(self): - super().on_start() MDDialog( MDDialogHeadlineText( text="Discard draft?", @@ -318,7 +314,6 @@ def build(self): return MDWidget(md_bg_color=self.theme_cls.backgroundColor) def on_start(self): - super().on_start() MDDialog( MDDialogHeadlineText( text="Discard draft?", @@ -370,7 +365,6 @@ def build(self): return MDWidget(md_bg_color=self.theme_cls.backgroundColor) def on_start(self): - super().on_start() MDDialog( MDDialogHeadlineText( text="Set backup account", diff --git a/kivymd/uix/expansionpanel/expansionpanel.py b/kivymd/uix/expansionpanel/expansionpanel.py index 78767c855..670e701da 100755 --- a/kivymd/uix/expansionpanel/expansionpanel.py +++ b/kivymd/uix/expansionpanel/expansionpanel.py @@ -232,7 +232,6 @@ async def set_panel_list(): await asynckivy.sleep(0) self.root.ids.container.add_widget(ExpansionPanelItem()) - super().on_start() asynckivy.start(set_panel_list()) def build(self): diff --git a/kivymd/uix/hero.py b/kivymd/uix/hero.py index 144d5ea5d..dba8931b4 100644 --- a/kivymd/uix/hero.py +++ b/kivymd/uix/hero.py @@ -496,7 +496,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for i in range(12): hero_item = HeroItem( text=f"Item {i + 1}", tag=f"Tag {i}", manager=self.root diff --git a/kivymd/uix/label/label.py b/kivymd/uix/label/label.py index 0d7adb515..5c9dfa6c2 100755 --- a/kivymd/uix/label/label.py +++ b/kivymd/uix/label/label.py @@ -154,7 +154,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for style in theme_font_styles: if style != "Icon": for role in theme_font_styles[style]: @@ -228,7 +227,6 @@ def on_start(self): def on_start(dt): self.root.md_bg_color = self.theme_cls.backgroundColor - super().on_start() Clock.schedule_once(on_start) def build(self): @@ -317,7 +315,6 @@ def build(self): ) def on_start(self): - super().on_start() self.root.ids.label.bind(on_copy=self.on_copy) def on_copy(self, instance_label: MDLabel): @@ -398,7 +395,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for text in data: copy_label = CopyLabel(text=text) copy_label.bind(on_selection=self.open_context_menu) diff --git a/kivymd/uix/menu/menu.py b/kivymd/uix/menu/menu.py index bd02a471d..eabdc9cbb 100755 --- a/kivymd/uix/menu/menu.py +++ b/kivymd/uix/menu/menu.py @@ -1407,7 +1407,6 @@ def open_menu(self, caller): self.menu.open() def on_start(self): - super().on_start() pos_hints = [ {"top": 1, "left": 0.1}, {"top": 1, "center_x": 0.5}, diff --git a/kivymd/uix/progressindicator/progressindicator.py b/kivymd/uix/progressindicator/progressindicator.py index 2601805f6..2e5051206 100755 --- a/kivymd/uix/progressindicator/progressindicator.py +++ b/kivymd/uix/progressindicator/progressindicator.py @@ -105,7 +105,6 @@ def build(self): class Example(MDApp): def on_start(self): - super().on_start() self.root.ids.progress.start() def build(self): diff --git a/kivymd/uix/segmentedbutton/segmentedbutton.py b/kivymd/uix/segmentedbutton/segmentedbutton.py index 6d656f076..9f8d1d571 100644 --- a/kivymd/uix/segmentedbutton/segmentedbutton.py +++ b/kivymd/uix/segmentedbutton/segmentedbutton.py @@ -180,7 +180,6 @@ class Example(MDApp): def on_start(self): - super().on_start() for segment_type in ["large", "normal", "medium", "small"]: self.root.ids.box.add_widget( MDBoxLayout( diff --git a/kivymd/uix/sliverappbar/sliverappbar.py b/kivymd/uix/sliverappbar/sliverappbar.py index 9cd0e9f85..a16e59fdc 100644 --- a/kivymd/uix/sliverappbar/sliverappbar.py +++ b/kivymd/uix/sliverappbar/sliverappbar.py @@ -123,7 +123,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for x in range(10): self.root.ids.content.add_widget(GuitarItem()) diff --git a/kivymd/uix/tab/tab.py b/kivymd/uix/tab/tab.py index f2f2a71b9..dc760336b 100755 --- a/kivymd/uix/tab/tab.py +++ b/kivymd/uix/tab/tab.py @@ -54,7 +54,6 @@ class Example(MDApp): def on_start(self): - super().on_start() for tab_icon, tab_name in { "airplane": "Flights", "treasure-chest": "Trips", @@ -135,7 +134,6 @@ def build(self): class Example(MDApp): def on_start(self): - super().on_start() for tab_icon, tab_name in { "airplane": "Flights", "treasure-chest": "Trips", @@ -218,7 +216,6 @@ def build(self): class Example(MDApp): def on_start(self): - super().on_start() for tab_icon, tab_name in { "airplane": "Flights", "treasure-chest": "Trips", @@ -286,7 +283,6 @@ def build(self): class Example(MDApp): def on_start(self): - super().on_start() for tab_name in [ "Moscow", "Saint Petersburg", @@ -347,7 +343,6 @@ def build(self): class Example(MDApp): def on_start(self): - super().on_start() for tab_name in [ "Moscow", "Saint Petersburg", "Novosibirsk" ]: @@ -451,7 +446,6 @@ def build(self): return Builder.load_string(KV) def on_start(self): - super().on_start() for name_tab in self.icons: self.root.ids.tabs.add_widget( Tab(title=name_tab, icon=name_tab) @@ -493,7 +487,6 @@ def on_start(self): class Example(MDApp): def on_start(self): - super().on_start() for name_tab in list(md_icons.keys())[15:30]: self.root.ids.tabs.add_widget( MDTabsItem( diff --git a/md_axis_transition.py b/md_axis_transition.py new file mode 100644 index 000000000..47249083f --- /dev/null +++ b/md_axis_transition.py @@ -0,0 +1,221 @@ +from kivy.lang import Builder +import os +import kivymd +from kivymd.app import MDApp +from kivy.uix.screenmanager import ScreenManager +from kivymd.uix.screen import MDScreen +from kivymd.uix.transition import MDSharedAxisTransition +from examples.common_app import CommonApp + +KV = """ +: + group: 'group' + size_hint: None, 1 + width:self.height + +: + icon:"wifi" + text:"Network & Internet" + subtext:"Network settings" + size_hint_y:None + height:dp(70) + padding:dp(10) + spacing:dp(10) + on_release: + app.root.get_screen("battery").ids.main_icon.icon = self.icon + app.root.get_screen("battery").ids.main_text.text = self.text + app.root.transition.opposite = False + app.root.current = "battery" + MDIconButton: + style: "tonal" + size_hint:None, 1 + width:self.height + icon:root.icon + BoxLayout: + orientation:"vertical" + MDLabel: + text:root.text + font_style:"Title" + role:"medium" + MDLabel: + text:root.subtext + font_style:"Label" + role:"large" + theme_text_color:"Custom" + text_color:app.theme_cls.surfaceContainerLowestColor[:-1] + [0.5] + +: + name:"main" + md_bg_color:app.theme_cls.surfaceContainerLowColor + MDBoxLayout: + padding:[dp(10), 0] + orientation:"vertical" + BoxLayout: + size_hint_y:None + height:dp(70) + padding:[0, dp(10)] + MDIconButton: + size_hint:None, None + size:[dp(50)] * 2 + on_release: app.open_menu(self) + icon: "menu" + Widget: + MDIconButton: + size_hint:None, None + size:[dp(50)] * 2 + on_release: app.open_menu(self) + icon: "magnify" + MDIconButton: + size_hint:None, None + size:[dp(50)] * 2 + on_release: app.open_menu(self) + icon: "dots-vertical" + MDLabel: + text:"Settings" + halign:"center" + theme_font_size:"Custom" + font_size:"30sp" + style:"bold" + size_hint_y:None + height:dp(70) + MDBoxLayout: + md_bg_color:app.theme_cls.surfaceContainerHighColor + padding:[dp(10), 0] + radius:[self.height / 2]*4 + size_hint_y:None + height:dp(60) + padding:[dp(10), dp(10)] + spacing:dp(10) + MDIconButton: + size_hint_y:1 + icon:"magnify" + size_hint_x:None + width:self.height + MDLabel: + text:"Search in settings" + font_style:"Body" + role:"large" + theme_text_color:"Custom" + text_color:app.theme_cls.surfaceContainerLowestColor[:-1] + [0.5] + Image: + size_hint_y:1 + source:app.image_path + size_hint_x:None + width:self.height + BoxLayout: + size_hint_y:None + height:dp(20) + MDBoxLayout: + md_bg_color:app.theme_cls.surfaceContainerHighColor + radius:[dp(25)] * 4 + size_hint_y:None + height:self.minimum_height + orientation:"vertical" + SettingsItem: + icon:"wifi" + SettingsItem: + icon:"battery-90" + text:"Battery & Power" + subtext:"42% - About 14hr left" + SettingsItem: + icon:"palette-outline" + text:"Wallpaper & Style" + subtext:"Colors, theme style" + SettingsItem: + icon:"android" + text:"System Info" + subtext:"About system" + BoxLayout: + size_hint_y:None + height:dp(70) + padding:[(self.width - dp(50)*6), dp(25)] + spacing:dp(10) + Check: + active:True + on_active: + setattr(app.transition, "transition_axis", "x") if self.active else app + MDLabel: + size_hint_x:None + width:dp(50) + text:"X" + Check: + on_active: + setattr(app.transition, "transition_axis", "y") if self.active else app + MDLabel: + size_hint_x:None + width:dp(50) + text:"Y" + Check: + on_active: + setattr(app.transition, "transition_axis", "z") if self.active else app + MDLabel: + size_hint_x:None + width:dp(50) + text:"Z" + BoxLayout: + size_hint_y:None + height:dp(100) + orientation:"vertical" + MDLabel: + id:duration + text:"Duration: 0.2" + adaptive_height:True + halign:"center" + MDSlider: + size_hint_y:None + height:dp(50) + step: 10 + value: 10 + on_value: + duration.text = "Duration: " + str(self.value / 50) + app.transition.duration = self.value/50 + MDSliderHandle: + Widget: + +: + name:"battery" + md_bg_color:app.theme_cls.surfaceContainerLowColor + MDLabel: + id:main_text + text:"Battery" + halign:"center" + theme_font_size:"Custom" + font_size:"30sp" + style:"bold" + size_hint_y:None + height:dp(100) + pos_hint:{"center_y":0.8} + MDIconButton: + id:main_icon + icon:"wifi" + style:"tonal" + pos_hint:{"center_y":0.7, "center_x":0.5} + MDButton: + pos_hint:{"center_x":0.5, "center_y":0.5} + style: "filled" + on_release: + app.root.transition.opposite = True + app.root.current = "main" + MDButtonText: + text: "Go Back" + +MDScreenManager: + id:s_m + md_bg_color:app.theme_cls.surfaceContainerLowColor + transition:app.transition + SettingsScreen: + BatteryScreen: +""" + + +class ExampleApp(MDApp, CommonApp): + image_path = os.path.join( + kivymd.__path__[0], "images", "logo", "kivymd-icon-256.png" + ) + + def build(self): + self.transition = MDSharedAxisTransition() + return Builder.load_string(KV) + + +ExampleApp().run()