Bump minSdkVersion to 21
As discussed in #1132, this PR bumps the minimum supported Android version to Lollipop (API 21). The benefits are the following:
- app is ~1.5 MB smaller, thanks to the removal of font assets (which aren't needed since Android 5+ includes all the fonts we need) and raster versions of vector drawables (that were generated at build time for pre-Lollipop compatibility)
- we gain the ability to update some dependencies which do not support anymore Android <5 (namely OkHttp and Retrofit)
- we avoid problems such as #857 caused by Android <5 not always supporting TLS 1.2
- we can leverage more modern CSS/JS features in WebView, some of which will help us to greatly improve maintainability in some areas
Most of the work in this PR has been put into removing custom typeface handling, which resulted in deleting TypefaceCache, CustomTypefaceSpan and replacing the uses of StyleableTextView's ghFont attribute with textStyle and fontFamily.
This makes StyleableTextViews work as one would expect in XML layouts, not ignoring typeface/textStyle/fontFamily attributes.
We should probably rename StyleableTextView into something different at this point? :thinking:
@maniac103 Probably it would be better to split CustomTypefaceSpan/TypefaceCache/ghFont removal in a separate PR? I understand that the diff is quite big right now.
I guess so, yes, but the main reason I do not want to merge this PR yet is that I think we/I should do a release with all of your fixes merged lately before, so the people with pre-5.0 devices get them.
Makes sense! I've set this PR as draft since it's gonna be paused now.
Just a personal opinion: I would still do a bump to min SDK 19 in any case because personally I don't feel very comfortable continuing to support Android versions that have a radically different WebView implementation, considering also that we did many changes to parts of the app that rely heavily on WebView (and thus I see a potentially higher chance of breaking something on older devices). WDYT?
WDYT?
Done: https://github.com/slapperwan/gh4a/commit/239dde8bcbe44e90e3c5fc4a1c1227fdbf23cd9b
@maniac103 This is now rebased and ready for review.
I've removed from this PR the TypefaceCache/ghFont attribute removal which was quite an invasive change and led to a high number (and chance) of conflicts.
I've also added a couple of small changes, including the removal of the "pressed" color for the fab, which was conflicting with the ripple effect introduced in API 21.
Despite the high number of "changed" files (many of them have been removed), this PR should be quite easy to review commit-by-commit.
Rebased again to fix a conflict.
@maniac103 How do we want to proceed with this? Given that this PR spans a fair number of files, I think it's best not to delay it further, especially if other big changes like the MD3 redesign are coming soon. This is also blocking a few other changes I'd like to make in separate PRs.
Since we have done the mentioned release in the mean time, let's ship this.