Live Template for RecyclerView Adapter in Android Studio

Mladen Rakonjac
Fleka Developers
Published in
2 min readSep 19, 2016

--

Thanks to Live Templates, Android development is faster than it was before. They help us to write less boring code and to focus more on the most important things. Let’s make a live template for RecyclerView Adapter. This is how we do it in fleka:

Type cmd + shift + A to find action , enter Add Template and press Enter button. Preferences window with File and Code Templates tab will be opened. Press ctrl + N to add a new template. Name it ,, RecyclerView Adapter “ and add the following code:

Click OK.

That’s it! You have added your first Live Template! Let’s try it:

  1. Go to 1: Project
  2. go to your java package
  3. Right Click on some of .java classes or anything else in your package
  4. Go to New
  5. You will see RecyclerViewAdapter , click on it

6. After that, a new window will pop up :

7. Write down the name of your new adapter into File name , e.g. ShopsRecyclerViewAdapter

8. Write down the name of your Model class, e.g. Shop

9. Write down the name of your layout, e.g. recycler_view_shop_item_layout

That’s it! Enjoy Android development using live templates! I hope to see more templates from other Android developers!

--

--