| <?xml version="1.0" encoding="UTF-8"?> |
| <templateSet group="Android"> |
| <template name="Toast" value="android.widget.Toast.makeText($context$, "$text$", Toast.LENGTH_SHORT).show();" description="Create a new Toast" toReformat="true" toShortenFQNames="true"> |
| <variable name="context" expression="variableOfType("android.content.Context")" defaultValue="" alwaysStopAt="true" /> |
| <variable name="text" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| </context> |
| </template> |
| <template name="rouiT" value="getActivity().runOnUiThread(new java.lang.Runnable() { @Override public void run() { $cursor$ } });" description="runOnUIThread" toReformat="true" toShortenFQNames="true"> |
| <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| </context> |
| </template> |
| <template name="fbc" value="($cast$) findViewById(R.id.$resId$);" description="findViewById with cast" toReformat="true" toShortenFQNames="true"> |
| <variable name="cast" expression="expectedType()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="resId" expression="completeSmart()" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| <option name="JAVA_EXPRESSION" value="true" /> |
| </context> |
| </template> |
| <template name="foreach" value="for ($i$ : $data$) { $cursor$ }" description="Create a for each loop" toReformat="true" toShortenFQNames="true"> |
| <variable name="i" expression="" defaultValue="" alwaysStopAt="true" /> |
| <variable name="data" expression="" defaultValue="" alwaysStopAt="true" /> |
| <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| </context> |
| </template> |
| <template name="sbc" value="/////////////////////////////////////////////////////////////////////////// // $blockName$ ///////////////////////////////////////////////////////////////////////////" description="block comment for structuring code" toReformat="true" toShortenFQNames="true"> |
| <variable name="blockName" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <template name="Sfmt" value="String.format("$string$", $params$);" description="String format" toReformat="true" toShortenFQNames="true"> |
| <variable name="string" expression="" defaultValue="" alwaysStopAt="true" /> |
| <variable name="params" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| <option name="JAVA_EXPRESSION" value="true" /> |
| </context> |
| </template> |
| <template name="IntentView" value="android.content.Intent view = new Intent(); view.setAction(Intent.ACTION_VIEW); view.setData(android.net.Uri.parse($url$)); startActivity(view);" description="Creates an Intent with ACTION_VIEW" toReformat="true" toShortenFQNames="true"> |
| <variable name="url" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| </context> |
| </template> |
| <template name="ViewConstructors" value="public $class$(android.content.Context context) { this(context, null); } public $class$(Context context, android.util.AttributeSet attrs) { this(context, attrs, 0); } public $class$(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); $cursor$ }" description="Adds generic view constructors" toReformat="true" toShortenFQNames="true"> |
| <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" /> |
| <variable name="class" expression="className()" defaultValue="" alwaysStopAt="false" /> |
| <context> |
| <option name="JAVA_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <template name="rgS" value="$resources$.getString(R.string.$stringId$)" description="get a String from resources" toReformat="true" toShortenFQNames="true"> |
| <variable name="resources" expression="" defaultValue="" alwaysStopAt="true" /> |
| <variable name="stringId" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| <option name="JAVA_EXPRESSION" value="true" /> |
| </context> |
| </template> |
| <template name="wrapIt" value="task wrapper(type: Wrapper) { gradleVersion = "$version$" }" description="adds a gradle wrapper task" toReformat="true" toShortenFQNames="true"> |
| <variable name="version" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="GROOVY_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <template name="newInstance" value="public static $fragment$ newInstance($args$) { $nullChecks$ android.os.Bundle args = new Bundle(); $addArgs$ $fragment$ fragment = new $fragment$(); fragment.setArguments(args); return fragment; }" description="create a new Fragment instance with arguments" toReformat="true" toShortenFQNames="true"> |
| <variable name="fragment" expression="className()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="args" expression="" defaultValue="" alwaysStopAt="true" /> |
| <variable name="nullChecks" expression="" defaultValue="" alwaysStopAt="true" /> |
| <variable name="addArgs" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <template name="noInstance" value="private $class$() { //no instance }" description="private empty constructor to prohibit instance creation" toReformat="true" toShortenFQNames="true"> |
| <variable name="class" expression="className()" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <template name="starter" value="public static void start(android.content.Context context) { android.content.Intent starter = new Intent(context, $ACTIVITY$.class); starter.putExtra($CURSOR$); context.startActivity(starter); }" description="Creates a static start(...) helper method to start an Activity" toReformat="false" toShortenFQNames="true"> |
| <variable name="ACTIVITY" expression="className()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="CURSOR" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <template name="const" value="private static final int $name$ = $value$;" description="Define android style int constant" toReformat="true" toShortenFQNames="true"> |
| <variable name="name" expression="" defaultValue="NAME" alwaysStopAt="true" /> |
| <variable name="value" expression="groovyScript("new Random().nextInt(1000)")" defaultValue="0" alwaysStopAt="false" /> |
| <context> |
| <option name="JAVA_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <template name="key" value="private static final String KEY_$value$ = "$value$";" description="Key for a bundle" toReformat="true" toShortenFQNames="true"> |
| <variable name="value" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <template name="visible" value="$VIEW$.setVisibility(View.VISIBLE);" description="Set view visibility to VISIBLE" toReformat="true" toShortenFQNames="true"> |
| <variable name="VIEW" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| </context> |
| </template> |
| <template name="gone" value="$VIEW$.setVisibility(android.view.View.GONE);" description="Set view visibility to GONE" toReformat="true" toShortenFQNames="true"> |
| <variable name="VIEW" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="JAVA_STATEMENT" value="true" /> |
| </context> |
| </template> |
| </templateSet> |
| |