Skip to content

Instantly share code, notes, and snippets.

@letroll
Created May 9, 2013 16:33
Show Gist options
  • Save letroll/5548624 to your computer and use it in GitHub Desktop.
Save letroll/5548624 to your computer and use it in GitHub Desktop.
android template for intellij
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="android">
<template name="lh" value="android:layout_height=&quot;$END$&quot;" description="layout_height" toReformat="false" toShortenFQNames="true">
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="lw" value="android:layout_width=&quot;$END$&quot;" description="layout_width" toReformat="false" toShortenFQNames="true">
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="btn" value="&lt;Button android:id=&quot;@+id/$ID$&quot;&#10; android:layout_height=&quot;$HEIGHT$&quot;&#10; android:layout_width=&quot;$WIDTH$&quot; &#10; android:text=&quot;@string/$STRING$&quot;/&gt;$END$" description="android button" toReformat="false" toShortenFQNames="true">
<variable name="ID" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HEIGHT" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="WIDTH" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="STRING" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="ll" value="&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&#10; android:layout_width=&quot;$WIDTH$&quot;&#10; android:layout_height=&quot;$HEIGHT$&quot;&gt;&#10; $END$&#10;&lt;/LinearLayout&gt;" description="Linear Layout" toReformat="false" toShortenFQNames="true">
<variable name="WIDTH" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HEIGHT" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="rl" value="&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&#10; android:layout_width=&quot;$WIDTH$&quot;&#10; android:layout_height=&quot;$HEIGHT$&quot;&gt;&#10; $END$&#10;&lt;/RelativeLayout&gt;" description="relative layout" toReformat="false" toShortenFQNames="true">
<variable name="WIDTH" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HEIGHT" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="fl" value="&lt;FrameLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&#10; android:layout_width=&quot;$WIDTH$&quot;&#10; android:layout_height=&quot;$HEIGHT$&quot;&gt;&#10; $END$&#10;&lt;/FrameLayout&gt;" description="frame layout" toReformat="false" toShortenFQNames="true">
<variable name="WIDTH" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HEIGHT" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="tv" value="&lt;TextView android:id=&quot;@+id/$ID$&quot;&#10; android:layout_height=&quot;$HEIGHT$&quot;&#10; android:layout_width=&quot;$WIDTH$&quot; &#10; android:text=&quot;@string/$STRING$&quot;/&gt;$END$" description="TextView" toReformat="false" toShortenFQNames="true">
<variable name="ID" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HEIGHT" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="WIDTH" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="STRING" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="lv" value="&lt;ListView android:id=&quot;@+id/$ID$&quot;&#10; android:layout_height=&quot;$HEIGHT$&quot;&#10; android:layout_width=&quot;$WIDTH$&quot; &#10; android:text=&quot;@string/$STRING$&quot;/&gt;$END$" description="ListView" toReformat="false" toShortenFQNames="true">
<variable name="ID" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HEIGHT" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="WIDTH" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="STRING" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="im" value="&lt;ImageView&#10; android:id=&quot;@+id/$ID$&quot;&#10; android:layout_width=&quot;$WIDTH$&quot;&#10; android:layout_height=&quot;$HEIGHT$&quot;&#10; android:src=&quot;@drawable/$SRC$&quot;/&gt;$END$" description="ImageView" toReformat="false" toShortenFQNames="true">
<variable name="ID" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="WIDTH" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HEIGHT" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="SRC" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="true" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="pb" value="&lt;ProgressBar&#10; android:id=&quot;$ID$&quot;&#10; android:layout_height=&quot;$HEIGHT$&quot;&#10; android:layout_width=&quot;$WIDTH$&quot;&#10; android:indeterminate=&quot;$INDETERMINATE$&quot;/&gt;$END$" description="ProgressBar" toReformat="false" toShortenFQNames="true">
<variable name="ID" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HEIGHT" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="WIDTH" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="INDETERMINATE" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="true" />
<option name="JAVA_CODE" value="false" />
<option name="JAVA_STATEMENT" value="false" />
<option name="JAVA_EXPRESSION" value="false" />
<option name="JAVA_DECLARATION" value="false" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="false" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="loo" value="Logger.loge(this,&quot;$END$&quot;);" description="Log with Logger in class without context" toReformat="false" toShortenFQNames="true">
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
<option name="JAVA_CODE" value="true" />
<option name="JAVA_STATEMENT" value="true" />
<option name="JAVA_EXPRESSION" value="true" />
<option name="JAVA_DECLARATION" value="true" />
<option name="JAVA_COMMENT" value="false" />
<option name="JAVA_STRING" value="false" />
<option name="COMPLETION" value="true" />
<option name="GROOVY" value="false" />
<option name="GROOVY_EXPRESSION" value="false" />
<option name="GROOVY_STATEMENT" value="false" />
<option name="GROOVY_DECLARATION" value="false" />
<option name="MAVEN" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
</templateSet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment