Discontinuing Kotlin synthetics for views

Hallo Friends cellphone prices and specifications, In the article that you are reading this time with the title Discontinuing Kotlin synthetics for views, we have prepared this article well for you to read and take the information in it. hopefully the contents of the post Article Android Developers Blog, Article IFTTT, what we write you can understand. all right, have a nice reading..

Posted by Márton Braun, Developer Relations Engineer


ALT TEXT GOES HERE 

Synthetic properties to access views were created as a way to eliminate the common boilerplate of findViewById calls. These synthetics are provided by JetBrains in the Kotlin Android Extensions Gradle plugin (not to be confused with Android KTX).

In November 2020, we announced that this plugin has been deprecated in favor of better solutions, and we recommended removing the plugin from your projects. We know many developers still depend on this plugin’s features, and we’ve extended the support timeframe so you have more time to complete your migrations.

We are now setting a deadline for these migrations: the plugin will be removed in Kotlin 1.8, which is expected to be released by the end of 2022. At that time, you won’t be able to update your project to newer Kotlin versions if it still depends on the Kotlin Android Extensions plugin. This means that now is the time to perform the necessary migrations in your projects.

Instead of synthetics, we recommend using View Binding, which generates type-safe binding classes from XML layout files. These bindings provide convenient access to view references and they work safely for layouts with multiple configurations. See the migration guide for detailed instructions on how to adopt View Binding. If you encounter any issues, you can report a bug on the Issue Tracker.

When building new features, consider using Jetpack Compose, Android's modern UI toolkit. Layouts built with Compose are declarative Kotlin code, eliminating the need to work with view references.

Another feature included in the plugin is Parcelize, which helps you create parcelable classes. Parcelize is now available in the standalone kotlin-parcelize plugin with unchanged functionality. To get up and running with the new plugin, check out the Parcelize documentation page.

If you’re still using the Kotlin Android Extensions Gradle plugin, kick off your migration in time so that you can keep upgrading to new Kotlin releases in the future. This will enable you to use the latest language features and take advantage of tooling and compiler improvements.



from Android Developers Blog https://ift.tt/2NZBOtb
via IFTTT

Thus the article Discontinuing Kotlin synthetics for views

Enough of the articles Discontinuing Kotlin synthetics for views this time, hopefully it can be of benefit to all of you. well, see you in another article post.


You are now reading the article Discontinuing Kotlin synthetics for views By address link https://cellphone-prices-and-specifications.blogspot.com/2022/02/discontinuing-kotlin-synthetics-for.html


Previous
Next Post »
0 Komentar untuk "Discontinuing Kotlin synthetics for views"

Terima Kasih Sudah Berkomentar