An Android Studio plugin to help remove use of ButterKnife

Overview

RemoveButterKnife

Android Arsenal

What's the plugin

An Android Studio plugin to help remove use of ButterKnife

Why i do this

ButterKnife is a wellknow open source tool to help you inject your view, but some times, you use plugin to gen butterknife's code, but you don't want to use it again.

It's a very horrible job to delete every line inject code and write findviewbyid code, so, i made this plugin to do it.

How to use it

(You can search it on your AS plugin install page, name is RemoveButterKnife)

1.Clone the code and build it in your idea

2.Then, you can find a jar, install it as a plugin in your AndroidStudio**(You also can find the jar in the project)**

3.Open your Activity/Fragment you want to change.

4.Find the RemoveButterKnife button in your android studio edit menu

The idea of how to design and implement it

You can see this blog

中文版

English

License

See the LICENSE file for license rights and limitations(GNU3.0)

NextStep

On the way
Comments
  • Need modification

    Need modification

    Thank you for the plugin, it helps me . I have noticed just one problem.

    Applying the plugin on this code :

    public class StockUpdateViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.stock_item_symbol) TextView stockSymbol;

    StockUpdateViewHolder(View v) { super(v); ButterKnife.bind(this, v); }

    Makes that :

    public class StockUpdateViewHolder extends RecyclerView.ViewHolder { TextView stockSymbol;

    StockUpdateViewHolder(View v) { super(v); }

    Instead of :

    public class StockUpdateViewHolder extends RecyclerView.ViewHolder { TextView stockSymbol;

    StockUpdateViewHolder(View v) { super(v); stockSymbol = v.findViewById(R.id.stock_item_symbol); }

    opened by MS893 4
  • Now replacing ButterKnife.bind call with findViewById() so it works o…

    Now replacing ButterKnife.bind call with findViewById() so it works o…

    …n a wider variety of class types

    Thanks for your work on this! I noticed that some improvements could be made. The main problem is that it was only working on Activity's for me, but we needed this to work on any class that was using ButterKnife(Dialog, View, Fragment, etc.)

    So I modified the plugin so that it replaces the ButterKnife.bind() with the findViewById's, rather than searching for specific keywords like "setContentView" etc. It also now removes the empty lines left after removing imports, etc and has some other minor format changes.

    I think it would be worth pushing this new .jar up to the repo for others to enjoy. Thanks again!

    opened by JonWatson 1
  • unfortunately,it do not work in my android studio

    unfortunately,it do not work in my android studio

    cannot create class "com.u3.MainAction" [Plugin: com.u3coding.removebutterknife] com.intellij.diagnostic.PluginException: cannot create class "com.u3.MainAction" [Plugin: com.u3coding.removebutterknife] at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(ActionManagerImpl.java:177) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convert(ActionManagerImpl.java:515) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getActionImpl(ActionManagerImpl.java:495) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.java:488) at com.intellij.openapi.actionSystem.DefaultActionGroup.unStub(DefaultActionGroup.java:354) at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(DefaultActionGroup.java:312) at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:125) at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:86) at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:280) at com.intellij.openapi.actionSystem.impl.ActionMenu.fillMenu(ActionMenu.java:314) at com.intellij.openapi.actionSystem.impl.ActionMenu.access$600(ActionMenu.java:50) at com.intellij.openapi.actionSystem.impl.ActionMenu$MenuListenerImpl.menuSelected(ActionMenu.java:268) at javax.swing.JMenu.fireMenuSelected(JMenu.java:1028) at javax.swing.JMenu$MenuChangeListener.stateChanged(JMenu.java:1107) at javax.swing.DefaultButtonModel.fireStateChanged(DefaultButtonModel.java:333) at javax.swing.DefaultButtonModel.setSelected(DefaultButtonModel.java:215) at javax.swing.JMenu.setSelected(JMenu.java:294) at com.apple.laf.ScreenMenu$1.run(ScreenMenu.java:117) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199) at apple.awt.CToolkit$CPeerEvent.dispatch(CToolkit.java:1221) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715) at java.awt.EventQueue.access$400(EventQueue.java:82) at java.awt.EventQueue$2.run(EventQueue.java:676) at java.awt.EventQueue$2.run(EventQueue.java:674) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86) at java.awt.EventQueue.dispatchEvent(EventQueue.java:685) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: com.intellij.diagnostic.PluginException: com/u3/MainAction : Unsupported major.minor version 52.0 [Plugin: com.u3coding.removebutterknife] at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:130) at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:77) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:249) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(ActionManagerImpl.java:153) ... 35 more Caused by: java.lang.UnsupportedClassVersionError: com/u3/MainAction : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.lang.ClassLoader.defineClass(ClassLoader.java:471) at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:260) at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:256) at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:225) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:124) ... 41 more

    opened by JonaNorman 1
  • Now replacing ButterKnife.bind call with findViewById() so it works o…

    Now replacing ButterKnife.bind call with findViewById() so it works o…

    …n a wider variety of class types

    Thanks for your work on this! I noticed that some improvements could be made. The main problem is that it was only working on Activity's for me, but we needed this to work on any class that was using ButterKnife(Dialog, View, Fragment, etc.)

    So I modified the plugin so that it replaces the ButterKnife.bind() with the findViewById's, rather than searching for specific keywords like "setContentView" etc. It also now removes the empty lines left after removing imports, etc and has some other minor format changes.

    I think it would be worth pushing this new .jar up to the repo for others to enjoy. Thanks again!

    opened by JonWatson 0
  • Now replacing ButterKnife.bind call with findViewById() so it works o…

    Now replacing ButterKnife.bind call with findViewById() so it works o…

    …n a wider variety of class types

    Thanks for your work on this! I noticed that some improvements could be made. The main problem is that it was only working on Activity's for me, but we needed this to work on any class that was using ButterKnife(Dialog, View, Fragment, etc.)

    So I modified the plugin so that it replaces the ButterKnife.bind() with the findViewById's, rather than searching for specific keywords like "setContentView" etc. It also now removes the empty lines left after removing imports, etc and has some other minor format changes.

    opened by JonWatson 0
  • Android Studio 3.5 Beta 4 仅删除不生成 ; Kotlin类无法使用

    Android Studio 3.5 Beta 4 仅删除不生成 ; Kotlin类无法使用

    Android Studio 3.5 Beta 4 Build #AI-191.7141.44.35.5619324, built on May 31, 2019 JRE: 1.8.0_202-release-1483-b03 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

    opened by nEdAy 1
Owner
u3shadow
A software engineer
u3shadow
An Android Studio / IntelliJ plug-in help you upload your apk or listing to Google Play.

DroidLane An Android Studio / IntelliJ plug-in help you upload your apk or listing to Google Play. Installation Open Android Studio or IntelliJ IDEA O

Jintin 24 Jul 26, 2021
Gradle plugin to help use create project

Infra-Gradle-Plugin 该插件旨在简化 Gradle 项目配置,几行代码就可以迅速开始一个项目, 仅支持 Kotlin DSL, Groovy 未测试! 引入插件 plugins { id("com.labijie.infra") version "your version"

Red Sparrow 0 Dec 23, 2021
A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.

ADB Idea A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development. The following commands are provided: Uninst

Philippe Breault 2k Dec 28, 2022
IntelliJ / Android Studio plugin for Android Holo Colors

This project is not maintained anymore. Holo Colors doesn't make sense since the introduction of Material Design and the ability to set the primary co

Jérôme Van Der Linden 644 Nov 10, 2022
ADB WIFI Android Studio plugin for debug android app over Wi-Fi.

ADB WIFI ADB WIFI Android Studio plugin for debug android app over Wi-Fi. How to install in Android Studio: go to Preferences

Sutachad Wichai 298 Jan 3, 2023
Android Studio plugin which automatically generates drawable selectors from appropriately named resources.

SelectorChapek for Android This Android Studio plugin automatically generates drawable selectors from appropriately named Android resources. How to in

Inmite s.r.o. 1.6k Dec 29, 2022
Android Studio & IntelliJ Plugin for sort xml by name="xxx".

AndroidXmlSorter Android Studio & IntelliJ Plugin for sort xml by name="xxx". Options Insert space between difference prefix ('Snake Case', 'Camel Cas

Kaoru Tsutsumishita 102 Nov 29, 2022
DroidScript plugin example for Android Studio

Plugin-Java This is a basic example/template for building DroidScript plugins using Android Studio v4+ You can make and install the plugin to your dev

droidscript.org 8 Sep 25, 2022
This is an android studio plugin that allows you to creates new color in hex format based on a percentage (0-100) and a base color you specify.

alpha-color Description This is an android studio plugin that allows you to creates new color in hex format based on a percentage (0-100) and a base c

null 1 Nov 12, 2021
A plugin for Android Studio that speeds up your day-to-day flutter development.

Flutter-Toolkit 中文文档 A plugin for Android Studio that speeds up your day-to-day flutter development. Flutter ToolKit(Flutter Build Runner Helper), to

苏晟 4 Oct 19, 2022
A powerful Gradle Plugin to help you demonstrate your android app

English | 简体中文 sample-gradle-plugin ?? A powerful Gradle Plugin to help you demonstrate your android app. We often write demo applications that contai

Yoo Zhou 12 Nov 5, 2022
This plugin help you to set material design icon to your project.

Android Material Design Icon Generator Plugin This plugin help you to set material design icons to your Android project. Installation Manually Downloa

Yusuke Konishi 2.4k Dec 30, 2022
[Deprecated] Android Studio IDE support for Android gradle unit tests. Prepared for Robolectric.

#[Deprecated] Google has finally released a proper solution for unit testing. Therefore this plugin will no longer be activlty maintained. android-stu

Evan Tatarka 236 Dec 30, 2022
gradle-android-scala-plugin adds scala language support to official gradle android plugin

gradle-android-scala-plugin gradle-android-scala-plugin adds scala language support to official gradle android plugin. See also sample projects at htt

saturday06 345 Dec 10, 2022
eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.

eventbus-intellij-plugin Plugin to navigate between events posted by EventBus. Post to onEvent and onEvent to Post Install There are two ways. Prefere

Shinnosuke Kugimiya 315 Aug 8, 2022
IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea

IntelliJ Idea Astor Plugin IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea. It communicates with a local/remote program

null 4 Aug 28, 2021
Intellij-platform-plugin-template - IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template TL;DR: Click the Use this template button and

null 0 Jan 1, 2022
BuildPlots-Plugin - PaperMC-Plugin for build contests written in Kotlin.

BuildPlotsPlugin PaperMC-Plugin for build contests. This is my first time using Kotlin and the first plugin I've written after a long time. It is stil

Lukas Heinzl 0 Jan 1, 2022
K6-intellij-plugin - IntelliJ-based Plugin to run k6 tests locally or in the k6 Cloud from your IntelliJ IDE

IntelliJ-based Plugin to run k6 tests locally or in the k6 Cloud from your Intel

Mikhail Bolotov 8 Jan 2, 2023