Support Library • The last version of Support Library is 28.0.0 (released September 21, 2018) • There won’t be Support Library version that is related to API 29! (Android 10) https://youtu.be/Hyt7LR5mXLc
• All of Support Library artifacts migrated to the androidx.* namespace… • ...with the exception of Design Support Library com.android.support:design -> com.google.android.material:material • Not a part of Jetpack, hosted and maintained separately https://github.com/material-components/material-components-android
• major.minor.micro-suffix • alpha, beta, rc releases • Separated from Android API version (contrary to Support Library) ◦ versioning (re)started with 1.0.0 • No more minApi suffixes (e.g. appcompat-v7 -> appcompat)
version bumps can require some additional changes to your project or include API/behavior changes • Examine release notes before bumping AndroidX packages versions • Remember about transitive dependencies
Jetpack packages • Only stable releases are suitable for production… • ...but it’s worth to check what’s coming up (from time to time) • Early feedback matters ◦ Catch bugs before AndroidX package goes out to production ◦ Suggest API and behavior changes • How to track frequent releases of multiple packages?
core 1.2.0-alpha01, currently in beta • Notification Bubbles ◦ since core 1.2.0-alpha01, currently in beta • Dark Mode improvements ◦ recreating Activities and various fixes since appcompat 1.1.0, ◦ various fixes in core 1.2.0-alpha01 ◦ dark theme support in browser 1.2.0-alpha07 • Dark Mode (Material Components): ◦ 1.1.0-beta01 contains Material Dark Theme for all components
◦ since stable fragment 1.1.0 (FragmentActivity, Fragment) ◦ since stable appcompat 1.1.0 (AppCompatActivity) • FragmentContainerView ◦ since fragment 1.2.0-alpha02, currently in rc ◦ replaces usage of FrameLayout, fixes animation z-index ordering issues and window insets dispatching
in stable activity 1.0.0 ◦ a composable alternative to overriding onBackPressed() // MyFragment.kt val callback = object : OnBackPressedCallback(true) { override fun handleOnBackPressed() { ... } } requireActivity().onBackPressedDispatcher.addCallback(this, callback)
in stable savedstate 1.0.0 ◦ plugin components into the restore / saveInstanceState process // MyActivity.kt val key = "SAVED_STATE_KEY" savedStateRegistry.registerSavedStateProvider(key) { Bundle().apply { ... } } val restored = savedStateRegistry.consumeRestoredStateForKey(key)
appropriate AndroidX library instead of a Support Library. android.enableJetifier=true The Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries.
transitive dependencies, even if they don’t need to be migrated • Takes 12 seconds on my medium-sized project (see https://proandroiddev.com/the-state-of-jetification-in-early-2019-plus-a-bonus- gradle-plugin-aac5854af910) • Can be a problem when running clean builds (e.g. on CI) • Most of the libraries already migrated to AndroidX: ◦ Firebase, Dagger, Glide, ButterKnife, Epoxy, LeakCanary (2.0) • Some of the libraries didn’t migrate yet: ◦ Facebook SDK • How do I know if can I drop Jetifier?
of the modules) whether there are any dependencies using support library instead of AndroidX artifacts. ./gradlew -Pandroid.enableJetifier=false canIDropJetifier Cannot drop Jetifier due to following external dependencies: * com.facebook.android:facebook-android-sdk:5.8.0 \-- com.facebook.android:facebook-login:5.8.0 \-- com.android.support:appcompat-v7:27.0.2 or No dependencies on old artifacts! Safe to drop Jetifier.
the time • Be aware of Jetpack’s new versioning and implications • Check out (from time to time) alpha, beta, rc versions and the release notes • Jetpack is not only a support layer for newer AOSP features… • ...but also provides many useful features... • ...not only bigger, but also smaller ones - but still very useful! • Be aware of the Jetifier tool and drop it when you can ◦ If you use my plugin I will be happy :-)