Delete willHandleHorizontalSwipe API from Stream library

The API was added for Android Stream lib to provide clients with the signal that it is handling swipe gesture, hence the client should not consume it. But the direction has changed in a way that the API is not required any more i.e. there is no more situation where the library and a client need to figure out which to consume the gesture. This CL deletes the API.

PiperOrigin-RevId: 266236670
Change-Id: Id3c0c5a51108f900c7c91ef301571cce6bc401ef
diff --git a/src/main/java/com/google/android/libraries/feed/api/client/stream/Stream.java b/src/main/java/com/google/android/libraries/feed/api/client/stream/Stream.java
index 90c46a4..f72d9f1 100644
--- a/src/main/java/com/google/android/libraries/feed/api/client/stream/Stream.java
+++ b/src/main/java/com/google/android/libraries/feed/api/client/stream/Stream.java
@@ -147,14 +147,6 @@
    */
   boolean isChildAtPositionVisible(int position);
 
-  /**
-   * Returns true if Stream will handle horizontal swipe in response to user gesture. This can be
-   * used by host to tell whether or not it can consume user gesture. If this method returns true,
-   * which means the gesture will be consumed by a underlying view using this Stream instance, the
-   * host should not do anything to avoid conflicts.
-   */
-  boolean willHandleHorizontalSwipe();
-
   void addScrollListener(ScrollListener listener);
 
   void removeScrollListener(ScrollListener listener);
diff --git a/src/main/java/com/google/android/libraries/feed/basicstream/BasicStream.java b/src/main/java/com/google/android/libraries/feed/basicstream/BasicStream.java
index 0379362..a791b71 100644
--- a/src/main/java/com/google/android/libraries/feed/basicstream/BasicStream.java
+++ b/src/main/java/com/google/android/libraries/feed/basicstream/BasicStream.java
@@ -134,7 +134,6 @@
   private RecyclerView recyclerView;
   private ContextMenuManager contextMenuManager;
   private List<Header> headers;
-  private StreamItemTouchCallbacks itemTouchCallbacks;
   private StreamRecyclerViewAdapter adapter;
   private ScrollListenerNotifier scrollListenerNotifier;
   private ScrollRestorer scrollRestorer;
@@ -536,8 +535,7 @@
     recyclerView.setId(R.id.feed_stream_recycler_view);
     recyclerView.setLayoutManager(createRecyclerViewLayoutManager(context));
     contextMenuManager = createContextMenuManager(recyclerView, new MenuMeasurer(context));
-    itemTouchCallbacks = new StreamItemTouchCallbacks();
-    new ItemTouchHelper(itemTouchCallbacks).attachToRecyclerView(recyclerView);
+    new ItemTouchHelper(new StreamItemTouchCallbacks()).attachToRecyclerView(recyclerView);
     recyclerView.setAdapter(adapter);
     recyclerView.setClipToPadding(false);
     if (VERSION.SDK_INT > VERSION_CODES.JELLY_BEAN) {
@@ -561,11 +559,6 @@
     recyclerView.addOnLayoutChangeListener(this);
   }
 
-  @Override
-  public boolean willHandleHorizontalSwipe() {
-    return itemTouchCallbacks.isHorizontallySwiped();
-  }
-
   private void updateAdapterAfterSessionStart(ModelProvider modelProvider) {
     StreamDriver newStreamDriver =
         createStreamDriver(
diff --git a/src/main/java/com/google/android/libraries/feed/basicstream/internal/StreamItemTouchCallbacks.java b/src/main/java/com/google/android/libraries/feed/basicstream/internal/StreamItemTouchCallbacks.java
index 051156f..eb1c616 100644
--- a/src/main/java/com/google/android/libraries/feed/basicstream/internal/StreamItemTouchCallbacks.java
+++ b/src/main/java/com/google/android/libraries/feed/basicstream/internal/StreamItemTouchCallbacks.java
@@ -27,8 +27,6 @@
 
   private static final Interpolator DISMISS_INTERPOLATOR = new FastOutLinearInInterpolator();
 
-  private boolean isHorizontallySwiped;
-
   @Override
   public int getMovementFlags(RecyclerView recyclerView, ViewHolder viewHolder) {
     int swipeFlags = 0;
@@ -66,10 +64,5 @@
 
     viewHolder.itemView.setTranslationX(dX);
     viewHolder.itemView.setAlpha(alpha);
-    isHorizontallySwiped = isCurrentlyActive && dX != 0.f;
-  }
-
-  public boolean isHorizontallySwiped() {
-    return isHorizontallySwiped;
   }
 }