Is it possible to modify library file's source code in Android Studio from Gradle dependency

kouretinho picture kouretinho · Jul 23, 2014 · Viewed 7.6k times · Source

I recently switched from Eclipse to Android Studio and I'm experimenting with PagerSlidingTabStrip library.

Trying to customize the Tab Strip I came across the Triangle Pager Sliding Tab Strip which suggests to modify the source code of the dependency library. How can I modify the source code of a gradle dependency (in this case and in general)? I don't see any available PagerSlidingTabStrip.java in my project.

Answer

kouretinho picture kouretinho · Jul 23, 2014

In order for this to work you have to manually copy/paste the code for PagerSlidingTabStrip.java, into a new class in your own package, make changes in that file and use it exactly as before.

Note: if we want to be precise, this "extension" class does not really extend from PagerSlidingTabStrip, it's more of a replacement