Search in sources :

Example 1 with CustomDividerItemDecoration

use of se.zinokader.spotiq.util.view.CustomDividerItemDecoration in project SpotiQ by ZinoKader.

the class PartyMemberFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    binding = DataBindingUtil.inflate(inflater, R.layout.fragment_party_members, container, false);
    partyMemberRecyclerAdapter = new PartyMemberRecyclerAdapter(partyMembers);
    binding.membersRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    binding.membersRecyclerView.addItemDecoration(new CustomDividerItemDecoration(getContext().getDrawable(R.drawable.search_list_divider), false, false));
    AlphaInAnimationAdapter animatedAdapter = new AlphaInAnimationAdapter(partyMemberRecyclerAdapter);
    animatedAdapter.setInterpolator(new AccelerateDecelerateInterpolator());
    animatedAdapter.setHasStableIds(true);
    animatedAdapter.setStartPosition(ApplicationConstants.DEFAULT_LIST_ANIMATION_ITEM_POSITION_START);
    animatedAdapter.setDuration(ApplicationConstants.DEFAULT_LIST_ANIMATION_DURATION_MS);
    binding.membersRecyclerView.setAdapter(animatedAdapter);
    return binding.getRoot();
}
Also used : AlphaInAnimationAdapter(jp.wasabeef.recyclerview.adapters.AlphaInAnimationAdapter) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) CustomDividerItemDecoration(se.zinokader.spotiq.util.view.CustomDividerItemDecoration) Nullable(android.support.annotation.Nullable)

Example 2 with CustomDividerItemDecoration

use of se.zinokader.spotiq.util.view.CustomDividerItemDecoration in project SpotiQ by ZinoKader.

the class TracklistFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parentContainer, Bundle savedInstanceState) {
    binding = DataBindingUtil.inflate(inflater, R.layout.fragment_tracklist, parentContainer, false);
    binding.tracklistRecyclerView.setLayoutManager(new LinearLayoutManager(inflater.getContext()));
    binding.tracklistRecyclerView.setEmptyView(binding.tracklistEmptyView);
    binding.tracklistRecyclerView.setItemAnimator(itemAnimator);
    binding.tracklistRecyclerView.addItemDecoration(new CustomDividerItemDecoration(getResources().getDrawable(R.drawable.track_list_padding_divider), true, true));
    binding.tracklistRecyclerView.setAdapter(new TracklistRecyclerAdapter(songs));
    return binding.getRoot();
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) CustomDividerItemDecoration(se.zinokader.spotiq.util.view.CustomDividerItemDecoration)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 CustomDividerItemDecoration (se.zinokader.spotiq.util.view.CustomDividerItemDecoration)2 Nullable (android.support.annotation.Nullable)1 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)1 AlphaInAnimationAdapter (jp.wasabeef.recyclerview.adapters.AlphaInAnimationAdapter)1