Search in sources :

Example 1 with FollowAdapter

use of com.keylesspalace.tusky.adapter.FollowAdapter in project Tusky by tuskyapp.

the class AccountListFragment method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_account_list, container, false);
    Context context = getContext();
    recyclerView = rootView.findViewById(R.id.recycler_view);
    recyclerView.setHasFixedSize(true);
    layoutManager = new LinearLayoutManager(context);
    recyclerView.setLayoutManager(layoutManager);
    DividerItemDecoration divider = new DividerItemDecoration(context, layoutManager.getOrientation());
    Drawable drawable = ThemeUtils.getDrawable(context, R.attr.status_divider_drawable, R.drawable.status_divider_dark);
    divider.setDrawable(drawable);
    recyclerView.addItemDecoration(divider);
    scrollListener = null;
    if (type == Type.BLOCKS) {
        adapter = new BlocksAdapter(this);
    } else if (type == Type.MUTES) {
        adapter = new MutesAdapter(this);
    } else if (type == Type.FOLLOW_REQUESTS) {
        adapter = new FollowRequestsAdapter(this);
    } else {
        adapter = new FollowAdapter(this);
    }
    recyclerView.setAdapter(adapter);
    bottomLoading = false;
    bottomFetches = 0;
    topLoading = false;
    topFetches = 0;
    return rootView;
}
Also used : Context(android.content.Context) FollowAdapter(com.keylesspalace.tusky.adapter.FollowAdapter) MutesAdapter(com.keylesspalace.tusky.adapter.MutesAdapter) Drawable(android.graphics.drawable.Drawable) BlocksAdapter(com.keylesspalace.tusky.adapter.BlocksAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) FollowRequestsAdapter(com.keylesspalace.tusky.adapter.FollowRequestsAdapter) Nullable(android.support.annotation.Nullable)

Example 2 with FollowAdapter

use of com.keylesspalace.tusky.adapter.FollowAdapter in project Tusky by Vavassor.

the class AccountListFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_account_list, container, false);
    Context context = getContext();
    recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
    recyclerView.setHasFixedSize(true);
    layoutManager = new LinearLayoutManager(context);
    recyclerView.setLayoutManager(layoutManager);
    DividerItemDecoration divider = new DividerItemDecoration(context, layoutManager.getOrientation());
    Drawable drawable = ThemeUtils.getDrawable(context, R.attr.status_divider_drawable, R.drawable.status_divider_dark);
    divider.setDrawable(drawable);
    recyclerView.addItemDecoration(divider);
    scrollListener = null;
    if (type == Type.BLOCKS) {
        adapter = new BlocksAdapter(this);
    } else if (type == Type.MUTES) {
        adapter = new MutesAdapter(this);
    } else if (type == Type.FOLLOW_REQUESTS) {
        adapter = new FollowRequestsAdapter(this);
    } else {
        adapter = new FollowAdapter(this);
    }
    recyclerView.setAdapter(adapter);
    return rootView;
}
Also used : Context(android.content.Context) FollowAdapter(com.keylesspalace.tusky.adapter.FollowAdapter) MutesAdapter(com.keylesspalace.tusky.adapter.MutesAdapter) Drawable(android.graphics.drawable.Drawable) BlocksAdapter(com.keylesspalace.tusky.adapter.BlocksAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) FollowRequestsAdapter(com.keylesspalace.tusky.adapter.FollowRequestsAdapter) Nullable(android.support.annotation.Nullable)

Aggregations

Context (android.content.Context)2 Drawable (android.graphics.drawable.Drawable)2 Nullable (android.support.annotation.Nullable)2 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 RecyclerView (android.support.v7.widget.RecyclerView)2 View (android.view.View)2 BlocksAdapter (com.keylesspalace.tusky.adapter.BlocksAdapter)2 FollowAdapter (com.keylesspalace.tusky.adapter.FollowAdapter)2 FollowRequestsAdapter (com.keylesspalace.tusky.adapter.FollowRequestsAdapter)2 MutesAdapter (com.keylesspalace.tusky.adapter.MutesAdapter)2