Search in sources :

Example 6 with MarginItemDecoration

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

the class FeedView method init.

private void init() {
    setVerticalScrollBarEnabled(true);
    recyclerLayoutManager = new StaggeredGridLayoutManager(getColumns(), StaggeredGridLayoutManager.VERTICAL);
    setItemAnimator(new FeedItemAnimator());
    setLayoutManager(recyclerLayoutManager);
    addItemDecoration(new MarginItemDecoration(getContext(), R.dimen.view_list_card_margin_horizontal, R.dimen.view_list_card_margin_vertical, R.dimen.view_list_card_margin_horizontal, R.dimen.view_list_card_margin_vertical));
    addItemDecoration(new HeaderMarginItemDecoration(getContext(), R.dimen.view_feed_padding_top, R.dimen.view_feed_search_padding_bottom));
    setCallback(new RecyclerViewColumnCallback());
    setClipChildren(false);
}
Also used : HeaderMarginItemDecoration(org.wikipedia.views.HeaderMarginItemDecoration) StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager) MarginItemDecoration(org.wikipedia.views.MarginItemDecoration) HeaderMarginItemDecoration(org.wikipedia.views.HeaderMarginItemDecoration)

Example 7 with MarginItemDecoration

use of org.wikipedia.views.MarginItemDecoration 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

MarginItemDecoration (org.wikipedia.views.MarginItemDecoration)7 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)5 Rect (android.graphics.Rect)3 RecyclerView (android.support.v7.widget.RecyclerView)3 View (android.view.View)3 BindView (butterknife.BindView)3 DontInterceptTouchListener (org.wikipedia.views.DontInterceptTouchListener)3 SearchEmptyView (org.wikipedia.views.SearchEmptyView)3 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)2 TextView (android.widget.TextView)2 DrawableItemDecoration (org.wikipedia.views.DrawableItemDecoration)2 HeaderMarginItemDecoration (org.wikipedia.views.HeaderMarginItemDecoration)2 PageItemView (org.wikipedia.views.PageItemView)2 SwipeableItemTouchHelperCallback (org.wikipedia.views.SwipeableItemTouchHelperCallback)2 Nullable (android.support.annotation.Nullable)1 SimpleItemAnimator (android.support.v7.widget.SimpleItemAnimator)1 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 MainActivity (org.wikipedia.main.MainActivity)1 FloatingQueueView (org.wikipedia.main.floatingqueue.FloatingQueueView)1 OnboardingView (org.wikipedia.onboarding.OnboardingView)1