https://github.com/piasy/live-template
AndroidStudio and Idea live templates.
https://github.com/piasy/live-template
Last synced: 8 months ago
JSON representation
AndroidStudio and Idea live templates.
- Host: GitHub
- URL: https://github.com/piasy/live-template
- Owner: Piasy
- License: mit
- Created: 2016-08-04T00:05:29.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-04T00:30:33.000Z (almost 10 years ago)
- Last Synced: 2025-04-29T21:39:22.813Z (about 1 year ago)
- Language: Shell
- Size: 8.79 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# live-template
AndroidStudio and Idea live templates.
## Credit
Most of the templates are imported from:
+ [ztelur/Android-Studio-live-template](https://github.com/ztelur/Android-Studio-live-template)
+ [keyboardsurfer/idea-live-templates](https://github.com/keyboardsurfer/idea-live-templates)
Install script is based on [square/java-code-styles](https://github.com/square/java-code-styles)
## template content
### templates/Android.xml
- **`IntentView`**: "Creates an Intent with ACTION_VIEW"
- **`Sfmt`**: "String format"
- **`Toast`**: "Create a new Toast"
- **`ViewConstructors`**: "Adds generic view constructors"
- **`const`**: "Define android style int constant"
- **`fbc`**: "findViewById with cast"
- **`foreach`**: "Create a for each loop"
- **`gone`**: "Set view visibility to GONE"
- **`key`**: "Key for a bundle"
- **`newInstance`**: "create a new Fragment instance with arguments"
- **`noInstance`**: "private empty constructor to prohibit instance creation"
- **`rgS`**: "get a String from resources"
- **`rouiT`**: "runOnUIThread"
- **`sbc`**: "block comment for structuring code"
- **`starter`**: "Creates a static start(...) helper method to start an Activity"
- **`visible`**: "Set view visibility to VISIBLE"
- **`wrapIt`**: "adds a gradle wrapper task"
### templates/AndroidComments.xml
- **`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"
### templates/AndroidExternal.xml
- **`cob`**: "create a Observable"
- **`createObservable`**: "Create RxJava Observable"
- **`csub`**: "create a Subscriber"
- **`fmp1`**: "flatmap with func1"
- **`fob`**: "create observable by Observable.from"
- **`ft1`**: "filter with func1"
- **`job`**: "create observable by Observable.just"
- **`mp1`**: "map with func1"
- **`na0`**: "create an Action0 object"
- **`na1`**: "create an Action1 object"
- **`obmain`**: "observeOn(AndroidSchedulers.mainThread())"
- **`onEventMainThread`**: "Adds onMainThreadEvent method for eventbus"
- **`onEvent`**: "Adds onEvent method for eventbus"
- **`subio`**: "subscribeOn(Schedulers.io())"
### templates/AndroidLog.xml
- **`logd`**: "Log.d(TAG, String)"
- **`loge`**: "Log.e(TAG, String, Exception)"
- **`logi`**: "Log.i(TAG, String)"
- **`logm`**: "Log method name and its arguments"
- **`logr`**: "Log result of this method"
- **`logt`**: "A static logtag with your current classname"
- **`logw`**: "Log.w(TAG, String, Exception)"
- **`wtf`**: "Log.wtf(TAG, String, Exception)"
### templates/AndroidParcelable.xml
- **`ParcelBoolean`**: "writes a single boolean value to a parcel"
- **`ParcelableEnumTest`**: "Creates basic parcelable enum test methods"
- **`ParcelableEnum`**: "Create a parcelable block for your current enum"
- **`Parcelable`**: "Create a parcelable block for your current class"
- **`UnparcelBoolean`**: "reads a single boolean value from a parcel"
- **`UnparcelIntArray`**: "Unparcels an int array"
- **`UnparcelStringArray`**: "Unparcels a String array"
### templates/AndroidXML.xml
- **`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"
### templates/AndroidXMLExtend.xml
- **`LL`**: "LInearyLayout"
- **`txall`**: "all text property"
- **`txc`**: "android:text_color="""
- **`txs`**: "android:text_size="""
- **`txsc`**: "text color and text size"
### templates/Java.xml
- **`main`**: "create main func"
- **`pln`**: "System.out.println"