Search in sources :

Example 1 with SubheaderView

use of com.simplecity.amp_library.ui.modelviews.SubheaderView in project Shuttle by timusus.

the class BaseDetailFragment method getAlbumViewModels.

@NonNull
@Override
public List<ViewModel> getAlbumViewModels(List<Album> albums) {
    if (albums.isEmpty()) {
        return Collections.emptyList();
    }
    List<ViewModel> items = new ArrayList<>();
    if (setHorizontalItemsDisposable != null) {
        setHorizontalItemsDisposable.dispose();
    }
    setHorizontalItemsDisposable = horizontalRecyclerView.setItems(Stream.of(albums).map(album -> {
        HorizontalAlbumView horizontalAlbumView = new HorizontalAlbumView(album, requestManager);
        horizontalAlbumView.setClickListener(BaseDetailFragment.this);
        horizontalAlbumView.showYear(true);
        return horizontalAlbumView;
    }).collect(Collectors.toList()));
    items.add(new SubheaderView(StringUtils.makeAlbumsLabel(getContext(), albums.size())));
    items.add(horizontalRecyclerView);
    return items;
}
Also used : R(com.simplecity.amp_library.R) CompletionListUpdateCallbackAdapter(com.simplecityapps.recycler_adapter.adapter.CompletionListUpdateCallbackAdapter) Bundle(android.os.Bundle) SongView(com.simplecity.amp_library.ui.modelviews.SongView) PlaylistUtils(com.simplecity.amp_library.utils.PlaylistUtils) ImageView(android.widget.ImageView) ViewModel(com.simplecityapps.recycler_adapter.model.ViewModel) Random(java.util.Random) Drawable(android.graphics.drawable.Drawable) AndroidSchedulers(io.reactivex.android.schedulers.AndroidSchedulers) OnClick(butterknife.OnClick) BindView(butterknife.BindView) ColorStateList(android.content.res.ColorStateList) Song(com.simplecity.amp_library.model.Song) Aesthetic(com.afollestad.aesthetic.Aesthetic) Optional(com.annimon.stream.Optional) Priority(com.bumptech.glide.Priority) RequestManager(com.bumptech.glide.RequestManager) HorizontalAlbumView(com.simplecity.amp_library.ui.modelviews.HorizontalAlbumView) MenuUtils(com.simplecity.amp_library.utils.MenuUtils) View(android.view.View) ResourceUtils(com.simplecity.amp_library.utils.ResourceUtils) Schedulers(io.reactivex.schedulers.Schedulers) ViewCompat(android.support.v4.view.ViewCompat) Transition(android.transition.Transition) Unbinder(butterknife.Unbinder) ActionBarUtils(com.simplecity.amp_library.utils.ActionBarUtils) LogUtils(com.simplecity.amp_library.utils.LogUtils) ContextualToolbarHelper(com.simplecity.amp_library.utils.ContextualToolbarHelper) FloatingActionButton(android.support.design.widget.FloatingActionButton) SortManager(com.simplecity.amp_library.utils.SortManager) ObjectAnimator(android.animation.ObjectAnimator) PopupMenu(android.support.v7.widget.PopupMenu) SubMenu(android.view.SubMenu) ArtworkProvider(com.simplecity.amp_library.model.ArtworkProvider) ViewGroup(android.view.ViewGroup) MusicUtils(com.simplecity.amp_library.utils.MusicUtils) List(java.util.List) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Disposable(io.reactivex.disposables.Disposable) ContextualToolbarHost(com.simplecity.amp_library.ui.views.ContextualToolbarHost) Nullable(android.support.annotation.Nullable) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Album(com.simplecity.amp_library.model.Album) TypefaceManager(com.simplecity.amp_library.utils.TypefaceManager) Stream(com.annimon.stream.Stream) ContextualToolbar(com.simplecity.amp_library.ui.views.ContextualToolbar) RecyclerListener(com.simplecityapps.recycler_adapter.recyclerview.RecyclerListener) ButterKnife(butterknife.ButterKnife) EmptyView(com.simplecity.amp_library.ui.modelviews.EmptyView) DrawerLockManager(com.simplecity.amp_library.ui.drawer.DrawerLockManager) TransitionListenerAdapter(com.simplecity.amp_library.ui.fragments.TransitionListenerAdapter) ViewModelAdapter(com.simplecityapps.recycler_adapter.adapter.ViewModelAdapter) NonNull(android.support.annotation.NonNull) StringUtils(com.simplecity.amp_library.utils.StringUtils) SelectableViewModel(com.simplecity.amp_library.ui.modelviews.SelectableViewModel) Single(io.reactivex.Single) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) AnimationUtils(android.view.animation.AnimationUtils) Toast(android.widget.Toast) DiskCacheStrategy(com.bumptech.glide.load.engine.DiskCacheStrategy) AnimatorSet(android.animation.AnimatorSet) Observable(io.reactivex.Observable) UpgradeDialog(com.simplecity.amp_library.ui.dialog.UpgradeDialog) PlaceholderProvider(com.simplecity.amp_library.utils.PlaceholderProvider) ShuttleUtils(com.simplecity.amp_library.utils.ShuttleUtils) Rx.distinctToMainThread(com.afollestad.aesthetic.Rx.distinctToMainThread) SharedElementCallback(android.support.v4.app.SharedElementCallback) AlwaysCrossFade(com.simplecity.amp_library.glide.utils.AlwaysCrossFade) TaggerDialog(com.simplecity.amp_library.tagger.TaggerDialog) Collectors(com.annimon.stream.Collectors) LayoutInflater(android.view.LayoutInflater) SubheaderView(com.simplecity.amp_library.ui.modelviews.SubheaderView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) AlbumView(com.simplecity.amp_library.ui.modelviews.AlbumView) TimeUnit(java.util.concurrent.TimeUnit) RecyclerView(android.support.v7.widget.RecyclerView) CustomCollapsingToolbarLayout(android.support.design.widget.CustomCollapsingToolbarLayout) Glide(com.bumptech.glide.Glide) HorizontalRecyclerView(com.simplecity.amp_library.ui.modelviews.HorizontalRecyclerView) Toolbar(android.support.v7.widget.Toolbar) Pair(android.support.v4.util.Pair) TransitionInflater(android.transition.TransitionInflater) BaseFragment(com.simplecity.amp_library.ui.fragments.BaseFragment) Operators(com.simplecity.amp_library.utils.Operators) Collections(java.util.Collections) HorizontalAlbumView(com.simplecity.amp_library.ui.modelviews.HorizontalAlbumView) SubheaderView(com.simplecity.amp_library.ui.modelviews.SubheaderView) ArrayList(java.util.ArrayList) ViewModel(com.simplecityapps.recycler_adapter.model.ViewModel) SelectableViewModel(com.simplecity.amp_library.ui.modelviews.SelectableViewModel) NonNull(android.support.annotation.NonNull)

Example 2 with SubheaderView

use of com.simplecity.amp_library.ui.modelviews.SubheaderView in project Shuttle by timusus.

the class BaseDetailFragment method getSongViewModels.

@NonNull
@Override
public List<ViewModel> getSongViewModels(List<Song> songs) {
    List<ViewModel> items = new ArrayList<>();
    items.add(new SubheaderView(StringUtils.makeSongsLabel(getContext(), songs.size())));
    items.addAll(Stream.of(songs).map(song -> {
        SongView songView = new SongView(song, requestManager);
        songView.setClickListener(BaseDetailFragment.this);
        return songView;
    }).toList());
    return items;
}
Also used : SongView(com.simplecity.amp_library.ui.modelviews.SongView) SubheaderView(com.simplecity.amp_library.ui.modelviews.SubheaderView) ArrayList(java.util.ArrayList) ViewModel(com.simplecityapps.recycler_adapter.model.ViewModel) SelectableViewModel(com.simplecity.amp_library.ui.modelviews.SelectableViewModel) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)2 AnimatorSet (android.animation.AnimatorSet)1 ObjectAnimator (android.animation.ObjectAnimator)1 ColorStateList (android.content.res.ColorStateList)1 Drawable (android.graphics.drawable.Drawable)1 Bundle (android.os.Bundle)1 Nullable (android.support.annotation.Nullable)1 CustomCollapsingToolbarLayout (android.support.design.widget.CustomCollapsingToolbarLayout)1 FloatingActionButton (android.support.design.widget.FloatingActionButton)1 SharedElementCallback (android.support.v4.app.SharedElementCallback)1 Pair (android.support.v4.util.Pair)1 ViewCompat (android.support.v4.view.ViewCompat)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 PopupMenu (android.support.v7.widget.PopupMenu)1 RecyclerView (android.support.v7.widget.RecyclerView)1 Toolbar (android.support.v7.widget.Toolbar)1 Transition (android.transition.Transition)1 TransitionInflater (android.transition.TransitionInflater)1 LayoutInflater (android.view.LayoutInflater)1 MenuItem (android.view.MenuItem)1