Search in sources :

Example 1 with DontInterceptTouchListener

use of org.wikipedia.views.DontInterceptTouchListener in project apps-android-wikipedia by wikimedia.

the class HorizontalScrollingListCardView method initRecycler.

@Override
protected void initRecycler(@NonNull RecyclerView recyclerView) {
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
    recyclerView.addItemDecoration(new MarginItemDecoration(getContext(), R.dimen.view_horizontal_scrolling_list_card_item_margin_horizontal, R.dimen.view_horizontal_scrolling_list_card_item_margin_vertical, R.dimen.view_horizontal_scrolling_list_card_item_margin_horizontal, R.dimen.view_horizontal_scrolling_list_card_item_margin_vertical));
    recyclerView.addOnItemTouchListener(new DontInterceptTouchListener());
    recyclerView.setNestedScrollingEnabled(false);
    recyclerView.setClipToPadding(false);
    MarginLayoutParams params = (MarginLayoutParams) recyclerView.getLayoutParams();
    final int height = DimenUtil.roundedDpToPx(228);
    params.height = height;
    final int padding = DimenUtil.roundedDpToPx(12);
    recyclerView.setPadding(padding, 0, padding, 0);
}
Also used : DontInterceptTouchListener(org.wikipedia.views.DontInterceptTouchListener) MarginItemDecoration(org.wikipedia.views.MarginItemDecoration) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 2 with DontInterceptTouchListener

use of org.wikipedia.views.DontInterceptTouchListener in project apps-android-wikipedia by wikimedia.

the class OnThisDayCardView method initRecycler.

private void initRecycler() {
    pagesRecycler.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
    pagesRecycler.addItemDecoration(new MarginItemDecoration(getContext(), R.dimen.view_horizontal_scrolling_list_card_item_margin_horizontal, R.dimen.view_horizontal_scrolling_list_card_item_margin_vertical, R.dimen.view_horizontal_scrolling_list_card_item_margin_horizontal, R.dimen.view_horizontal_scrolling_list_card_item_margin_vertical));
    pagesRecycler.addOnItemTouchListener(new DontInterceptTouchListener());
    pagesRecycler.setNestedScrollingEnabled(false);
}
Also used : DontInterceptTouchListener(org.wikipedia.views.DontInterceptTouchListener) MarginItemDecoration(org.wikipedia.views.MarginItemDecoration) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 3 with DontInterceptTouchListener

use of org.wikipedia.views.DontInterceptTouchListener in project apps-android-wikipedia by wikimedia.

the class OnThisDayFragment method setUpRecycler.

private void setUpRecycler(RecyclerView recycler) {
    recycler.addItemDecoration(new MarginItemDecoration(requireContext(), R.dimen.view_horizontal_scrolling_list_card_item_margin_horizontal, R.dimen.view_horizontal_scrolling_list_card_item_margin_vertical, R.dimen.view_horizontal_scrolling_list_card_item_margin_horizontal, R.dimen.view_horizontal_scrolling_list_card_item_margin_vertical));
    recycler.addOnItemTouchListener(new DontInterceptTouchListener());
    recycler.setNestedScrollingEnabled(true);
    recycler.setClipToPadding(false);
}
Also used : DontInterceptTouchListener(org.wikipedia.views.DontInterceptTouchListener) HeaderMarginItemDecoration(org.wikipedia.views.HeaderMarginItemDecoration) MarginItemDecoration(org.wikipedia.views.MarginItemDecoration)

Aggregations

DontInterceptTouchListener (org.wikipedia.views.DontInterceptTouchListener)3 MarginItemDecoration (org.wikipedia.views.MarginItemDecoration)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 HeaderMarginItemDecoration (org.wikipedia.views.HeaderMarginItemDecoration)1