package org.wikipedia.feed.searchbar;

import android.content.Context;
import android.view.View;

import org.wikipedia.R;
import org.wikipedia.feed.view.DefaultFeedCardView;
import org.wikipedia.util.FeedbackUtil;

import butterknife.BindView;
import butterknife.ButterKnife;

public class SearchCardView extends DefaultFeedCardView<SearchCard> {
    @BindView(R.id.search_container) View searchContainer;
    @BindView(R.id.voice_search_button) View voiceSearchButton;

    public SearchCardView(Context context) {
        super(context);

        inflate(getContext(), R.layout.view_search_bar, this);
        ButterKnife.bind(this);
        FeedbackUtil.setToolbarButtonLongPressToast(voiceSearchButton);

        searchContainer.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (getCallback() != null) {
                    getCallback().onSearchRequested();
                }
            }
        });

        voiceSearchButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (getCallback() != null) {
                    getCallback().onVoiceSearchRequested();
                }
            }
        });
    }
}
package org.wikipedia.feed.searchbar;

import android.content.Context;

import org.wikipedia.R;
import org.wikipedia.feed.view.DefaultFeedCardView;
import org.wikipedia.util.FeedbackUtil;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class SearchCardView extends DefaultFeedCardView<SearchCard> {
    public SearchCardView(Context context) {
        super(context);
        inflate(getContext(), R.layout.view_search_bar, this);
        ButterKnife.bind(this);
        FeedbackUtil.setToolbarButtonLongPressToast(findViewById(R.id.voice_search_button));
    }

    @OnClick(R.id.search_container) void onSearchClick() {
        if (getCallback() != null) {
            getCallback().onSearchRequested();
        }
    }

    @OnClick(R.id.voice_search_button) void onVoiceSearchClick() {
        if (getCallback() != null) {
            getCallback().onVoiceSearchRequested();
        }
    }
}
convert SearchCardView to Butter Knife