Search in sources :

Example 1 with RecyclerViewAdapter

use of com.sample.andremion.musicplayer.view.RecyclerViewAdapter in project Music-Player by andremion.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.content_list);
    // 
    mCoverView = findViewById(R.id.cover);
    mTitleView = findViewById(R.id.title);
    mTimeView = findViewById(R.id.time);
    mDurationView = findViewById(R.id.duration);
    mProgressView = findViewById(R.id.progress);
    mFabView = findViewById(R.id.fab);
    // Set the recycler adapter
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.tracks);
    assert recyclerView != null;
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(new RecyclerViewAdapter(MusicContent.ITEMS));
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) RecyclerViewAdapter(com.sample.andremion.musicplayer.view.RecyclerViewAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 RecyclerViewAdapter (com.sample.andremion.musicplayer.view.RecyclerViewAdapter)1