Hi Ritu, I have not tried this yet, but I can give you some pointers.
Firstly, you need to know the width of the tab at runtime and draw the indicator above the active tab. In my case, I used a fixed-width tab which is easier to calculate.
Then, use TabLayout's OnTabSelectedListener or TabLayoutOnPageChangeListener to determine the active tab position. Use this value to determine where to draw the indicator.