GDG Location GDG Ratoma WindowInsets // get WindowInsets object from listener view.setOnApplyWindowInsetsListener { view, insets -> // See if the IME is visible val imeVisible = insets.isVisible((WindowInsets.Type.ime())) }
GDG Location GDG Ratoma WindowInsets // get WindowInsets object from listener view.setOnApplyWindowInsetsListener { view, insets -> // See if the IME is visible val imeVisible = insets.isVisible((WindowInsets.Type.ime())) if (imeVisible) { val imeInsets = insets.getInsets(WindowInsets.Type.ime()) // ... } }
GDG Location GDG Ratoma IME Animations ● Synchroniser les animations du clavier avec les modifications du contenu de l'application ○ Écouter les changements ■ ET / OU ○ Conduire directement l'animation du clavier logiciel
GDG Location GDG Ratoma Conversations // Create and post shortcut val person = Person.Builder().build() val shortcutInfo = ShortcutInfoCompat.Builder(this, "sampleShortcut"). setPerson(person). setLongLived(true). // ... build()
GDG Location GDG Ratoma Conversations // Create and post shortcut val person = Person.Builder().build() val shortcutInfo = ShortcutInfoCompat.Builder(this, "sampleShortcut"). setPerson(person). setLongLived(true). // ... build() ShortcutManagerCompat.pushDynamicShortcut(shortcutInfo)
GDG Location GDG Ratoma Bubbles ● Notifications qui peuvent s'afficher comme des bulles ● Android 10 : Option de développeur ○ Android 11 : Elles sont arrivées ● Meilleur que System Alert Window! ● Créé avec Notification API ○ avec plus de metadata ○ et son propre Activity
GDG Location GDG Ratoma Privacy Android 11 enables state of the art privacy and security features, protecting users and their data from access by malicious apps, while simultaneously making access of that data more transparent to the user.
GDG Location GDG Ratoma Data Access Auditing • Listen for when user-permission-required data is accessed • Great for large apps or use of external libraries
GDG Location GDG Ratoma ● Plus restrictif dans Android 11 ● D’abord, demandez la permission de premier plan ● Puis demandez la permission d'arrière-plan ○ L’utilisateur arrive à Settings Background Location
GDG Location GDG Ratoma Crash Reasons Querying // Returns List of ApplicationExitInfo val reasonsList = activityManager.getHistoricalProcessExitReasons( packageName, pid /* 0 for all matches */, max /* 0 for all */)
GDG Location GDG Ratoma Crash Reasons Querying // Returns List of ApplicationExitInfo val reasonsList = activityManager.getHistoricalProcessExitReasons( packageName, pid /* 0 for all matches */, max /* 0 for all */) for (info in reasonsList) { // Log/store/upload info.reason // REASON_LOW_MEMORY, REASON_CRASH, REASON_ANR, etc. }
GDG Location GDG Ratoma Changements de fonctionnement ● La plupart de changements sont limités a targetSdk R ● Essayez les changements avec les bascules de fonctionnement ○ Command-line ○ Nouveau panneau de Développeur Options
GDG Location GDG Ratoma Animated HEIF ● Chargez des images animées à partir de fichiers HEIF ● AnimatedImageDrawable ○ Comme GIFs animées ○ Mais plus petites !
GDG Location GDG Ratoma Animated HEIFs val file = File(“someHeifFile”) val source = ImageDecoder.createSource(file) // Perform off main thread val drawable = ImageDecoder.decodeDrawable(source); if (drawable is AnimatedImageDrawable) { drawable.start() }
GDG Location GDG Ratoma NDK: OpenSL ES @Deprecated ● Oboe for the win ! ● Unbundled C++ library ○ High-performance audio ○ Works back to API 16 ○ Open source github.com/google/oboe
GDG Location GDG Ratoma Variable refresh rate ● For apps with their own rendering loop ○ e.g., games ● 60 frames per second used to be a given ○ Now some devices support 90, 120 Hz ○ Enables more flexible backoff rates ● Surface.setFrameRate() 120 fps 60
GDG Location GDG Ratoma L'intégration d’autofill au clavier ● Voir autofill contenu dans le clavier ○ Claviers logiciels ○ Les applis de mot de passe ● Sécurité - le clavier obtient l’UI a présenter les données, mais pas les données eux-même
GDG Location GDG Ratoma Jetpack ● 70+ bibliothèques ● mises à jour chaque deux semaines ● Neuf / récent ○ Hilt: Dependency injection (Dagger) ○ Paging 3.0: Tout Kotlin, avec coroutines ○ CameraX Beta ○ … et plus !
GDG Location GDG Ratoma Google Play ● Nouvelle Play console : complètement repensé ○ plus claire, plus facile à utiliser ○ policy status section ○ acquisition reports ○ team management ● Maintenant en Beta ○ play.google.com/console