AndroLua+ Layout Compiler
中文 | English
Compile AndroLua+ layout, convert it into Lua code.
Example
Source
{
LinearLayout,
orientation="vertical",
layout_width="fill",
layout_height="fill",
{
TextView,
gravity="center",
text="Hello AndroLua+",
layout_width="fill",
layout_height="fill",
},
}After compiling
local LayoutHelper=require "LayoutHelper" return function(root,group) local varsMap={} root=root or _G varsMap.view0=LinearLayout(activity) varsMap.params0=ViewGroup.LayoutParams(-1,-1) varsMap.params0=group and group.LayoutParams(varsMap.params0) or ViewGroup.LayoutParams(varsMap.params0) varsMap.view1=TextView(activity) varsMap.params1=LinearLayout.LayoutParams(ViewGroup.LayoutParams(-1,-1)) varsMap.view1.setText("Hello AndroLua+") varsMap.view1.setGravity(17) varsMap.view1.setLayoutParams(varsMap.params1) --varsMap.params1=nil varsMap.view0.addView(varsMap.view1) --varsMap.view1=nil varsMap.view0.setOrientation(1) varsMap.view0.setLayoutParams(varsMap.params0) --varsMap.params0=nil --varsMap=nil return varsMap.view0 end
Software architecture
- Core documents
lua/compilelayout.luaCompiler ontology.lua/VituralG.luaVirtual_ G, used to obtain code calls.lua/obj2code.luaTools for converting objects into code.LayoutHelper.lualayout helper that needs to be imported within the target software to provide some classes.
- Other files
lua/i18n/i18n.lua for lua.lua/themeutil.luaTheme helper for adaptive target platforms. This is a must-have component for AideLua shared pages.main.luaAndroLua+ entry file.init.luaAndroLua+ configuration file.layout.alySoftware layout file.i18n/Internationalization profile.
Installation Tutorial
- Go to the Gitee Release (NOT GITHUB) and download the pre-compiled installation package, usually with a filename ending in
.apk. - Follow the tutorial in "Flashing Guide - Install Software" (Chinese) to install the utility.
Instructions for use
- Fill in the information in the edit box above.
- Click "Export LayoutHelper" to export
LayoutHelper.luato theProject/luadirectory (orProject/Module/Type/src/luaLibsfor AideLua). - Click the "Compile Layout" button and select the save path.
Participation in contributions
- Fork this repository
- Create a new branch for Feat_xxx
- Commit code
- Create a new Pull Request
The Gitee repository is primary, and the GitHub repository is mirrored.
Although the repositories on GitHub are mirrors, you are not prevented from submitting Issues.
Translation
- Copy
i18n/en.luatoi18n/your-language.lua - Copy
i18n/en/*toi18n/your-language/* - Translate
i18n/your-language.luaandi18n/your-language/* - Commit the code and create a new Pull Request
Other Content
For additional information, please refer to the instructions in the software.