package atownsend.swipeopenhelper;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Interface for interacting with a swipe open ViewHolder.
 * ViewHolders that are to be swiped <b>must</b> implement this interface
 */
public interface SwipeOpenViewHolder {

  /**
   * Returns the {@link View} that will be swiped opened and closed.
   * @return a non-null view to swipe
   */
  @NonNull View getSwipeView();

  /**
   * Returns the {@link RecyclerView.ViewHolder} that contains the Swipe View
   * @return the view holder
   */
  @NonNull RecyclerView.ViewHolder getViewHolder();

  /**
   * Size of the hidden view at the END of the SwipeOpenViewHolder.
   * This will be the view at the RIGHT/END of the holder when horizontal swiping is supported,
   * and will be BOTTOM/DOWN when vertical swiping is supported.
   * @return the width (if horizontal swiping) or height (if vertical swiping) of the view to reveal
   */
  float getEndHiddenViewSize();

  /**
   * Size of the hidden view at the START of the SwipeOpenViewHolder.
   * This will be the view at the LEFT/START of the holder when horizontal swiping is supported,
   * and will be TOP/UP when vertical swiping is supported.
   * @return the width (if horizontal swiping) or height (if vertical swiping) of the view to reveal
   */
  float getStartHiddenViewSize();

  /**
   * Notify the SwipeOpenHolder that the START view has become visible from a swipe
   */
  void notifyStartOpen();

  /**
   * Notify the SwipeOpenHolder that the END View has become visible from a swipe
   */
  void notifyEndOpen();

}

@@ -1494,124 +1494,403 @@
 wipe
-%0A   */%0A  void notifyStartOpen();%0A%0A  /**%0A   * Notify the SwipeOpenHolder that the END View has become visible from a 
+.%0A   * Ex: This could be used to set a background color to the underlying view so that it matches your%0A   * hidden view during an over-swipe%0A   */%0A  void notifyStartOpen();%0A%0A  /**%0A   * Notify the SwipeOpenHolder that the END View has become visible from a swipe%0A   * Ex: This could be used to set a background color to the underlying view so that it matches your%0A   * hidden view during an over-
 swip

update comments