-
Notifications
You must be signed in to change notification settings - Fork 267
/
Android.xml
120 lines (119 loc) · 8.06 KB
/
Android.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="Android">
<template name="Toast" value="android.widget.Toast.makeText($className$.this, "$text$", Toast.LENGTH_SHORT).show();" description="Create a new Toast" toReformat="true" toShortenFQNames="true">
<variable name="className" expression="className()" 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" />
</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>