| <templateSet group="AndroidKotlin"> |
| <template name="IntentView" value="val intent = android.content.Intent() .setAction(Intent.ACTION_VIEW) .setData(android.net.Uri.parse($url$)) startActivity(intent)" description="Creates an Intent with ACTION_VIEW" toReformat="true" toShortenFQNames="true"> |
| <variable name="url" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="KOTLIN_STATEMENT" value="true" /> |
| </context> |
| </template> |
| <template name="key" value="private const val KEY_$value$ = "$value$"" description="Key for a bundle" toReformat="true" toShortenFQNames="true"> |
| <variable name="value" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="KOTLIN_TOPLEVEL" value="true" /> |
| <option name="KOTLIN_OBJECT_DECLARATION" value="true" /> |
| <option name="KOTLIN_STATEMENT" value="false" /> |
| <option name="KOTLIN_EXPRESSION" value="false" /> |
| </context> |
| </template> |
| <template name="newInstance" value="fun newInstance($args$): $fragment$ { val args = Bundle() $addArgs$ val fragment = $fragment$() fragment.arguments = args return fragment }" description="create a new Fragment instance with arguments" toReformat="true" toShortenFQNames="true"> |
| <variable name="args" expression="" defaultValue="" alwaysStopAt="true" /> |
| <variable name="fragment" expression="className()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="addArgs" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="KOTLIN_TOPLEVEL" value="true" /> |
| <option name="KOTLIN_CLASS" value="true" /> |
| <option name="KOTLIN_OBJECT_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="KOTLIN_STATEMENT" value="true" /> |
| <option name="KOTLIN_EXPRESSION" value="true" /> |
| </context> |
| </template> |
| <template name="rouiT" value="activity.runOnUiThread(java.lang.Runnable() { override fun run() { $cursor$ } })" description="runOnUIThread" toReformat="true" toShortenFQNames="true"> |
| <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="KOTLIN_STATEMENT" value="true" /> |
| </context>s |
| </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="KOTLIN_TOPLEVEL" value="true" /> |
| <option name="KOTLIN_CLASS" value="true" /> |
| </context> |
| </template> |
| <template name="starter" value="@JvmStatic fun start(context: android.content.Context) { val starter = Intent(context, $ACTIVITY$::class.java) .putExtra($CURSOR$) context.startActivity(starter) }" description="Creates a static start(...) helper method to start an Activity" toReformat="true" toShortenFQNames="true"> |
| <variable name="ACTIVITY" expression="className()" defaultValue="" alwaysStopAt="true" /> |
| <variable name="CURSOR" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="KOTLIN_TOPLEVEL" value="true" /> |
| <option name="KOTLIN_OBJECT_DECLARATION" value="true" /> |
| </context> |
| </template> |
| <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="KOTLIN_STATEMENT" value="true" /> |
| </context> |
| </template> |
| <template name="viewGone" value="$VIEW$.visibility = android.view.View.GONE" description="Set view visibility to GONE" toReformat="true" toShortenFQNames="true"> |
| <variable name="VIEW" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="KOTLIN_STATEMENT" value="true" /> |
| </context> |
| </template> |
| |
| <template name="viewVisible" value="$VIEW$.visibility = android.view.View.VISIBLE" description="Set view visibility to VISIBLE" toReformat="true" toShortenFQNames="true"> |
| <variable name="VIEW" expression="" defaultValue="" alwaysStopAt="true" /> |
| <context> |
| <option name="KOTLIN_STATEMENT" value="true" /> |
| </context> |
| </template> |
| </templateSet> |