Code Monkey home page Code Monkey logo

kivy-lazy-loading-template's Introduction

Kivy Lazy Loading - Template

Enhance the performance of your Kivy app ๐Ÿš€ with lazy loading.

By implementing this template, you can enhance the performance of your Kivy app through the technique of lazy loading screens. Rather than loading all the screens at startup, this approach ensures that screens are loaded only when they are actively switched to. As a result, the startup time of your app can be significantly reduced.

This template also features a screen navigation system that simplifies handling the back button.

Navigation

The Root is based on ScreenManager and additionally provides a few navigation methods: push(screen_name, side), push_replacement(screen_name, side) and pop().

Also load_screen(screen_name) method can be used to load the screen and the kv file without setting it as the current screen.

To incorporate additional screens into your app, follow these steps:

  1. Create screen_file.py in the libs/uix/baseclass/ directory.
  2. Create screen_file.kv in the libs/uix/kv/ directory.
  3. Add the screen details to screens.json as shown below:
{
    ...,
    "screen_name": {
        "import": "from libs.uix.baseclass.screen_file import ScreenObjectName",
        "object": "ScreenObjectName()",
        "kv": "libs/uix/kv/screen_file.kv"
    }
}

This template already contains three screens as example which uses all the navigation methods.

Buildozer

To use this template for mobile devices, make sure to add json to your buildozer.spec file, such as

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas,gif,json

Further details are documented within the code itself.

kivy-lazy-loading-template's People

Contributors

kulothunganug avatar mrwulff avatar lazzaau avatar

Watchers

 avatar

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.