tasomaniac / OpenLinkWith

Open the current webpage you have in another app. Magic! 🔮
https://play.google.com/store/apps/details?id=com.tasomaniac.openwith
Apache License 2.0
393 stars 33 forks source link

Refactor ResolveListAdapter #24

Closed tasomaniac closed 7 years ago

tasomaniac commented 7 years ago

ResolverActivity and ResolveListAdapter were taken from AOSP (I think Lollipop implementation)

After lots of refactorings, they were both still 400+ lines of code. I wanted to extract some logic into classes to make it easier to add features.

ResolverComparator class was already there. That is just moved to its own class. IntentResolver is extracted from the Adapter. Given a sourceIntent, it returns a sorted list of Applications that responds to the intent.