use of com.wm.remusic.recent.Song in project remusic by aa112901.
the class RecentActivity method onCreate.
//接受歌曲播放变化和列表变化广播,刷新列表
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_recent);
// initQuickControls();
recentStore = RecentStore.getInstance(this);
TopTracksLoader recentloader = new TopTracksLoader(this, TopTracksLoader.QueryType.RecentSongs);
List<Song> recentsongs = SongLoader.getSongsForCursor(TopTracksLoader.getCursor());
int songCountInt = recentsongs.size();
mList = recentsongs;
recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setPadding(0, CommonUtils.getStatusHeight(RecentActivity.this), 0, 0);
setSupportActionBar(toolbar);
final ActionBar ab = getSupportActionBar();
ab.setHomeAsUpIndicator(R.drawable.actionbar_back);
ab.setDisplayHomeAsUpEnabled(true);
ab.setTitle("最近播放");
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
new loadSongs().execute("");
}
use of com.wm.remusic.recent.Song in project remusic by aa112901.
the class RecentFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_recent, container, false);
TopTracksLoader recentloader = new TopTracksLoader(getActivity(), TopTracksLoader.QueryType.RecentSongs);
List<Song> recentsongs = SongLoader.getSongsForCursor(TopTracksLoader.getCursor());
int songCountInt = recentsongs.size();
mList = recentsongs;
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setPadding(0, CommonUtils.getStatusHeight(getActivity()), 0, 0);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
ab.setHomeAsUpIndicator(R.drawable.actionbar_back);
ab.setDisplayHomeAsUpEnabled(true);
ab.setTitle("最近播放");
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getActivity().onBackPressed();
}
});
new loadSongs().execute("");
return view;
}
Aggregations