安卓java代码模板

logx

<template name="logx" value="android.util.Log.i("DTEST", "$content$");" description="快速添加log日志" toReformat="false" toShortenFQNames="true">
  <variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
  <context>
    <option name="HTML" value="false" />
    <option name="JSON" value="false" />
    <option name="OTHER" value="true" />
    <option name="XML" value="false" />
    <option name="XML_ATTRIBUTE" value="false" />
  </context>
</template>

sysout

<template name="sysout" value="System.out.println("$content$");" description="打印" toReformat="false" toShortenFQNames="true">
  <variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
  <context>
    <option name="JAVA_CODE" value="true" />
  </context>
</template>

xbinding

<template name="xbinding" value="private lateinit var binding: ActiviatyCustomerserviceBinding" description="kotlin绑定" toReformat="false" toShortenFQNames="true">
  <context>
    <option name="KOTLIN" value="true" />
  </context>
</template>

xget

<template name="xget" value="
showLoadingDialog();
getForm(BaseConfig.url + ApiUrl.register, new OConnect.PostGetInfoListener() {
    @Override
    public void onPostGetText(String text) {
        dismissLoadingDialog();
    }
});" description="GET请求命令" toReformat="false" toShortenFQNames="true">
  <context>
    <option name="JAVA_CODE" value="true" />
  </context>
</template>

xmodel

<template name="xmodel" value="if (text == null || text.length() == 0) {
    showToast("获取数据失败");
    return;
}
try {
    PhoneExistModel model = new PhoneExistModel().fromJson(new JSONObject(text));
    if (model.code.equals("200")) {
        //解析成功后处理
    } else {
        showToast(model.message);
    }

} catch (JSONException e) {
    e.printStackTrace();
    showToast(e.toString());
}" description="模型创建" toReformat="false" toShortenFQNames="true">
  <context>
    <option name="JAVA_CODE" value="true" />
  </context>
</template>

xpost

<template name="xpost" value="JSONObject jsonObject = new JSONObject();
JSONObject req = new JSONObject();
try{
    jsonObject.put("gwRegisterReq", req);
}catch (Exception ex){
    ex.printStackTrace();
}
showLoadingDialog();
postForm(BaseConfig.url + ApiUrl.register, jsonObject, new OConnect.PostGetInfoListener() {
    @Override
    public void onPostGetText(String text) {
        dismissLoadingDialog();
    }
});" description="post请求命令" toReformat="false" toShortenFQNames="true">
  <context>
    <option name="JAVA_CODE" value="true" />
  </context>
</template>

安卓kotlin代码模板

xml布局代码模板

column

<template name="column" value="<LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        $cursor$
</LinearLayout>" description="LinearLayout vertical" toReformat="false" toShortenFQNames="true">
  <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
  <context>
    <option name="XML" value="true" />
  </context>
</template>

leftimage

<template name="leftimage" value="    <LinearLayout

            android:orientation="horizontal"
            android:gravity="left|center"
            android:layout_width="wrap_content" android:layout_height="wrap_content">
        <ImageView

                android:layout_width="50dp" android:layout_height="50dp"/>
        <TextView

                android:text="Cash"
                android:layout_marginLeft="12dp"
                android:layout_width="wrap_content" android:layout_height="wrap_content"/>
    </LinearLayout>" description="图片在左边的横向布局,图片+文字" toReformat="false" toShortenFQNames="true">
  <context>
    <option name="XML" value="true" />
    <option name="XML_TAG" value="false" />
  </context>
</template>

line

<template name="line" value="    <View
            android:background="#a0a0a0"
            android:layout_width="match_parent" android:layout_height="1px"/>
" description="下划线" toReformat="false" toShortenFQNames="true">
  <context>
    <option name="XML" value="true" />
    <option name="XML_TAG" value="false" />
  </context>
</template>

rightimage

<template name="rightimage" value="    <LinearLayout

            android:orientation="horizontal"
            android:gravity="left|center"
            android:layout_width="wrap_content" android:layout_height="wrap_content">

        <TextView

                android:text="Cash"
                android:layout_marginRight="12dp"
                android:layout_width="wrap_content" android:layout_height="wrap_content"/>
        <ImageView

                android:layout_width="50dp" android:layout_height="50dp"/>

    </LinearLayout>" description="图片在右边的横向布局,图片+文字" toReformat="false" toShortenFQNames="true">
  <context>
    <option name="XML" value="true" />
    <option name="XML_TAG" value="false" />
  </context>
</template>

row

<template name="row" value="<LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        $cursor$
</LinearLayout>" description="LinearLayout horizontal" toReformat="false" toShortenFQNames="true">
  <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
  <context>
    <option name="XML" value="true" />
    <option name="XML_TAG" value="false" />
  </context>
</template>

xbutton

<template name="xbutton" value="<Button
                android:text="$cursor$"
                android:layout_width="match_parent" android:layout_height="wrap_content"/>" description="快速添加Button" toReformat="false" toShortenFQNames="true">
  <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
  <context>
    <option name="XML" value="true" />
    <option name="XML_TAG" value="false" />
  </context>
</template>

xtext

<template name="xtext" value="<TextView
        android:text="$cursor$"
        android:layout_width="wrap_content" android:layout_height="wrap_content"/>" description="TextView" toReformat="false" toShortenFQNames="true">
  <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
  <context>
    <option name="XML" value="true" />
    <option name="XML_TAG" value="false" />
  </context>
</template>

VS代码模板

UEsDBBQAAAAAAAcLOVUAAAAAAAAAAAAAAAARAAAATXkgQ29kZSBTbmlwcGV0cy9QSwMEFAAAAAgAYAo5VfDNrMvZAQAASQMAACQAAABNeSBDb2RlIFNuaXBwZXRzL2RlYnVnbG9nZ2VyLnNuaXBwZXRtUk9r1EAcPVfwO8ShB0XMrIIgOpuydBULe9ugh9LDmMwmA8lMmD+y3iwI4sV6WxUEl1Lx0i0eBEFtv0yzm36LTrKTTfrntPve7+X93vslaGOcJs5rIiTlrAvuux3gEBbwkLKoC7Qa3XsENrybN9AmD8mQ0SwjSjrmGSa7IFYqewyhDGKSYummNBBc8pFyA57CF1RqnAyVDimHDzqdh7BlAYzlWtvTecZFilWVwO1U4zX0nOCQiPK/AT5VCfH65JWOBjyKiECwoux4GHOhAq1WCgRryir6RAaCZsoUbds4xdFhvnew+Pru9O/+4vvu4sP7+ew3gi25NehpZRy9s/2PRpz//5UffkJwSVqFLeO/yYgsqUuc93ScYVZe2oRr6OuUQy0E1yyUL6mKr1FbqtlVUqt7rcya7kGCBS7LrIINqCICJyWs8FbfI+NMELkMaGA98TlPfJp5xY/dYjZdzCamfzH9WRwf5//2ELTjSr5cNsI6UV5x8mX++ej0z9v5t2l98PnkID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