-
Notifications
You must be signed in to change notification settings - Fork 55
Home
- Our First Dev Sprint meant to get people familiarized with kivy.
After this first Devspring it was decided that we would start working on the app from scratch.
For this purpose the master
branch was emptied and we have started with blank dir.
Step 1: We setup a basic structure for the app
PyCon-Mobile-App
|
|___ LICENSE
|___ Makefile
|___ README.md
|___ eventsapp
|___ main.py: "This is the main entry point of our application"
|___ uix: "This is where our user interface elements go."
|___ screens: "This is where all our UI screens of the app go."
|
|___ tools: "This is where all our tools including assets etc go."
|___ images: "This is where all our image assets go."
|___ raw_assets: "This is where our raw assets from the design team exist."
|___ tests: "All our tests go here"
This is the current app structure, Currently the main.py just has the following data.
from kivy.app import App
class EventsApp(App):
'''This is our entry point for the application
'''
def on_pause(self):
# allow the app to pause on android and ios
# set this to False if you do not want that.
return True
def on_resume(self):
pass
# is our app running as main or is it being imported as a module?
if __name__ == '__main__':
# our app is running as main
# let us instantiate the app and run it.
EventsApp().run()
So this gives you just one simple blank window with nothing in there.
Keeping in mind the following items::
Saturday August 19: We will be sending out a mail to each volunteer group asking for their input on how they want to use the app. This should help us get a better idea of how to have the app designed.
Till that we will be starting with a basic app loads basic screens
Starting from the blank screen in step one,
The first thing that happens in our app should be the display of logo on splash screen.
Now what is a ScreenManager
?
A ScreenManager
is a Widget
that houses multiple screens that can be loaded in it.
using different types of transitions, for more info in the subjects please look at
https://kivy.org/docs/api-kivy.uix.screenmanager.html
What is a splash screen
?
(Wiki) https://en.wikipedia.org/wiki/Splash_screen has a good explanation. Basically it is a Image + Logo, anything that gives the user a idea of what the product does. Some splash screens include versions some do not, look at the wiki for more details.
Now that every one knows what's a splash screen and a ScreenManager
, let's make sure that
the root
Widget of our app is a screen Manager.
https://github.com/pythonindia/PyCon-Mobile-App/blob/master/eventsapp/main.py#L38
The way we do this is to return ScreenManager
widget's instance in the build
method of the app
class.
class EventsApp(App):
'''This is our entry point for the application
'''
def build(self):
from kivy.uix.screenmanager import ScreenManager
root = ScreenManager()
#return the root widget here
return root
Let's first add a load_screen
method in our main.py.
This method could be used/called by anyplace in our app
to load a screen in any given ScreenManager
.