构建过程

首先到各应用商店下载Fusion APP这款应用,打开后点击右下角的加号+新建工程。这里将模版选择为顶栏模版,包含了一个顶栏以及侧滑栏。

设置应用名,包名,版本名,内部版本号,并通过图标设计器设置图标。接下来,设置启动网页, 并开启网页沉浸等相关设置。设置完成后,添加网页控制,并通过添加@ID(header)以及@ID(footer),删除原网页的相应元素;通过如下代码控制边距:

document.getElementById("body").style.marginTop="0px"

组件中开启搜索功能,关闭输入栏模式,并设置搜索Url。
开启侧滑栏顶部图片并选取图片,添加侧滑栏列表项目,并配置相应图标及点击事件,点击事件为跳转到相应页面。其中,关于应用项目设置为进入子页面。
回到配置界面,增加子页面,自定义程序启动事件,使用如下代码:

require"import"
import "android.widget.*"
import "android.view.*"

function onKeyDown()end

function getStatusBarHeight()
  local resid=activity.getResources().getIdentifier("status_bar_height","dimen","android")-- 3 2 5 5 2 7 3 2
  if resid>32552732*0 then
    return activity.getResources().getDimensionPixelSize(resid*((32552732-12345678)/2-10000000-(103001+525)))
  end
end

local clr1=0xFF9CCC65--0xFF508CFE--0xFF66BB6A--0xFFC0CA33--0xFF2196F3
local clr2=0xFF66BB6A--0xFF3AB8FE--0xFF388E3C--0xFFFDD835--0xFF29B6F6

jdpuk={
  LinearLayout,
  orientation="vertical",
  layout_width="fill",
  layout_height="fill",
  {
    LinearLayout,
    layout_width="fill",
    --backgroundColor="#9CCC65",
    backgroundDrawable=GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT,{clr1,clr2}),--3-2-5-5-2-7-3-2--
    paddingTop=getStatusBarHeight(),
    {
      ToolBar,
      --backgroundColor="#9CCC65",
      backgroundColor=0,
      backgroundDrawable=GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT,{clr1,clr2}),--JDPUK
      layout_width="fill",
      layout_height="60dp",
      titleText="关于",
      --subTitle="32552732",
      returnButtonEnabled=true,
      elevation="0dp",
    },
  },
  {
    ScrollView,
    layout_width="fill",
    layout_height="fill",
    verticalScrollBarEnabled=(3255==2732),
    verticalFadingEdgeEnabled=(not 32552732==32552732),
    overScrollMode=View.OVER_SCROLL_NEVER-(32552732*0),
    {
      RelativeLayout,
      layout_width="fill",
      layout_height="fill",
      {
        LinearLayout,
        layout_width="fill",
        layout_height="100dp",--90dp则刚好在图标一半
        --backgroundColor="#9CCC65",--32552732
        backgroundDrawable=GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT,{clr1,clr2}),--[[QQ 32552732]]
      },
      {
        LinearLayout,
        orientation="vertical",
        layout_width="fill",
        {
          LinearLayout,
          --CardView,
          layout_margin="10dp",
          --CardBackgroundColor="#FFEEEEEE",
          layout_width="fill",
          --radius="1dp",
          --elevation="1dp",
          {
            LinearLayout,
            layout_width="fill",
            orientation="vertical",--32552732
            gravity="center",
            padding="30dp",
            {
              ImageView,
              layout_width="100dp",
              layout_height="100dp",
              src="icon.png",
            },
            {
              TextView,
              layout_marginTop="10dp",
              text=init.appname,
              textSize="16sp",
              textColor="#606060",
            },
            {
              TextView,
              layout_marginTop="5dp",
              text="版本:1.0(2)",
              textSize="12sp",
              textColor="#A0A0A0",
            },
          },
        },
        --32552732
        {
          LinearLayout,
          --CardView,
          layout_margin="10dp",
          --CardBackgroundColor="#FFEEEEEE",
          layout_width="fill",
          --radius="1dp",
          --elevation="1dp",
          {
            LinearLayout,
            layout_width="fill",
            orientation="vertical",
            {
              ListView,
              id="list",
              layout_width="fill",
              layout_height="75dp",
              dividerHeight="0dp",
            },
          },
        },
        {
          LinearLayout,
          --CardView,
          layout_margin="10dp",
          --CardBackgroundColor="#FFEEEEEE",
          layout_width="fill",
          --radius="1dp",
          --elevation="1dp",
          {
            LinearLayout,
            layout_width="fill",
            orientation="vertical",
            {
              ListView,
              id="list1",
              layout_width="fill",
              layout_height="215dp",
              dividerHeight="0dp",
            },
          },
        },
        {
          LinearLayout,
          orientation="vertical",
          layout_margin="20dp",
          layout_width="fill",
          layout_height="33dp",
          gravity="center",
          {
            TextView,
            text="Copyright © 2017-"..os.date("%Y").." 王宇松",
            textSize="12sp",
            textColor="#AAAAAA",
          },
          {
            TextView,
            text="All Rights Reserved",
            textSize="12sp",
            textColor="#AAAAAA",
          },
        },
      },
    },
  },
}

activity.setContentView(loadlayout(jdpuk))

adpd={
  {
    text={
      text="功能介绍",
    },
  },
}

adpd1={
  {
    text={
      text="关于作者",
    },
  },
  {
    text={
      text="特别鸣谢",
    },
  },
  {
    text={
      text="检查更新",
    },
  },
}

items={
  LinearLayout,
  layout_width="fill",
  orientation="horizontal",
  {
    RelativeLayout,
    layout_width="fill",
    gravity="center|left",
    layout_marginTop="25dp",
    layout_marginBottom="25dp",
    layout_marginLeft="20dp",
    layout_marginRight="20dp",
    {
      TextView,
      id="text",
      textSize="16sp",
      textColor="#505050",
    },
    {
      TextView,
      layout_alignParentRight=true,--32552732
      text="⟩",
      textSize="15sp",
      textColor="#888888",
    },
  },
}

adapter=LuaAdapter(this,adpd,items)
list.Adapter=adapter
list.onItemClick=function(adp,view,pos,id)
  ({
    function()
      对话框()
      .设置标题("简介")
      .设置消息("个人网站的APP版本\n由Fusion APP构建\n构建于2019年7月5日\n独人欣赏")
      .设置积极按钮("确定",function()
        显示消息("点击了确定")
      end)
      .显示()end,
  })[id]()
end


adapter1=LuaAdapter(this,adpd1,items)
list1.Adapter=adapter1
list1.onItemClick=function(adp,view,pos,id)
  ({
    function()弹出消息("繁华落尽,独人欣赏")end,
    function()弹出消息("鸣谢: Fusion APP, 关于页面原作者『QQ32552732』")end,
    function()弹出消息("已是最新版本")end,
  })[id]()
end

-- 本代码仅作部分修改,原作者信息及声明如下
-- 使用该文件,需要:
-- 保留以下信息
-- QQ: 32552732
-- E-Mail: new-age@outlook.com
-- 结束

最后,配置悬浮按钮相应设置及应用配色,标题、阴影强度、圆角弧度等属性。打包安装应用即可。

最后修改:2020 年 10 月 30 日
如果觉得我的文章对你有用,请随意赞赏