五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

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

Android QPython3 可視化:多彩文本-HtmlText.py

2021-12-28 01:26 作者:乘著船  | 我要投稿


#需要 QPython 3C 3.5.3 或以上
#需要 BaseWindow.py ?https://www.bilibili.com/read/cv8680125
from BaseWindow import *
XML="""<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:background="#0E4200"
	android:orientation="vertical"
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:qpython="http://www.qpython.org">
	<LinearLayout
		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:orientation="vertical"
		android:layout_weight="20">
	<ScrollView ? 
 ? ? ? ?android:layout_width="fill_parent" ? 
 ? ? ? ?android:layout_height="fill_parent" > 
	<LinearLayout
		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:orientation="vertical"
		android:layout_weight="20">	
 ? ?<EditText
 ? ? ? ?android:background="#ffffaf"
		android:id="@+id/editTitle"
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"
		android:textSize="8dp"
		qpython:html=""
		android:textColor="#ff0000"
		android:layout_weight="1"
		android:gravity="center"
	/>
	<EditText
 ? ? ? ?android:background="#ffffff"
		android:id="@+id/editText"
		android:layout_width="fill_parent"
		android:layout_height="wrap_content"
		android:textSize="8dp"
		qpython:html=""
		android:textColor="#0000ff"
		android:layout_weight="1"
	/>
	</LinearLayout>
	</ScrollView>
 ? ?</LinearLayout>
	<LinearLayout
		android:layout_width="fill_parent"
		android:layout_height="100dp"
		android:orientation="horizontal"
		android:layout_weight="8">
	<Button
		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:text="%s"
		android:id="@+id/but_conf"
		android:textAllCaps="false"
		android:background="#007f7f"
		android:textColor="#ffffffff"
		android:layout_weight="1"
		android:gravity="center"/>
	<Button
		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:text="%s"
		android:id="@+id/but_copy"
		android:textAllCaps="false"
		android:background="#7f7f00"
		android:textColor="#ffffffff"
		android:layout_weight="1"
		android:gravity="center"/>
	<Button
		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		android:text="%s"
		android:id="@+id/but_canc"
		android:textAllCaps="false"
		android:background="#7f007f"
		android:textColor="#ffffffff"
		android:layout_weight="1"
		android:gravity="center"/>
	</LinearLayout>
</LinearLayout>"""
def getText(self):
 ? ?if MainScreen.Html:
 ? ? ? ?return self.editText.html
 ? ?else:
 ? ? ? ?return self.editText.text
class MainScreen(Layout):
 ? ?def on_show(self):
 ? ? ? ?self.views.but_conf.add_event(click_EventHandler(self.views.but_conf,self.conf))
 ? ? ? ?self.views.but_copy.add_event(click_EventHandler(self.views.but_copy,self.copy))
 ? ? ? ?self.views.but_canc.add_event(click_EventHandler(self.views.but_canc,self.canc))
 ? ? ? ?self.editText=self.views.editText
 ? ? ? ?self.editText.html=self.Text
 ? ? ? ?self.views.editTitle.html=self.Title
 ? ?def on_close(self):
 ? ? ? ?pass
 ? ?def copy(self,view,dummy):
 ? ? ? ?droid.setClipboard(getText(self))
 ? ? ? ?droid.makeToast("文本已復(fù)制")
 ? ?def conf(self,view,dummy):
 ? ? ? ?MainScreen.Text=getText(self)
 ? ? ? ?FullScreenWrapper2App.close_layout()
 ? ?def canc(self,view,dummy):
 ? ? ? ?MainScreen.Text=None
 ? ? ? ?FullScreenWrapper2App.close_layout()
def HtmlText(TitleHtml='',TextHtml='',returnHtml=False,button=CCC):#主函數(shù)
#彩色文本(標(biāo)題Html,Html多行文本,返回Html還是返回Text,(確認(rèn)按鈕文本,復(fù)制按鈕文本,取消按鈕文本))
#例如:HtmlText('<font color=green>Hello</font><font color=blue>World</font>','<font color=red>你好</font><font color=green>世界</font>')
 ? ?MainScreen.Title=TitleHtml
 ? ?MainScreen.Text=TextHtml
 ? ?MainScreen.Html=returnHtml
 ? ?FullScreenWrapper2App.show_layout(MainScreen(XML%tuple(button)))
 ? ?FullScreenWrapper2App.eventloop()
 ? ?i=MainScreen.Text
 ? ?del MainScreen.Title,MainScreen.Text
 ? ?return i
__all__=('HtmlText','droid')
#HtmlText by 乘著船 at 20211227
HtmlText('<font color=green>Hello</font><font color=blue>World</font>','<font color=red>你好</font><font color=green>世界</font>') #不輸入按“確認(rèn)”,返回“你好世界”

HtmlText('<font color=green>Hello</font><font color=blue>World</font>','<font color=red>你好</font><font color=green>世界</font>',True) #不輸入按“確認(rèn)”,返回“<p dir="ltr"><span style="color:#FF0000;">你好</span><span style="color:#00FF00;">世界</span></p>”


QPython 3C 3.5.3 自帶實(shí)例 LongText_QPy:

可以看到實(shí)例顯示Html多彩文本:

作者:乘著船@Bilibili

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

Android QPython3 可視化:多彩文本-HtmlText.py的評論 (共 條)

分享到微博請遵守國家法律
越西县| 松江区| 左贡县| 和田市| 绥棱县| 通化县| 肇源县| 河东区| 弋阳县| 长沙市| 萍乡市| 平陆县| 益阳市| 东海县| 昌邑市| 江北区| 建瓯市| 安吉县| 张掖市| 虎林市| 凯里市| 贞丰县| 丰原市| 马关县| 贵南县| 大庆市| 石河子市| 清水河县| 安仁县| 宽城| 汤阴县| 沧源| 东港市| 田阳县| 汝南县| 太仓市| 蓬莱市| 五原县| 稻城县| 黄骅市| 涟水县|