<!--parameter标签定义需要填的参数--> <!--id 在后面引用时使用--> <!--name 解释这个参数意义的名字--> <!--type 填的数据类型--> <!--constraints 填的内容限制(类名,独一,不可为空)--> <!--suggest 在填写其他参数时可以根据其他参数的变化自动填充(根据layoutName进行下划线转驼峰命名生成)--> <!--default 默认值--> <!--help 显示在左下角的提示文字--> <parameter id="activityClass" name="Activity Name" type="string" constraints="class|unique|nonempty" suggest="${layoutToActivity(layoutName)}" default="MainActivity" help="The name of the activity class to create" />
<!--boolean类型显示的是一个勾选框+Name--> <parameter id="generateLayout" name="Generate Layout File" type="boolean" default="true" help="If true, a layout file will be generated" />
<!--visibility 可见性,这里意思是勾选了上面的generateLayout才会显示填写布局文件名这一行--> <parameter id="layoutName" name="Layout Name" type="string" constraints="layout|unique|nonempty" suggest="${activityToLayout(activityClass)}" default="activity_main" visibility="generateLayout" help="The name of the layout to create for the activity" />
<parameter id="isLauncher" name="Launcher Activity" type="boolean" default="false" help="If true, this activity will have a CATEGORY_LAUNCHER intent filter, making it visible in the launcher" />
<parameter id="backwardsCompatibility" name="Backwards Compatibility (AppCompat)" type="boolean" default="true" help="If false, this activity base class will be Activity instead of AppCompatActivity" />
<parameter id="includeInstantAppUrl" name="Associate a URL with this Activity" type="boolean" default="false" visibility="isInstantApp!false" help="If true, this activity will be associated with URL, improving discovery of your Instant App" />
<parameter id="instantAppActivityHost" name="Instant App URL Host" type="string" suggest="${companyDomain}" default="instantapp.example.com" visibility="isInstantApp!false" enabled="includeInstantAppUrl" help="The domain to use in the Instant App route for this activity"/>
<parameter id="instantAppActivityRouteType" name="Instant App URL Route Type" type="enum" default="pathPattern" visibility="isInstantApp!false" enabled="includeInstantAppUrl" help="The type of route to use in the Instant App route for this activity" > <option id="path">Path</option> <option id="pathPrefix">Path Prefix</option> <option id="pathPattern">Path Pattern</option> </parameter>
<parameter id="instantAppActivityRoute" name="Instant App URL Route" type="string" default="/.*" visibility="isInstantApp!false" enabled="includeInstantAppUrl" help="The route to use in the Instant App route for this activity"/>
<!-- 128x128 thumbnails relative to template.xml --> <!-- 显示在左边的缩略图 --> <thumbs> <!-- default thumbnail is required --> <thumb>template_blank_activity.png</thumb> </thumbs>
// Example of a call to a native method android.util.Log.d("${activityClass}", stringFromJNI()) </#if> } <#include "../../../../common/jni_code_snippet.kt.ftl"> }