Skip to content

Snoop34/DroidUi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DroidUi - a Python UI library for Android

Now Python is able to run on Android platform thanks to Scripting Layer for Android and Python for Android project. But the User Interface Facade is hard to use. Most of the time, more than one call is needed to achieve your simplest goal. And the fullShow call in FullScreenUI need a XML style layout.

But what if you want to control the layout by programming, or change the layout dynamically at run time? I need a more elegant UI library, that is why DroidUi.

Quick Start

Let's start with Hello world example,

import DroidUi                                     # yes, you need it

layout = DroidUi.DroidUi()                         # layout object comes first
hello = DroidUi.Button(layout,                     # add this Button to the layout
                       text = 'Hello, DroidUi!',   # set the button text
                       command = layout.quit)      # quit the layout when button clicked
layout.mainloop()                                  # enter mainloop

Run this example will give you a big button full of your screen, click button will quit this example.

There are mainly two kinds of object in DroidUi:

  • layout objects: container of View, can be showed. (DroidUi.DroidUi)
  • View objects: UI element, like View class in Android. (DroidUi.View)

DroidUi also support showing a layout from a existing XML layout, use DroidUi.DroidUi.fromxml() and DroidUi.DroidUi.fromfile() to get the layout object

Requirement

Install

  • make sure adb is installed on your computer.
  • connect your Android device to your computer.
  • run install.bat(on Windows) or install.sh(on Linux).
  • then DroidUi installed.

License

DroidUi is licensed under GPLv3 by Tommy Alex

Links

About

a Python UI library for Android (based on SL4A and Py4A)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.6%
  • Shell 1.4%