Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Live template for ConstraintLayout xml attributes for Android
<templateSet group="ConstraintLayout">
<template name="cbb" value="app:layout_constraintBottom_toBottomOf=&quot;$cursor$&quot;" description="constraint bottom to bottom of id" toReformat="true" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="cbp" value="app:layout_constraintBottom_toBottomOf=&quot;parent&quot;" description="constraint bottom to bottom of parent" toReformat="true" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="cbt" value="app:layout_constraintBottom_toTopOf=&quot;$cursor$&quot;" description="constraint bottom to top of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="cll" value="app:layout_constraintLeft_toLeftOf=&quot;$cursor$&quot;" description="constraint left to left of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="clp" value="app:layout_constraintLeft_toLeftOf=&quot;parent&quot;" description="constraint left to left of parent" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="clr" value="app:layout_constraintLeft_toRightOf=&quot;$cursor$&quot;" description="constraint left to right of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="crl" value="app:layout_constraintRight_toLeftOf=&quot;$cursor$&quot;" description="constraint right to left of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="crp" value="app:layout_constraintRight_toRightOf=&quot;parent&quot;" description="constraint right to right of parent" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="crr" value="app:layout_constraintRight_toRightOf=&quot;$cursor$&quot;" description="constraint right to right of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="ctb" value="app:layout_constraintTop_toBottomOf=&quot;$cursor$&quot;" description="constraint top to bottom of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="ctp" value="app:layout_constraintTop_toTopOf=&quot;parent&quot;" description="constraint top to top of parent" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="ctt" value="app:layout_constraintTop_toTopOf=&quot;$cursor$&quot;" description="constraint top to top of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="cpp" value="app:layout_constraintBottom_toBottomOf=&quot;parent&quot;&#10;app:layout_constraintEnd_toEndOf=&quot;parent&quot;&#10;app:layout_constraintStart_toStartOf=&quot;parent&quot;&#10;app:layout_constraintTop_toTopOf=&quot;parent&quot;&#10;" description="constraint center of parent" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="css" value="app:layout_constraintStart_toStartOf=&quot;$cursor$&quot;" description="constraint start to start of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="csp" value="app:layout_constraintStart_toStartOf=&quot;parent&quot;" description="constraint start to start of parent" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="cse" value="app:layout_constraintStart_toEndOf=&quot;$cursor$&quot;" description="constraint start to end of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="ces" value="app:layout_constraintEnd_toStartOf=&quot;$cursor$&quot;" description="constraint end to start of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="cep" value="app:layout_constraintEnd_toEndOf=&quot;parent&quot;" description="constraint end to end of parent" toReformat="false" toShortenFQNames="true">
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
<template name="cee" value="app:layout_constraintEnd_toEndOf=&quot;$cursor$&quot;" description="constraint end to end of id" toReformat="false" toShortenFQNames="true">
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="XML" value="true" />
<option name="XML_TEXT" value="false" />
</context>
</template>
</templateSet>
@kimkevin

This comment has been minimized.

Copy link

@kimkevin kimkevin commented Mar 7, 2018

전 subscribeOn, observeOn을 라이브템플릿으로 쓰고 있는데, 좋은거 같아요!! 설정 추가해서 써봐야겠어요 👍 💯

@Pluu

This comment has been minimized.

Copy link

@Pluu Pluu commented Apr 10, 2018

<template name="cpp" value="app:layout_constraintBottom_toBottomOf=&quot;parent&quot;&#10;app:layout_constraintEnd_toEndOf=&quot;parent&quot;&#10;app:layout_constraintStart_toStartOf=&quot;parent&quot;&#10;app:layout_constraintTop_toTopOf=&quot;parent&quot;&#10;" description="constraint center of parent" toReformat="false" toShortenFQNames="true">
    <context>
      <option name="XML" value="true" />
      <option name="XML_TEXT" value="false" />
    </context>
  </template>
  <template name="css" value="app:layout_constraintStart_toStartOf=&quot;$cursor$&quot;" description="constraint start to start of id" toReformat="false" toShortenFQNames="true">
    <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="XML" value="true" />
      <option name="XML_TEXT" value="false" />
    </context>
  </template>
  <template name="csp" value="app:layout_constraintStart_toStartOf=&quot;parent&quot;" description="constraint start to start of parent" toReformat="false" toShortenFQNames="true">
    <context>
      <option name="XML" value="true" />
      <option name="XML_TEXT" value="false" />
    </context>
  </template>
  <template name="cse" value="app:layout_constraintStart_toEndOf=&quot;$cursor$&quot;" description="constraint start to end of id" toReformat="false" toShortenFQNames="true">
    <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="XML" value="true" />
      <option name="XML_TEXT" value="false" />
    </context>
  </template>
  <template name="ces" value="app:layout_constraintEnd_toStartOf=&quot;$cursor$&quot;" description="constraint end to start of id" toReformat="false" toShortenFQNames="true">
    <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="XML" value="true" />
      <option name="XML_TEXT" value="false" />
    </context>
  </template>
  <template name="cep" value="app:layout_constraintEnd_toEndOf=&quot;parent&quot;" description="constraint end to end of parent" toReformat="false" toShortenFQNames="true">
    <context>
      <option name="XML" value="true" />
      <option name="XML_TEXT" value="false" />
    </context>
  </template>
  <template name="cee" value="app:layout_constraintEnd_toEndOf=&quot;$cursor$&quot;" description="constraint end to end of id" toReformat="false" toShortenFQNames="true">
    <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
      <option name="XML" value="true" />
      <option name="XML_TEXT" value="false" />
    </context>
  </template>

@kingori 님 작업에 추가로 더 넣어서 쓰는 중

@kingori

This comment has been minimized.

Copy link
Owner Author

@kingori kingori commented Apr 22, 2018

적용방법: https://www.jetbrains.com/help/idea/sharing-live-templates.html 참고: 각 os 별 template 저장위치에 위 파일을 저장한다.

@kingori

This comment has been minimized.

Copy link
Owner Author

@kingori kingori commented Jul 24, 2020

mac 기준 디렉터리 변경: ~/Library/Preferences/AndroidStudio4.0/templates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment