Getting Started with Android programming-open source framework Butterknife

Source: Internet
Author: User

Reference Blog: Butterknife usage details (7.0 version)

Reference Blog: Android annotations using Butterknife 8.0 Introduction to Annotations

Reference blog: Android butterknife 8.4.0 How to use summary

Using the Butterknife Zelezny plugin

Reference blog: Android butterknife zelezny plug-in installation and use (visual one-click Generation)

Download

Use

Note: The annotation method does not work correctly.

Try to resolve:

View the official compilation configuration as follows:

dependencies {  compile ' com.jakewharton:butterknife:8.6.0 '  annotationprocessor ' Com.jakewharton: butterknife-compiler:8.6.0 '}
Buildscript {  repositories {    mavencentral ()   }  dependencies {    classpath ' Com.jakewharton: butterknife-gradle-plugin:8.6.0 '  }}
Apply plugin: ' com.android.library ' Apply plugin: ' Com.jakewharton.butterknife '

Address: Https://github.com/JakeWharton/butterknife

Reference blog: butterknife 8.0.1 not in effect

Note: Try to build, there is a build problem

Reference blog: What is Android Gradle build tool (Android Gradle build tools)?

Download SDK 25 with Build-tools 25.0.3

Note: Annotationprocessor Error issues

Reference blog: How to use annotations compiled for Android annotations android-apt How to switch to Annotationprocessor

Code Application Example:

    @BindView (r.id.login_progress)    ProgressBar loginprogress;    @BindView (r.id.user_text)    Autocompletetextview usertext;    @BindView (r.id.password_text)    EditText passwordtext;    @BindView (R.id.sign_in_button)    button Signinbutton;    @BindView (r.id.email_login_form)    linearlayout emailloginform;    @BindView (r.id.login_form)    ScrollView loginform;
@OnEditorAction (R.id.password_text) Public BooleanOnpasswordeditor (TextView TextView,intID, keyevent keyevent) {        if(id = = R.id.login | | id = =editorinfo.ime_null) {LOG.E ("IOException", "Onpasswordeditor");            Attemptlogin (); return true; }        return false; } @OnClick (R.id.sign_in_button) Public voidonsigninclicked () {LOG.E ("IOException", "onsigninclicked");    Attemptlogin (); }

Getting Started with Android programming-open source framework Butterknife

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.