##What is this? A collection of useful live templates that you can use within your AndroidStudio or IntelliJ IDEA installation.
##I can haz? Yes. Simply clone the repository to your AndroidStudio's config/templates folder.
JetBrains has you covered in finding the location of this folder.
Once you found it, cd
into it, run git clone https://github.com/keyboardsurfer/idea-live-templates .
and restart AndroidStudio.
##Currently included live templates
fbc
: "findViewById with cast"foreach
: "Create a for each loop"IntentView
: "Creates an Intent with ACTION_VIEW"logd
: "Log.d(TAG, String)"loge
: "Log.e(TAG, String)"logi
: "Log.i(TAG, String)"LogTag
: "A static logtag with your current classname"newInstance
: "create a new Fragment instance with arguments"pf
: "private static final variable with type and member"psf
: "private static final variable with type and member"rgC
: "get a color from resources"rgS
: "get a String from resources"rouiT
: "runOnUIThread"sbc
: "block comment for structuring code"Sfmt
: "String format"Toast
: "Create a new Toast"ViewConstructors
: "Adds generic view constructors"wrapIt
: "adds a gradle wrapper task"wtf
: "Log.wtf(TAG, String)"
ccode
: "code tag for javadoc"cfalse
: "puts false in a comment section"clink
: "link from within javadoc"ctrue
: "puts true in a comment section"fixme
: "adds //FIXME"noop
: "indicate that a method does not have any operations"stopship
: "adds //STOPSHIP"todo
: "adds //TODO"
Crouton
: "Creates a new Crouton"CroutonFragment
: "Creates a new Crouton for display within a fragment"CroutonShow
: "Creates a new Crouton with Crouton.showText"onEvent
: "Adds onEvent method for eventbus"onEventMainThread
: "Adds onMainThreadEvent method for eventbus"
Parcelable
: "Create a parcelable block for your current class"ParcelableEnum
: "Create a parcelable block for your current enum"ParcelableEnumTest
: "Creates basic parcelable enum test methods"ParcelBoolean
: "writes a single boolean value to a parcel"UnparcelBoolean
: "reads a single boolean value from a parcel"UnparcelIntArray
: "Unparcels an int array"UnparcelStringArray
: "Unparcels a String array"
appNs
: "adds application namespace"lh
: "android:layout_height="""lhm
: "android:layout_height="match_parent""lhw
: "android:layout_height="wrap_content""lw
: "android:layout_width="""lwm
: "android:layout_width="match_parent""lww
: "android:layout_width="wrap_content""toolsNs
: "adds tools namespace to Android xml file"
###AndroidGradleDependencies.xml
async-http
: "A Callback-Based Http Client Library for Android"crouton
: "Context sensitive notifications for Android"eventbus
: "Android optimized publish/subscribe event bus."gson
: "Java library to serialize and deserialize Java objects to (and from) JSON."mediarouter
: "Routing of media channels and streams from the current device to external speakers and destination devices"nineoldandroids
: "Honeycomb (Android 3.0) animation API on all versions of the platform."okhttp
: "An HTTP+SPDY client for Android and Java applications."palette
: "A helper class to extract prominent colors from an image."picasso
: "A powerful image downloading and caching library for Android."play-services
: "A powerful image downloading and caching library for Android."recyclerview
: "A flexible view for providing a limited window into a large data set. "retrofit
: "Retrofit turns your REST API into a Java interface."smooth-progressbar
: "Smooth indeterminate progress bar."smooth-progressbar-circular
: "Smooth indeterminate circular progress bar."sv4
: "Support v4(api level 4) library."sv7
: "Support v7(api level 7) library."sv7cardview
: "A FrameLayout with a rounded corner background and shadow."sv7grid
: "Support GridLayout library v7(api level 7)"universal-image-loader
: "A powerful image downloading and caching library for Android."
##Contribution
- Fork
- Add your own live templates
- Send me a pull request
- Wait
- Profit