@Test public void whenSetOnTranslateChangeListener_forwardToOrientationStrategy() { SwipeLayout.OnTranslateChangeListener listener = new SwipeLayout.OnTranslateChangeListener() { @Override public void onTranslateChange(float globalPercent, int index, float relativePercent) { } }; swipeLayout.setOnTranslateChangeListener(listener); verify(orientationStrategy).setOnTranslateChangeListener(listener); verifyNoMoreInteractions(orientationStrategy); }
public void setOnTranslateChangeListener(OnTranslateChangeListener listener) { makeSureOrientationStrategy(); orientationStrategy.setOnTranslateChangeListener(listener); }
SwipeLayout extends FrameLayout { public void setOnTranslateChangeListener(OnTranslateChangeListener listener) { makeSureOrientationStrategy(); orientationStrategy.setOnTranslateChangeListener(listener); } }
SwipeLayout extends FrameLayout { public void setOnTranslateChangeListener(OnTranslateChangeListener listener) { makeSureOrientationStrategy(); orientationStrategy.setOnTranslateChangeListener(listener); } SwipeLayout(Context context);  SwipeLayout(Context context, AttributeSet attrs);  SwipeLayout(Context context, AttributeSet attrs, int defStyleAttr); @TargetApi(Build.VERSION_CODES.LOLLIPOP)  SwipeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); }
SwipeLayout extends FrameLayout { public void setOnTranslateChangeListener(OnTranslateChangeListener listener) { makeSureOrientationStrategy(); orientationStrategy.setOnTranslateChangeListener(listener); } SwipeLayout(Context context);  SwipeLayout(Context context, AttributeSet attrs);  SwipeLayout(Context context, AttributeSet attrs, int defStyleAttr); @TargetApi(Build.VERSION_CODES.LOLLIPOP)  SwipeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); void setOrientation(Orientation orientation); void setOrientation(OrientationStrategyFactory factory); void startWith(int position); void anchor(Integer... points); void setOnTranslateChangeListener(OnTranslateChangeListener listener); @Override boolean onInterceptTouchEvent(MotionEvent ev); @Override boolean onTouchEvent(MotionEvent event); void translateTo(int position); }
SwipeLayout extends FrameLayout { public void setOnTranslateChangeListener(OnTranslateChangeListener listener) { makeSureOrientationStrategy(); orientationStrategy.setOnTranslateChangeListener(listener); } SwipeLayout(Context context);  SwipeLayout(Context context, AttributeSet attrs);  SwipeLayout(Context context, AttributeSet attrs, int defStyleAttr); @TargetApi(Build.VERSION_CODES.LOLLIPOP)  SwipeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes); void setOrientation(Orientation orientation); void setOrientation(OrientationStrategyFactory factory); void startWith(int position); void anchor(Integer... points); void setOnTranslateChangeListener(OnTranslateChangeListener listener); @Override boolean onInterceptTouchEvent(MotionEvent ev); @Override boolean onTouchEvent(MotionEvent event); void translateTo(int position);  }