Search in sources :

Example 6 with DividerItemDecoration

use of io.hefuyi.listener.widget.DividerItemDecoration in project ListenerMusicPlayer by hefuyicoder.

the class SongsFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ATE.apply(this, ATEUtil.getATEKey(getActivity()));
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(mAdapter);
    recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST, true));
    mPresenter.loadSongs(action);
    if (Constants.NAVIGATE_PLAYLIST_FAVOURATE.equals(action)) {
        subscribeFavourateSongEvent();
    } else if (Constants.NAVIGATE_PLAYLIST_RECENTPLAY.equals(action)) {
        subscribeRecentlyPlayEvent();
    } else {
        subscribeMediaUpdateEvent();
    }
    subscribeMetaChangedEvent();
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(io.hefuyi.listener.widget.DividerItemDecoration)

Example 7 with DividerItemDecoration

use of io.hefuyi.listener.widget.DividerItemDecoration in project ListenerMusicPlayer by hefuyicoder.

the class AlbumFragment method setItemDecoration.

private void setItemDecoration() {
    if (isGrid) {
        int spacingInPixels = getActivity().getResources().getDimensionPixelSize(R.dimen.spacing_card_album_grid);
        itemDecoration = new SpacesItemDecoration(spacingInPixels);
    } else {
        itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST, true);
    }
    recyclerView.addItemDecoration(itemDecoration);
}
Also used : DividerItemDecoration(io.hefuyi.listener.widget.DividerItemDecoration)

Example 8 with DividerItemDecoration

use of io.hefuyi.listener.widget.DividerItemDecoration in project ListenerMusicPlayer by hefuyicoder.

the class ArtistFragment method setItemDecoration.

private void setItemDecoration() {
    if (isGrid) {
        int spacingInPixels = getActivity().getResources().getDimensionPixelSize(R.dimen.spacing_card_album_grid);
        itemDecoration = new SpacesItemDecoration(spacingInPixels);
    } else {
        itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST, false);
    }
    recyclerView.addItemDecoration(itemDecoration);
}
Also used : DividerItemDecoration(io.hefuyi.listener.widget.DividerItemDecoration)

Example 9 with DividerItemDecoration

use of io.hefuyi.listener.widget.DividerItemDecoration in project ListenerMusicPlayer by hefuyicoder.

the class AlbumDetailFragment method onViewCreated.

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ButterKnife.bind(this, view);
    ATE.apply(this, ATEUtil.getATEKey(context));
    if (getArguments().getBoolean("transition")) {
        albumArt.setTransitionName(getArguments().getString("transition_name"));
    }
    recyclerView.setAdapter(mAdapter);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST, false));
    setupToolbar();
    mPresenter.subscribe(albumID);
    subscribeMetaChangedEvent();
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(io.hefuyi.listener.widget.DividerItemDecoration) TargetApi(android.annotation.TargetApi)

Example 10 with DividerItemDecoration

use of io.hefuyi.listener.widget.DividerItemDecoration in project ListenerMusicPlayer by hefuyicoder.

the class FolderSongsFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ATE.apply(this, ATEUtil.getATEKey(getActivity()));
    if (Build.VERSION.SDK_INT < 21 && view.findViewById(R.id.status_bar) != null) {
        view.findViewById(R.id.status_bar).setVisibility(View.GONE);
        if (Build.VERSION.SDK_INT >= 19) {
            int statusBarHeight = DensityUtil.getStatusBarHeight(getContext());
            view.findViewById(R.id.toolbar).setPadding(0, statusBarHeight, 0, 0);
        }
    }
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
    final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setTitle(R.string.folders);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(mAdapter);
    recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST, true));
    mPresenter.loadSongs(path);
    subscribeMetaChangedEvent();
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(io.hefuyi.listener.widget.DividerItemDecoration) ActionBar(android.support.v7.app.ActionBar)

Aggregations

DividerItemDecoration (io.hefuyi.listener.widget.DividerItemDecoration)10 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)7 TargetApi (android.annotation.TargetApi)2 ActionBar (android.support.v7.app.ActionBar)2 AppCompatActivity (android.support.v7.app.AppCompatActivity)2 RecyclerView (android.support.v7.widget.RecyclerView)2 PlaylistUpdateEvent (io.hefuyi.listener.event.PlaylistUpdateEvent)1 ArtistSongAdapter (io.hefuyi.listener.ui.adapter.ArtistSongAdapter)1 List (java.util.List)1