Giter Site home page Giter Site logo

chenym-dev / ditchbutterknife Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aungthiha/ditchbutterknife

0.0 1.0 0.0 18 KB

A script to remove ButterKnife code and use Android Built-in methods instead

License: GNU General Public License v3.0

Python 100.00%

ditchbutterknife's Introduction

For some reasons, you might want to ditch ButterKnife but you feel like it's a lot of work because you have a lot of ButterKnife code in your codebase. This script will do 90% of the work for you in seconds. The script will recursively walk through all the folders of the directory you specify and will edit all the java class files in all of them. I said 90% because you will find a few minor errors but worry not, those minor errors can be fixed easily.

Requirements

  • Python3

How to use

"support_library_version_number" is optional and you can only specify 26 for it. Support Library 26 removes the trouble of typecasting the views. By the time I wrote this script, it's still in beta. That's why I added this option.

  • $ python run.py path support_library_version_number

Example

  • $ python run.py ~/Projects/SampleApp/app/src/main/java/com/aung/sample 26

What doesn't work

  • If a java class file has one or more inner classes, you will have some minor errors that you need to fix manually
  • If you write @BindView statement in two lines, this won't work
  • This script doesn't support OnClick binding

ditchbutterknife's People

Contributors

aungthiha avatar

Watchers

 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.