Git Product home page Git Product logo

viewbinding-migration's Introduction

viewbinding-migration

Android Studio plugin to help migrate from synthetics to view binding

Plugin works with android studio 4.2 build number 202.7660.26

plugin located in artifacts folder

How it works

Currently plugin works only with fragments. Action is located under generate menu group (Cmd + N). Running this action on fragment file will generate neccesary binding property with non null getter like this

private var _binding: ResultProfileBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!! 

It also will try to override onDestroyView method if it does not exist and will add necessary null assignment

override fun onDestroyView() {
    super.onDestroyView()
    _binding = null //when onDestroyView already overrided plugin will add only this line
}

All synthetics then will be replaced with correct binding properties using camelcase syntax

my_view_id -> myViewId

⚠️ WIP warning

The plugin is under heavy development, code is messy and should be refactored in the future, some features like nullable binding properties and activity migrations, nested layouts also in wip but you free to try and share some feedback 🙂

viewbinding-migration's People

Contributors

arthur-ghazaryan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.