|
|
@@ -51,6 +51,8 @@ public class ContentsFragment extends FragmentBase<ContentsPresenter> implements
|
|
|
private View dim;
|
|
|
private TextView textViewPageNumber;
|
|
|
private String direction = null;
|
|
|
+ private SnapHelper snapHelper;
|
|
|
+ private boolean isClicked = false;
|
|
|
|
|
|
private RecyclerView.OnScrollListener scrollEventListener;
|
|
|
|
|
|
@@ -65,7 +67,7 @@ public class ContentsFragment extends FragmentBase<ContentsPresenter> implements
|
|
|
dim = findViewById(R.id.view_dim_2);
|
|
|
textViewPageNumber = findViewById(R.id.text_view_page_number);
|
|
|
|
|
|
- SnapHelper snapHelper = new PagerSnapHelper();
|
|
|
+ snapHelper = new PagerSnapHelper();
|
|
|
snapHelper.attachToRecyclerView(recyclerViewContentsDetail);
|
|
|
|
|
|
TouchEventWithDirection touchEventWithDirection = new TouchEventWithDirection(100);
|
|
|
@@ -86,7 +88,6 @@ public class ContentsFragment extends FragmentBase<ContentsPresenter> implements
|
|
|
|
|
|
@Override
|
|
|
public void onTouchEvent(RecyclerView rv, MotionEvent motionEvent) {
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -198,7 +199,6 @@ public class ContentsFragment extends FragmentBase<ContentsPresenter> implements
|
|
|
|
|
|
@Override
|
|
|
public void setSmoothScrollToPosition(int i) {
|
|
|
-
|
|
|
recyclerViewContentsDetail.smoothScrollToPosition(i);
|
|
|
}
|
|
|
|
|
|
@@ -234,6 +234,18 @@ public class ContentsFragment extends FragmentBase<ContentsPresenter> implements
|
|
|
linearSmoothScroller.setTargetPosition(position);
|
|
|
startSmoothScroll(linearSmoothScroller);
|
|
|
}
|
|
|
+
|
|
|
+// @Override
|
|
|
+// public void startSmoothScroll(RecyclerView.SmoothScroller smoothScroller) {
|
|
|
+// int[] out = snapHelper.calculateDistanceToFinalSnap(layoutManager, snapHelper.findSnapView(layoutManager));
|
|
|
+// if (out[0] == 0 && out[1] == 0) {
|
|
|
+// Log.e("APP# ContentsFragment | startSmoothScroll", "|" + " 들어옴 stopscroll");
|
|
|
+// recyclerViewContentsDetail.stopScroll();
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// super.startSmoothScroll(smoothScroller);
|
|
|
+//
|
|
|
+// }
|
|
|
};
|
|
|
scrollEventListener = new IndexScrollListener(layoutManager, index -> {
|
|
|
presenter.onChangedPageIndex(index);
|