use of android.support.v7.widget.DividerItemDecoration in project remusic by aa112901.
the class RadioDetailActivity method setList.
private void setList() {
recyclerView = (ObservableRecyclerView) findViewById(R.id.recyclerview);
recyclerView.setScrollViewCallbacks(RadioDetailActivity.this);
recyclerView.setLayoutManager(new LinearLayoutManager(RadioDetailActivity.this));
recyclerView.setHasFixedSize(false);
mAdapter = new PlaylistDetailAdapter(RadioDetailActivity.this, adapterList);
recyclerView.setAdapter(mAdapter);
recyclerView.addItemDecoration(new DividerItemDecoration(RadioDetailActivity.this, DividerItemDecoration.VERTICAL_LIST));
}
use of android.support.v7.widget.DividerItemDecoration in project remusic by aa112901.
the class SearchMusicFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.recylerview, container, false);
if (getArguments() != null) {
songInfos = getArguments().getParcelableArrayList("searchMusic");
}
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
mAdapter = new MusicAdapter(songInfos);
recyclerView.setAdapter(mAdapter);
recyclerView.setHasFixedSize(true);
recyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST));
return view;
}
use of android.support.v7.widget.DividerItemDecoration in project FlexibleAdapter by davideas.
the class FragmentExpandableSections method initializeRecyclerView.
@SuppressWarnings({ "ConstantConditions", "NullableProblems" })
private void initializeRecyclerView(Bundle savedInstanceState) {
// Initialize Adapter and RecyclerView
// ExampleAdapter makes use of stableIds, I strongly suggest to implement 'item.hashCode()'
mAdapter = new ExampleAdapter(DatabaseService.getInstance().getDatabaseList(), getActivity());
// Experimenting NEW features (v5.0.0)
mAdapter.expandItemsAtStartUp().setAutoCollapseOnExpand(false).setAutoScrollOnExpand(true).setAnimateToLimit(//Size limit = MAX_VALUE will always animate the changes
Integer.MAX_VALUE).setNotifyMoveOfFilteredItems(//When true, filtering on big list is very slow!
false).setNotifyChangeOfUnfilteredItems(//We have highlighted text while filtering, so let's enable this feature to be consistent with the active filter
true).setAnimationOnScrolling(DatabaseConfiguration.animateOnScrolling).setAnimationOnReverseScrolling(true);
mRecyclerView = (RecyclerView) getView().findViewById(R.id.recycler_view);
mRecyclerView.setLayoutManager(createNewLinearLayoutManager());
mRecyclerView.setAdapter(mAdapter);
//Size of RV will not change
mRecyclerView.setHasFixedSize(true);
// NOTE: Use default item animator 'canReuseUpdatedViewHolder()' will return true if
// a Payload is provided. FlexibleAdapter is actually sending Payloads onItemChange.
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
// Custom divider item decorator
mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), R.drawable.divider, //Increase to add gap between sections (Works only with LinearLayout!)
0));
// Add FastScroll to the RecyclerView, after the Adapter has been attached the RecyclerView!!!
mAdapter.setFastScroller((FastScroller) getView().findViewById(R.id.fast_scroller), Utils.getColorAccent(getActivity()), (MainActivity) getActivity());
// Experimenting NEW features (v5.0.0)
//Enable long press to drag items
mAdapter.setLongPressDragEnabled(true).setHandleDragEnabled(//Enable handle drag
true);
//.setDisplayHeadersAtStartUp(true); //Show Headers at startUp: (not necessary if Headers are also Expandable)
SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) getView().findViewById(R.id.swipeRefreshLayout);
swipeRefreshLayout.setEnabled(true);
mListener.onFragmentChange(swipeRefreshLayout, mRecyclerView, SelectableAdapter.MODE_IDLE);
// Add 1 Scrollable Header
mAdapter.showLayoutInfo(savedInstanceState == null);
}
use of android.support.v7.widget.DividerItemDecoration in project Timber by naman14.
the class ArtistMusicFragment method setUpSongs.
private void setUpSongs() {
songsRecyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));
ArrayList<Song> songList;
songList = ArtistSongLoader.getSongsForArtist(getActivity(), artistID);
// adding one dummy song to top of arraylist
//there will be albums header at this position in recyclerview
songList.add(0, new Song(-1, -1, -1, "dummy", "dummy", "dummy", -1, -1));
mSongAdapter = new ArtistSongAdapter(getActivity(), songList, artistID);
songsRecyclerview.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
songsRecyclerview.setAdapter(mSongAdapter);
}
use of android.support.v7.widget.DividerItemDecoration in project Tusky by Vavassor.
the class TimelineFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Bundle arguments = getArguments();
kind = Kind.valueOf(arguments.getString("kind"));
if (kind == Kind.TAG || kind == Kind.USER) {
hashtagOrId = arguments.getString("hashtag_or_id");
}
final View rootView = inflater.inflate(R.layout.fragment_timeline, container, false);
// Setup the SwipeRefreshLayout.
Context context = getContext();
swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_refresh_layout);
swipeRefreshLayout.setOnRefreshListener(this);
// Setup the RecyclerView.
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(context);
recyclerView.setLayoutManager(layoutManager);
DividerItemDecoration divider = new DividerItemDecoration(context, layoutManager.getOrientation());
Drawable drawable = ThemeUtils.getDrawable(context, R.attr.status_divider_drawable, R.drawable.status_divider_dark);
divider.setDrawable(drawable);
recyclerView.addItemDecoration(divider);
adapter = new TimelineAdapter(this);
recyclerView.setAdapter(adapter);
timelineReceiver = new TimelineReceiver(adapter);
LocalBroadcastManager.getInstance(context.getApplicationContext()).registerReceiver(timelineReceiver, TimelineReceiver.getFilter(kind));
return rootView;
}
Aggregations