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

Change subject: Hygiene: encapsulate CardHeaderView callback
......................................................................


Hygiene: encapsulate CardHeaderView callback

Move CardHeaderView's callback to within the class itself. This makes it
obvious to clients what the true dependencies of the class' callback are
because its precise and gives a clear CardHeaderView.Callback reference.

Change-Id: Ifd20df3f32d46176b7b28987c263708b69b764eb
---
M app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java
M app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
2 files changed, 7 insertions(+), 5 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java 
b/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java
index 40c8a59..9d5b3e2 100644
--- a/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/CardHeaderView.java
@@ -23,11 +23,15 @@
 import butterknife.OnClick;
 
 public class CardHeaderView extends FrameLayout {
+    public interface Callback {
+        boolean onRequestDismissCard(@NonNull Card card);
+    }
+
     @BindView(R.id.view_card_header_image) AppCompatImageView imageView;
     @BindView(R.id.view_card_header_title) TextView titleView;
     @BindView(R.id.view_card_header_subtitle) TextView subtitleView;
     @Nullable private Card card;
-    @Nullable private FeedViewCallback callback;
+    @Nullable private Callback callback;
 
     public CardHeaderView(Context context) {
         super(context);
@@ -40,7 +44,7 @@
         return this;
     }
 
-    @NonNull public CardHeaderView setCallback(@Nullable FeedViewCallback 
callback) {
+    @NonNull public CardHeaderView setCallback(@Nullable Callback callback) {
         this.callback = callback;
         return this;
     }
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
index 29c6fd7..fbb2fdb 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedViewCallback.java
@@ -4,15 +4,13 @@
 
 import org.wikipedia.feed.image.FeaturedImage;
 import org.wikipedia.feed.image.FeaturedImageCard;
-import org.wikipedia.feed.model.Card;
 import org.wikipedia.feed.news.NewsItemCard;
 import org.wikipedia.views.ItemTouchHelperSwipeAdapter;
 
 public interface FeedViewCallback extends ItemTouchHelperSwipeAdapter.Callback,
-        PageTitleListCardItemView.Callback {
+        PageTitleListCardItemView.Callback, CardHeaderView.Callback {
     void onSearchRequested();
     void onVoiceSearchRequested();
-    boolean onRequestDismissCard(@NonNull Card card);
     void onNewsItemSelected(@NonNull NewsItemCard card);
     void onShareImage(@NonNull FeaturedImageCard card);
     void onDownloadImage(@NonNull FeaturedImage image);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd20df3f32d46176b7b28987c263708b69b764eb
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