|
|
@@ -1,13 +1,16 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.screen.my.bookmark;
|
|
|
|
|
|
import android.graphics.Paint;
|
|
|
+import android.graphics.PointF;
|
|
|
import android.graphics.Rect;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.constraint.ConstraintLayout;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
+import android.support.v7.widget.LinearSmoothScroller;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
+import android.util.DisplayMetrics;
|
|
|
import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
@@ -124,7 +127,27 @@ public class BookMarkListFragment extends FragmentBase<BookMarkListPresenter> im
|
|
|
presenter.onEvent(event);
|
|
|
});
|
|
|
|
|
|
- recyclerViewBookMarkList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
+ recyclerViewBookMarkList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false) {
|
|
|
+ @Override
|
|
|
+ public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) {
|
|
|
+
|
|
|
+ final LinearSmoothScroller linearSmoothScroller = new LinearSmoothScroller(recyclerView.getContext()) {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PointF computeScrollVectorForPosition(int targetPosition) {
|
|
|
+ return super.computeScrollVectorForPosition(targetPosition);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
|
|
|
+ return 50f / displayMetrics.densityDpi;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ linearSmoothScroller.setTargetPosition(position);
|
|
|
+ startSmoothScroll(linearSmoothScroller);
|
|
|
+ }
|
|
|
+ });
|
|
|
recyclerViewBookMarkList.setAdapter(bookMarkListAdapter);
|
|
|
}
|
|
|
|