Android Studio plug-in for generating ButterKnife injections from selected layout XML.

Overview

ButterKnifeZelezny

Simple plug-in for Android Studio/IDEA that allows one-click creation of Butterknife view injections.

How to install

  • in Android Studio: go to Preferences → Plugins → Browse repositories and search for ButterKnife Zelezny

or

  • download it and install via Preferences → Plugins → Install plugin from disk

How to use it

  1. Make sure you have latest Butterknife lib on your classpath
  2. Right click on usage of desired layout reference (e.g. R.layout.main in your Activity or Fragment), then Generate and Generate ButterKnife Injections
  3. Pick injections you want, you also have an option to create ViewHolder for adapters.
  4. Click Confirm and enjoy injections in your code with no work!

Contributing

Pull requests are welcomed!

Common issue: The plugin is not working after I updated to new Android Studio

  • AS promts you to update plugins after update, you need to update them before using
  • Make sure you have Butterknife on your classpath
  • Make sure that your cursor is placed on a layout ID in a class having one of these types: Activity, Fragment, custom View or Adapter

Why 'Zelezny'?

Jan Železný is a famous Czech javelin thrower, Olympic champion and world record holder. With Zelezny's javelin, your butter knife will be much sharper!

See our other Czech personalities who help with #AndroidDev.

Comments
  • Menu item

    Menu item "generate Butterknife injections" does not show on Android studio 0.4.2

    Actions:

    • installed
    • android studio restart
    • right click on R.layout.alayout
    • choose generate
    • the item "generate Butterknife injections" does not appear.

    If you want more feedback I'm happy to give it to you.

    opened by gvlekke 16
  • why not support onlick()

    why not support onlick()

    i'm got a plug from you .someone add a Features .for example ....onclick .this ia a jar .i want you to add your plug.3Q.but i don't know your email .please tell me your email ..... [email protected]

    opened by vipheyue 11
  • Android Studio 1.3 141.2117773 with butterknife:7.0.1 can not use this plugin on OS X 10.10.4

    Android Studio 1.3 141.2117773 with butterknife:7.0.1 can not use this plugin on OS X 10.10.4

    Android Studio 1.3 141.2117773 with butterknife:7.0.1 can not use this plugin on OS X 10.10.4 and I have already added butterknife 7.0.1 lib on my classpath but I can't find Generate ButterKnife Injections in Generate menu the android-butterknife-zelezny version is 1.3.2

    opened by cybercarrot 10
  • Does not work autocomplete after generation @InjectView

    Does not work autocomplete after generation @InjectView

    Android Studio 1.3 preview 3.0. I faced with this issue on the earlier versions of AS. It is only for windows (I use windows 8.1). MacOS works correct.

    opened by IlyaEremin 6
  • Android Studio 1.1rc1 : ArrayIndexOutOfBoundsException

    Android Studio 1.1rc1 : ArrayIndexOutOfBoundsException

    Hi,

    I'm getting an error on Android Studio 1.1RC1 ArrayIndexOutOfBoundsException: 0: 0 with the version 1.1 and 1.2 of the plugin when I selected "Generate Butterknife Injections". the crash occurs instantly and the dialog doesn't appear. I did not test it on previous version of Android Studio.

    Any idea why this might be happening?

    Thanks

    opened by Christophe668 6
  • Menu option not appearing on layout static import

    Menu option not appearing on layout static import

    Not sure what I'm missing here, but I don't get any Generate ButterKnife Injections menu option under Generate

    No menu option

    As you may notice I'm using Android Studio 0.4.6 and Java 1.7.0, and latest ButterKnife as a gradle compile dependency:

    ButterKnife as dependency

    opened by eveliotc 6
  • Ids on <include/> tagged layouts are ignored

    Ids on tagged layouts are ignored

    if I have include tags in my layout, they are ignored:

    <include
          android:id="@+id/my_id"
          layout="@layout/my_layout"/>
    
    opened by romainpiel 6
  • Does this work with Android Studio 2.2 Preview Alpha 4 + ButterKnife 8.2.1?

    Does this work with Android Studio 2.2 Preview Alpha 4 + ButterKnife 8.2.1?

    Does this work with Android Studio 2.2 Preview Alpha 4 + ButterKnife 8.2.1?

    It doesn't for me, on Mac. (nothing appears in the command+N generated window)

    opened by ZakTaccardi 5
  • Is possible to add @OnClick listener one by one.

    Is possible to add @OnClick listener one by one.

    Hello.

    Could I use this plugin to this type:

        @OnClick(R.id.map_btn) void map_btn(View view) {...}
    
        @OnClick(R.id.private_chat_btn) void private_chat_btn(View view) {...}
    
        ...
    

    not in a same listener.

    opened by dyguests 5
  • Adding

    Adding "select/deselect all" checkbox

    Adding an option to select and deselect all views. This behaviour is particularly useful when the amount of views is big and we only need to inject few of them.

    opened by siempredelao 5
  • IDE Fatal Errors AGAIN...

    IDE Fatal Errors AGAIN...

    I'm sorry saw that after I updated to Version 1.3.1 yesterday.

    It report another NullPointerException.

    java.lang.NullPointerException
        at com.avast.android.butterknifezelezny.common.Utils.isClassAvailableForPsiFile(Utils.java:314)
        at com.avast.android.butterknifezelezny.butterknife.ButterKnifeFactory.findButterKnifeForPsiElement(ButterKnifeFactory.java:45)
        at com.avast.android.butterknifezelezny.navigation.NavigationMarkerProvider.getLineMarkerInfo(NavigationMarkerProvider.java:90)
        at com.intellij.codeInsight.daemon.impl.LineMarkersPass.addLineMarkers(LineMarkersPass.java:166)
        at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:105)
        at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:67)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:438)
        at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1104)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:429)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:426)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:402)
        at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask.exec(JobLauncherImpl.java:202)
        at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
        at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
        at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
        at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)
    

    Thanks for fix this bug in advance~

    opened by johnwatsondev 5
  • can not generate butterknife

    can not generate butterknife

    I have installed android studio 3.0.1 and added butterknife in gradel and restarted my idea but when ever I try to bind my elements using butterknife there is no option on Alt+ins popup. Is this might related to AS version?

    opened by a-bayat 0
  • sometimes it  doesn't work  with ConstraintLayout

    sometimes it doesn't work with ConstraintLayout

    I'm trying to use both contraint library and butterknife like that: implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    When I do that operation "Generate ButterKnife Injections" with the layout ,it doesn't work and there is no tips or logs. But when I do with the same operation which layout doesn't use ConstraintLayout it works. I can't find the problem,please help.

    opened by jianlin00000 0
  • A little advice

    A little advice

    Hello, I have been using your tool and feel that he is very good. Then I have some Suggestions about improving the tool, but please forgive me that my English is not very good.Usually we all in BaseActivity to initialize and logout, but each time you use your tools, he will help me to automatically generate initialization and cancellation of the code, I need to delete these again, so can you have an option on the panel allows users to choose, would you like to automatically generate initialization and cancellation of the code, it will be more convenient, and I found butterknife have updated, hope you have time to upgrade, thanks

    opened by moneeWong 0
Releases(1.6.0)
Owner
Avast
https://avast.github.io
Avast
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
An IDE plug-in for quick access to Jetpack Compose controls

An IDE plug-in for quick access to Jetpack Compose controls

Jetpack Compose Museum 17 Aug 28, 2022
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
[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
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
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
plugin to use to replace text in android studio

replace-text-plugin Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get known with the template documentation. Verify the p

null 1 Nov 29, 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
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
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

null 3.9k Dec 30, 2022
IntelliJ Plugin for Android Parcelable boilerplate code generation.

IntelliJ/Android Studio Plugin for Android Parcelable boilerplate code generation This tool generates an Android Parcelable implementation based on fi

Michał Charmas 2.1k Dec 27, 2022
Maven Plugin for Android Application development and more

ANDROID MAVEN PLUGIN A plugin for Android application development with Apache Maven 3.0.5+ and the Android SDK. Please check out our website for furth

simpligility 1k Jan 4, 2023
Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

Jake Wharton 1.4k Dec 29, 2022
A Gradle plugin to support the Groovy language for building Android apps

Groovy language support for Android Deprecated: This plugin has been deprecated in favor of Kotlin which has the full support of JetBrains and Google.

Groovy programming language 853 Dec 21, 2022
Add a different ribbon to each of your Android app variants using this gradle plugin. Of course, configure it as you will

Easylauncher gradle plugin for Android Modify the launcher icon of each of your app-variants using simple gradle rules. Add ribbons of any color, over

Mikel 960 Dec 18, 2022