nhaarman / acorn

Mastering Android navigation :chipmunk:
https://nhaarman.github.io/acorn
Apache License 2.0
181 stars 7 forks source link

API 21 requirement? #142

Open NickvanDyke opened 5 years ago

NickvanDyke commented 5 years ago

The library requires a minSdk of 21. How safe is it to ignore that? Are there functions we can avoid once ignoring the minSdk requirement that will make it safe to use still? Thanks.

nhaarman commented 5 years ago

Running Lint on the project with minSdk 19 shows that the default SceneTransition implementations use the translationZ property on View, which was added in API 21: https://github.com/nhaarman/acorn/blob/496ad2b521e1f81003b41d613215721c9823ffe0/ext/acorn-android/src/main/java/com/nhaarman/acorn/android/transition/FadeInFromBottomTransition.kt#L50-L49

You could provide a custom SceneTransitionFactory to avoid these classes from being used.

Other than that, I see no other code using the newer APIs.

NickvanDyke commented 5 years ago

Cool, thanks. I figured it'd be something related to transitions.

May I ask what your future plans are for the lib? My team is considering using it in production, but are unsure how long you might stick with it or what you're hoping to do with it in the long term. Thanks for your work.

nhaarman commented 5 years ago

Cool! I think I'll stick with the minSdk of 21 though, to avoid possibly restricting development in the future.

We're currently using it in 4 small to mid-sized projects at our company, so you could say we're invested in it. The library itself is considered stable, breaking changes should not occur until 2.0.

As for the long term, I'm personally pretty excited for Kotlin Multiplatform, so this is a logical next step to look into!

As always it is important to know that new libraries always come with a cost, especially libraries that aren’t widely used. It is important to be aware of these costs when incorporating a new library into your application. Things that are unclear, broken or just not supported may be difficult to overcome at first. Modularization also comes with a cost. One of Acorn’s main pillars is modularization, which means that you may need to write extra code to wire everything together. Where Fragments and the Android Navigation Component make it easy to get things up and running very quickly but entangling and coupling occurs, this library is the exact opposite.