Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Setter/Action removed in 10.0.0? #1428

Closed
paulwongkwan opened this issue Jan 11, 2019 · 3 comments
Closed

Is Setter/Action removed in 10.0.0? #1428

paulwongkwan opened this issue Jan 11, 2019 · 3 comments

Comments

@paulwongkwan
Copy link

When I use ButterKnife 10.0.0, it show cannot find symbol class Setter. Same happen on Action.

@contrudar
Copy link

contrudar commented Jan 15, 2019

yes, it was removed. You can find it here, also you will find that something was moved just to another place like butterknife.Setter and butterknife.Action. In the javadoc you'll find what to use instead methods like Butterknife.apply

@paulwongkwan
Copy link
Author

Javadoc is still 8.8.1 API
http://jakewharton.github.io/butterknife/javadoc/

Maybe I move back to 8.8.1 for now

@junlandroid
Copy link

junlandroid commented Feb 19, 2020

old code

        ButterKnife.apply(new View[]{llYears, llDataProductSubmit, tvSoftwareSubmit}, new ButterKnife.Setter<View, Boolean>() {
            @Override
            public void set(@NonNull View view, Boolean value, int index) {
                if (index == 2) {
                    view.setVisibility(value ? View.GONE : View.VISIBLE);
                } else {
                    view.setVisibility(value ? View.VISIBLE : View.GONE);
                }
            }
        }, mDataProductBean != null);

new code

ViewCollections.set(new View[]{llYears, llDataProductSubmit, tvSoftwareSubmit}, new Setter<View, Boolean>() {

            @Override
            public void set(@NonNull View view, @Nullable Boolean value, int index) {
                if (index == 2) {
                    view.setVisibility(value ? View.GONE : View.VISIBLE);
                } else {
                    view.setVisibility(value ? View.VISIBLE : View.GONE);
                }
            }
        }, mDataProductBean != null);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants