Book Image

Kivy - Interactive Applications and Games in Python

By : Roberto Ulloa
Book Image

Kivy - Interactive Applications and Games in Python

By: Roberto Ulloa

Overview of this book

Table of Contents (13 chapters)
Kivy – Interactive Applications and Games in Python Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

ActionBar – a responsive bar


A new set of widgets were introduced in Kivy 1.8.0, all of them related to the ActionBar widget. This widget resembles the Android's action bar. This will not only give your applications a modern and professional look, but it also includes more subtle properties such as responsiveness to small screens. Depending on the ActionBar widget hierarchy and components, the different widgets will collapse in order to adapt to the screen space available in the device. First, let's take a look at the final result of our planned ActionBar:

We add the Kivy language code to produce the previous bar in a new file kivyplayer.kv, as presented here:

302. # File name: kivyplayer.kv
303. 
304. <KivyPlayer>:
305.     list_button: _list_button
306.     action_bar: _action_bar
307.     video_controller: _video_controller
308. 
309.     VideoController:
310.         id: _video_controller
311.         on_playing: root.hide_bars(*args)
312. 
313.     ActionBar:
314.         id: _action_bar...