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

1

6

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.

Marisolmarissa answered 23/7, 2014 at 9:31 Comment(3)
What exactly do you want change? Did you try extending the PagerSlidingTabStrip class in your project?Hendecahedron
your link to tutorial is working and was explained very clearlyPeper
Ok, I think I get it now. I need to extend the PagerSlidingTabStrip class and do whatever I want in my own class, right? I got confused because the author kept the same name and I thought I could modify the depended library itself...Marisolmarissa
M
5

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

Marisolmarissa answered 23/7, 2014 at 10:46 Comment(1)
Such a simple solution yet I didnt think of it. Thanks!Semen

© 2022 - 2024 — McMap. All rights reserved.