首页 > 解决方案 > Editing an external library

问题描述

I have an external library in the project:

enter image description here

The project uses methods from this library

For me, the classes in this library are read-only

I need to change the method logic from an external library a little bit

What and how should I do?

Maybe I should create new class in project with the same logic? (+ my changes)

Maybe other solutions?

标签: javaandroidgradle

解决方案


如果您使用Kotlin,您可以使用它Extension Function来扩展类功能而无需extend它。您使用Java可以将类和overrideadd方法扩展到它。无需复制/粘贴类即可添加新功能。


推荐阅读