无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Android QPython3 SL4A 常用函數(shù):Dialog.py

2020-12-04 00:11 作者:乘著船  | 我要投稿

#需要android.py??https://www.bilibili.com/read/cv8679914


from android import droid,rsla,jsla


OK=('OK',)

YN=('Yes','No')

OC=('OK','Cancel')

YNC=('Yes','No','Cancel')

PNNS={'positive':1,'negative':-1,'neutral':0}

PNNt=tuple(PNNS)


def Which():#請忽略

? ? return PNNS[rsla("dialogGetResponse")['which']]


def ButtonText(button):#請忽略

? ? Lc=len(button)

? ? if Lc>2:jsla("dialogSetNeutralButtonText",button[2])

? ? if Lc>1:jsla("dialogSetNegativeButtonText",button[1])

? ? if Lc==0:button=OK

? ? jsla("dialogSetPositiveButtonText",button[0])


def Button(title='Prompt',message='Are you sure ?',button=YNC):#三鍵按鈕

? ? jsla("dialogCreateAlert",title, message)

? ? ButtonText(button)

? ? jsla("dialogShow")

? ? try:

? ? ? ? return Which()

? ? except:

? ? ? ? return 0


def ProgressCreate(title='標題',message='內(nèi)容', maxValue=100):#創(chuàng)建進度條

? ? jsla("dialogCreateHorizontalProgress",title,message,maxValue)

? ? jsla("dialogShow")

def ProgressSet(CurrentValue):#設置進度條當前值

? ? jsla('dialogSetCurrentProgress',CurrentValue)

def Progressmax(MaxValue):#設置進度條最大值

? ? jsla('dialogSetMaxProgress',MaxValue)

def ProgressDis():#關閉進度條

? ? jsla('dialogDismiss')


def SeekBar(Start=50,Max=100,Title='標題',Message='內(nèi)容',button=OC):#拖動條

? ? jsla("dialogCreateSeekBar",Start,Max,Title,"%s\n\n0 ~ %s"%(Message,Max))

? ? jsla("dialogSetPositiveButtonText",button[0])

? ? jsla("dialogSetNegativeButtonText",button[1])

? ? jsla("dialogShow")

? ? r=rsla("dialogGetResponse")

? ? try:

? ? ? ? if r['which']=='positive':

? ? ? ? ? ? return r['progress']

? ? except:

? ? ? ? pass


def SpinCreate(title='標題',message='內(nèi)容'):#創(chuàng)建轉圈

? jsla("dialogCreateSpinnerProgress",title, message)

? jsla("dialogShow")

SpinDis=ProgressDis#清除轉圈


def Login(title='Login',message=('Username','Password')):#登錄窗口

? ? u=rsla("dialogGetInput",title,message[0])

? ? if not u:

? ? ? ? return None,None

? ? p=rsla("dialogGetPassword",title,message[1])

? ? if not p:

? ? ? ? return None,None

? ? return u,p


def List(title='Which is your choose ?',list_=YNC):#列表選項

? ? jsla("dialogCreateAlert",title)

? ? jsla("dialogSetItems",list_)

? ? jsla("dialogShow")

? ? try:

? ? ? ? return rsla("dialogGetResponse")['item']

? ? except:

? ? ? ? return None


def Input(title="Value",message="Please enter a value :",default=""):#單行輸入窗口

? ? return rsla("dialogGetInput",title,message,default)


def Password(title="Password",message="Please enter password:"):#密碼輸入窗口

? ? return rsla("dialogGetPassword",title,message)


def setClip(Text):#設置剪貼板內(nèi)容

? ? jsla('setClipboard',Text)

def getClip():#獲取剪貼板內(nèi)容

? ? return rsla("getClipboard")


def Vibrate(millisecond=250):#振動

? ? jsla('vibrate',millisecond)

def Notify(title,message):#通知欄提示

? ? jsla('notify',title,message)

def Toast(message):#吐司提示框

? ? jsla('makeToast',message)

def Speak(message):#文字轉語音

? ? jsla('ttsSpeak',message)


作者:乘著船@Bilibili

更多文章+下載鏈接:https://www.bilibili.com/read/readlist/rl321663


Android QPython3 SL4A 常用函數(shù):Dialog.py的評論 (共 條)

分享到微博請遵守國家法律
汝城县| 防城港市| 泽州县| 邢台县| 佛坪县| 黔西| 汽车| 汕头市| 凤翔县| 张家港市| 梅河口市| 札达县| 钦州市| 集安市| 囊谦县| 鹿泉市| 博兴县| 朝阳县| 堆龙德庆县| 定结县| 通许县| 三河市| 团风县| 弥勒县| 深泽县| 洛隆县| 广元市| 澄迈县| 永寿县| 兴义市| 长治市| 平阴县| 章丘市| 乐至县| 和静县| 常宁市| 津南区| 阳信县| 凯里市| 甘孜县| 茂名市|