|
|
@@ -47,6 +47,16 @@ public class CustomListicleImageView extends ConstraintLayout {
|
|
|
init(context);
|
|
|
}
|
|
|
|
|
|
+ public CustomListicleImageView(Context context, AttributeSet attrs) {
|
|
|
+ super(context, attrs);
|
|
|
+ init(context);
|
|
|
+ }
|
|
|
+
|
|
|
+ public CustomListicleImageView(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
|
+ super(context, attrs, defStyleAttr);
|
|
|
+ init(context);
|
|
|
+ }
|
|
|
+
|
|
|
private void init(Context context) {
|
|
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
inflater.inflate(R.layout.custom_listicle_image_view, this);
|
|
|
@@ -64,16 +74,6 @@ public class CustomListicleImageView extends ConstraintLayout {
|
|
|
snapHelper.attachToRecyclerView(recyclerView);
|
|
|
}
|
|
|
|
|
|
- public CustomListicleImageView(Context context, AttributeSet attrs) {
|
|
|
- super(context, attrs);
|
|
|
- init(context);
|
|
|
- }
|
|
|
-
|
|
|
- public CustomListicleImageView(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
|
- super(context, attrs, defStyleAttr);
|
|
|
- init(context);
|
|
|
- }
|
|
|
-
|
|
|
private RecyclerView.OnItemTouchListener touchEventListener = new RecyclerView.OnItemTouchListener() {
|
|
|
@Override
|
|
|
public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
|
|
|
@@ -127,10 +127,6 @@ public class CustomListicleImageView extends ConstraintLayout {
|
|
|
layoutPager.setVisibility(View.GONE);
|
|
|
}
|
|
|
|
|
|
-// if (recyclerView.getOnFlingListener() == null) {
|
|
|
-// Snapper snapper = new Snapper(recyclerView, 800);
|
|
|
-// snapper.attachToRecyclerView(recyclerView);
|
|
|
-// }
|
|
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
|
|
|
recyclerView.setLayoutManager(linearLayoutManager);
|