更新一个LUA远程更新代码,FA2加载启动页面

教程 11个月前 壳壳
1,717 0 0
最后更新于2022年4月19日,已超过343天没有更新,如果内容或图片资源失效,请留言反馈,我会及时处理,谢谢!

Lua远程更新代码:

import "android.widget.TextView"
import "android.graphics.drawable.ColorDrawable"
import "android.graphics.Color"
import "android.widget.FrameLayout"
import "android.widget.ImageView"
import "java.io.FileOutputStream"
import "android.widget.LinearLayout"
import "java.io.File"
import "android.graphics.drawable.GradientDrawable"
import "androidx.appcompat.app.AlertDialog"
import "android.app.AlertDialog"
import "android.widget.ScrollView"
import "androidx.transition.Visibility"
import "android.opengl.Visibility"
import "android.transition.Visibility"
import "com.androlua.Http"
import "androidx.cardview.widget.CardView"
import "java.net.URL"

import "android.app.*"
import "android.os.*"
import "android.widget.*"
import "android.view.*"
import "android.graphics.drawable.ColorDrawable"
import "java.io.FileOutputStream"
import "com.androlua.Http"
import "java.io.File"
import "java.net.URL"
import "android.app.AlertDialog"
import "android.graphics.Typeface"
import "android.graphics.drawable.GradientDrawable"
import "android.graphics.Typeface"
import "java.net.URL"
import "com.androlua.Ticker"
import "android.app.AlertDialog"
import "android.widget.ScrollView"
import "android.widget.TextView"
import "android.widget.ImageView"
import "android.widget.FrameLayout"
import "android.widget.LinearLayout"
import "com.google.android.material.card.MaterialCardView"
import "com.androlua.Http"
import "android.content.Intent"

function 弹窗圆角(控件,背景色,上角度,下角度)
if not 上角度 then
上角度=25
end
if not 下角度 then
下角度=上角度
end
控件.setBackgroundDrawable(GradientDrawable()
.setShape(GradientDrawable.RECTANGLE)
.setColor(背景色)
.setCornerRadii({上角度,上角度,上角度,上角度,下角度,下角度,下角度,下角度}))
end

import "android.graphics.Typeface"

远程链接="更新网址"--远程链接
appinfo=this.getPackageManager().getApplicationInfo(this.getPackageName(),0)
程序名=this.getPackageManager().getApplicationLabel(appinfo)
packinfo=this.getPackageManager().getPackageInfo(this.getPackageName(),((32552732/2/2-8183)/10000-6-231)/9)
当前版本=tostring(packinfo.versionName)
Http.get(远程链接,nil,nil,nil,function(code,content)
if code==200 then
更新开关=content:match("更新开关【(.-)】")
最新版本=content:match("最新版本【(.-)】")
下载链接=content:match("更新链接【(.-)】")
文件名=content:match("文件名【(.-)】")
更新内容=content:match("更新内容【(.-)】")
蓝奏云链接=content:match("蓝奏云链接【(.-)】")
if 更新开关=="开" then
if 最新版本==当前版本 then
print("当前已是最新版本!")
else
弹窗=
{
FrameLayout,--帧布局
layout_width='fill',--宽度
{
LinearLayout,--线性布局
orientation='vertical',--方向
layout_width='fill',--宽度

{
LinearLayout,--线性布局
padding="6dp",--往内部元素的填充一定边距
layout_gravity='center';--重力
orientation='vertical',--方向
layout_width='70%w',--宽度
layout_height='wrap',--高度
background='#ffFFFFFF',--背景颜色或图片路径

{
LinearLayout,--线性布局
orientation='horizontal',--方向
layout_width='fill',--宽度
{
LinearLayout,--线性布局
gravity='left';--卡片重力
orientation='horizontal',--方向
layout_width='fill',--宽度

{
TextView;--文本控件
textColor='#98000000';--文字颜色
text='发现新版本:';--显示文字
textSize='15dp';--文字大小
layout_marginTop='10dp';--顶距
layout_marginLeft='5dp';--左距
Typeface=Typeface.DEFAULT_BOLD;--字体加粗
};
{
TextView;--文本控件
layout_marginlLeft='5dp';--右距
textColor='#85000000';--文字颜色
text=最新版本;--文本内容
layout_marginTop='10dp';--顶距
Typeface=Typeface.DEFAULT_BOLD;--字体加粗
};
};
};

{
LinearLayout,--线性布局
orientation='horizontal',--方向
layout_width='fill',--宽度
-- Visibility='invisible';--隐藏控件
};
{
LinearLayout,--线性布局
-- gravity='center';--重力
orientation='vertical',--方向
layout_width='fill',--宽度
{
ScrollView,--纵向滑动
layout_width='fill';--宽度
l
截图和实际代码略有差异:
更新一个LUA远程更新代码,FA2加载启动页面
版权声明:壳壳 发表于 2022年4月19日 pm9:25。
转载请注明:更新一个LUA远程更新代码,FA2加载启动页面 | 壳壳博客

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...
壳壳博客一键登录开启个人书签等功能!