Coder Social home page Coder Social logo

iptux / droidui Goto Github PK

View Code? Open in Web Editor NEW
43.0 7.0 7.0 275 KB

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

Home Page: http://iptux.github.io/DroidUi/

License: GNU General Public License v3.0

Python 98.40% Shell 0.77% Batchfile 0.84%

droidui's Introduction

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

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.