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

Change subject: Hygiene: move FeedView Adapter config to client
......................................................................


Hygiene: move FeedView Adapter config to client

Focus FeedView on presentation and exposing user interaction callbacks
by moving adapter logic to the client.

Change-Id: I1f03b48cde5ef7c7a694426688a97693f8273231
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
M app/src/main/java/org/wikipedia/feed/view/FeedView.java
2 files changed, 4 insertions(+), 7 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index 058eb55..472e094 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -94,7 +94,8 @@
         View view = inflater.inflate(R.layout.fragment_feed, container, false);
 
         unbinder = ButterKnife.bind(this, view);
-        feedView.set(coordinator, feedCallback);
+        feedView.setAdapter(new FeedAdapter(coordinator, feedCallback));
+        feedView.callback(feedCallback);
         feedView.addOnScrollListener(feedScrollListener);
 
         swipeRefreshLayout.setColorSchemeResources(R.color.foundation_blue);
@@ -133,6 +134,7 @@
         coordinator.setFeedUpdateListener(null);
         swipeRefreshLayout.setOnRefreshListener(null);
         feedView.removeOnScrollListener(feedScrollListener);
+        feedView.callback((FeedViewCallback) null);
         unbinder.unbind();
         unbinder = null;
         super.onDestroyView();
diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedView.java 
b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
index e7f1931..4749803 100644
--- a/app/src/main/java/org/wikipedia/feed/view/FeedView.java
+++ b/app/src/main/java/org/wikipedia/feed/view/FeedView.java
@@ -1,14 +1,12 @@
 package org.wikipedia.feed.view;
 
 import android.content.Context;
-import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.v7.widget.StaggeredGridLayoutManager;
 import android.support.v7.widget.helper.ItemTouchHelper;
 import android.util.AttributeSet;
 
 import org.wikipedia.R;
-import org.wikipedia.feed.FeedCoordinatorBase;
 import org.wikipedia.views.AutoFitRecyclerView;
 import org.wikipedia.views.HeaderMarginItemDecoration;
 import org.wikipedia.views.ItemTouchHelperSwipeAdapter;
@@ -33,10 +31,7 @@
         init();
     }
 
-    public void set(@NonNull FeedCoordinatorBase coordinator, @Nullable 
FeedViewCallback callback) {
-        FeedAdapter adapter = new FeedAdapter(coordinator, callback);
-        setAdapter(adapter);
-
+    public void callback(@Nullable ItemTouchHelperSwipeAdapter.Callback 
callback) {
         if (itemTouchHelper != null) {
             itemTouchHelper.attachToRecyclerView(null);
             itemTouchHelper = null;

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

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