This repository contains templates to generate boilerplate code for an Android application.
Note: these templates are unfortunately not up-to-date for Android Studio 4.0 yet.
Creates a new screen: Fragment, ViewModel, View state, and Presenter.
Git cloned installation
Note: this method is unfortunately broken as of Android Studio 4. Please use the older install method described below, in the next section.
Clone the repository into your
<user>/.android/templates/other directory (might not exist by default), like such (mind the
. after the second command):
cd ~/.android/templates/other git clone [template repository path].git .
cd command on Windows might look like this instead, on a classic command prompt:
Whenever there's an update, you can then simply pull the templates via git:
Old, deprecated, manual installation method
Download the contents of this repository, and copy the
RainbowCakeListAdapterTemplate folders to the following path:
For example, on Windows, this might be here by default:
C:\Program Files\Android\Android Studio\plugins\android\lib\templates\other
Or roughly here, if you're using JetBrains Toolbox:
This does have the issue of having to be removed during Android Studio updates, which can be solved by the other installation mode mentioned above.
Right click either on the
ui package or any nested package inside the
ui package (hard requirement). Choose
New -> Other -> RainbowCake screen.
In the wizard that appears, enter:
- the name of the screen you wish to create in UpperCamelCase (but without any suffixes, no "
- the desired ViewState type for this screen (more info here)
- whether you'll want to pass arguments to the screen (a
LongID argument will be generated by default, as well as supporting code, such as a
Finish to create the screen, and add the created files to Git:
Generates a ListAdapter implementation plus a
DiffUtil.Callback stub. Installation and usage same as above, found in the
RainbowCakeListAdapterTemplate folder of this repository.