jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: convert SearchCardView to Butter Knife
......................................................................


Hygiene: convert SearchCardView to Butter Knife

Change-Id: Ia6f2d97f9155384ccce07ed664dea0c4f15e5796
---
M app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
1 file changed, 12 insertions(+), 23 deletions(-)

Approvals:
  Mholloway: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java 
b/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
index 6acf685..82348f5 100644
--- a/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
+++ b/app/src/main/java/org/wikipedia/feed/searchbar/SearchCardView.java
@@ -1,42 +1,31 @@
 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;
+import butterknife.OnClick;
 
 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);
+        
FeedbackUtil.setToolbarButtonLongPressToast(findViewById(R.id.voice_search_button));
+    }
 
-        searchContainer.setOnClickListener(new OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                if (getCallback() != null) {
-                    getCallback().onSearchRequested();
-                }
-            }
-        });
+    @OnClick(R.id.search_container) void onSearchClick() {
+        if (getCallback() != null) {
+            getCallback().onSearchRequested();
+        }
+    }
 
-        voiceSearchButton.setOnClickListener(new OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                if (getCallback() != null) {
-                    getCallback().onVoiceSearchRequested();
-                }
-            }
-        });
+    @OnClick(R.id.voice_search_button) void onVoiceSearchClick() {
+        if (getCallback() != null) {
+            getCallback().onVoiceSearchRequested();
+        }
     }
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/311911
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6f2d97f9155384ccce07ed664dea0c4f15e5796
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Dbrant <dbr...@wikimedia.org>
Gerrit-Reviewer: Mholloway <mhollo...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to