use of android.support.v7.widget.LinearLayoutManager in project remusic by aa112901.
the class AlbumDetailFragment method onCreateView.
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_common, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
mAdapter = new AlbumDetailAdapter(null);
recyclerView.setAdapter(mAdapter);
itemDecoration = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST);
recyclerView.addItemDecoration(itemDecoration);
recyclerView.setHasFixedSize(true);
reloadAdapter();
AlbumInfo albumInfo = MusicUtils.getAlbumInfo(mContext, albumID);
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setPadding(0, CommonUtils.getStatusHeight(mContext), 0, 0);
((AppCompatActivity) mContext).setSupportActionBar(toolbar);
ab = ((AppCompatActivity) mContext).getSupportActionBar();
ab.setHomeAsUpIndicator(R.drawable.actionbar_back);
ab.setDisplayHomeAsUpEnabled(true);
ab.setTitle(albumInfo.album_name);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (getActivity() != null)
getActivity().onBackPressed();
}
});
return view;
}
use of android.support.v7.widget.LinearLayoutManager 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.LinearLayoutManager in project remusic by aa112901.
the class RankingFragment method setUserVisibleHint.
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser) {
if (view == null) {
view = LayoutInflater.from(mContext).inflate(R.layout.ranking, null, false);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
linearLayoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(linearLayoutManager);
rankingAdapter = new RankingAdapter();
recyclerView.setAdapter(rankingAdapter);
recyclerView.setHasFixedSize(true);
loadData();
}
}
}
use of android.support.v7.widget.LinearLayoutManager in project remusic by aa112901.
the class SearchAlbumFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.recylerview, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
mAdapter = new AlbumAdapter(null);
recyclerView.setAdapter(mAdapter);
recyclerView.setHasFixedSize(true);
setItemDecoration();
loadAlbums();
return view;
}
use of android.support.v7.widget.LinearLayoutManager in project remusic by aa112901.
the class SearchArtistFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.recylerview, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
mAdapter = new ArtistAdapter(null);
recyclerView.setAdapter(mAdapter);
recyclerView.setHasFixedSize(true);
setItemDecoration();
loadArtists();
return view;
}
Aggregations