I want the output as it is shown in this gif
I implemented tabs as mentioned in this tutorial https://guides.codepath.com/android/ViewPager-with-FragmentPagerAdapter . I came across this tutorial https://github.com/ogaclejapan/SmartTabLayout/ , but it has a copyright and licensing on it. But I would like to know if the same could be achieved using in built android functionalities
This seems fairly easy. You need two set's of each icon. One grey and one white.
When you select an item (TabItem) , change the icon of tab to the white one, and change the icon of last selected tab to grey one.