QSL4A Documentation of
fullShow <QSL4A API Menu>fullShow(layout,title=None,theme=None)
Show Full Screen.
layout (String) String containing View layout
title (String Optional)
theme (Integer Optional) See https://developer.android.google.cn/reference/android/R.style for Integer constant .
Commonly used theme please use :
from androidhelper.R import R
R=R()
style = R.style
or you can use like this :
from androidhelper import Android
droid = Android()
style = droid.R.style
===== Example of fullShow =====
XML='''<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="7dp"
android:text="Hello World"
android:textColor="#00ff00"
android:textStyle="bold"
android:gravity="center"
android:layout_weight="3"
/>
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="7dp"
android:text="Multi Line Editable"
android:background="#222"
android:textColor="#ffffff"
android:textStyle="bold"
android:gravity="center"
android:layout_weight="3"
/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Show Event"
android:id="@+id/button_show"
android:textAllCaps="false"
android:gravity="center"
android:layout_weight="4"
/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Reset XML"
android:id="@+id/button_reset"
android:textAllCaps="false"
android:gravity="center"
android:layout_weight="4"
/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Exit"
android:id="@+id/button_exit"
android:textAllCaps="false"
android:gravity="center"
android:layout_weight="4"
/>
</LinearLayout>'''
from androidhelper import Android
droid=Android()
title='Hello QPython'
theme=droid.R.style.Theme_DeviceDefault_Wallpaper
droid.fullShow(XML,title,theme)
while True:
event=droid.eventWait().result
print(event)
data=event['data']
if type(data)==str:
break
data_id=data.get('id')
if data_id=='button_exit':
break
elif data_id=='button_reset':
XML=XML.split('\n\n')
XML=(XML[0],XML[2],XML[1],XML[3])
XML='\n\n'.join(XML)
droid.fullShow(XML,title,theme)
else:
droid.fullSetProperty('textView','html',f'<font color=red>{event["name"]}</font><br><font color=#00ffff>{event["data"]}</font><br>{event["time"]}')
print(droid.fullGetProperty('editText','text'))
print()
droid.fullDismiss()