Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- '''
- Created on 2014.10.11.
- @author: lukibeni
- '''
- import android
- import threading
- import sys
- def warehouseSelect():
- droid.dialogCreateAlert("Válasszon áruházat:")
- droid.dialogSetPositiveButtonText("OK")
- droid.dialogSetNegativeButtonText("Mégse")
- malls2 = []
- for s in malls:
- malls2.append(s["name"])
- droid.dialogSetSingleChoiceItems(malls2)
- droid.dialogShow()
- def newProduct():
- print "newProductfuggveny meghívása"
- droid = android.Android()
- droid.webViewShow('file:///sdcard/sl4a/scripts/bevmobwebview.html').result
- dummy_event = threading.Event()
- dummy_event.wait(timeout=5)
- mall = {"Kenyér":"5", "Alma":"6", "Sör":"10"}
- malls = [{"id":"1","name":"Helyi ABC"}, {"id":"2","name":"Metro"}, {"id":"3","name":"Biciklisbolt"}]
- for key, value in mall.iteritems() :
- #pprint.pprint(key, value)
- droid.eventPost("newrow", key + "::" + value)
- droid.addOptionsMenuItem("Áruház","one","mall","ic_media_play")
- droid.addOptionsMenuItem("Új termék","two","newitem","ic_media_pause")
- droid.addOptionsMenuItem("Kilépés","three","quit","ic_media_stop")
- while True:
- response = droid.eventWait(30000).result
- if response == None:
- break
- if response["name"]=="one":
- warehouseSelect()
- elif response["name"] == "two":
- newProduct()
- elif response["name"] == "three":
- sys.exit(0)
- droid.clearOptionsMenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement