Search in sources :

Example 1 with RecyclerView

use of android.support.v7.widget.RecyclerView in project MultiType by drakeet.

the class MultiSelectActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_multi_select);
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    final GridLayoutManager layoutManager = new GridLayoutManager(this, SPAN_COUNT);
    layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {

        @Override
        public int getSpanSize(int position) {
            return (items.get(position) instanceof Category) ? SPAN_COUNT : 1;
        }
    });
    selectedSet = new TreeSet<>();
    recyclerView.setLayoutManager(layoutManager);
    adapter = new MultiTypeAdapter();
    adapter.applyGlobalMultiTypePool();
    adapter.register(Square.class, new SquareViewBinder(selectedSet));
    loadData();
    assertAllRegistered(adapter, items);
    recyclerView.setAdapter(adapter);
    setupFAB();
}
Also used : Category(me.drakeet.multitype.sample.common.Category) GridLayoutManager(android.support.v7.widget.GridLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) MultiTypeAdapter(me.drakeet.multitype.MultiTypeAdapter)

Example 2 with RecyclerView

use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    pager = (RecyclerView) findViewById(R.id.pager);
    pager.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
    snapperCarr.attachToRecyclerView(pager);
    if (savedInstanceState != null) {
        pickedDocument = savedInstanceState.getParcelable(STATE_PICKED);
        if (pickedDocument != null) {
            show(pickedDocument);
        }
    }
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 3 with RecyclerView

use of android.support.v7.widget.RecyclerView in project photo-picker-plus-android by chute.

the class FragmentRoot method initView.

private void initView(View view) {
    recyclerView = (RecyclerView) view.findViewById(R.id.gcRecyclerViewAssets);
    recyclerView.setHasFixedSize(true);
    if (displayType == DisplayType.LIST && filterType == PhotoFilterType.SOCIAL_MEDIA) {
        final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
        recyclerView.setLayoutManager(linearLayoutManager);
    } else {
        final GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), getResources().getInteger(R.integer.grid_columns_assets));
        recyclerView.setLayoutManager(gridLayoutManager);
    }
    progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 4 with RecyclerView

use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.

the class RecyclerViewActivity method getRecyclerView.

public RecyclerView getRecyclerView() {
    if (rv == null) {
        rv = new RecyclerView(this);
        rv.setHasFixedSize(true);
        setContentView(rv);
    }
    return (rv);
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView)

Example 5 with RecyclerView

use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.

the class RecyclerViewActivity method getRecyclerView.

public RecyclerView getRecyclerView() {
    if (rv == null) {
        rv = new RecyclerView(this);
        setContentView(rv);
    }
    return (rv);
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1794 View (android.view.View)1243 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1103 TextView (android.widget.TextView)383 GridLayoutManager (android.support.v7.widget.GridLayoutManager)233 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)223 ImageView (android.widget.ImageView)210 ArrayList (java.util.ArrayList)190 Toolbar (android.support.v7.widget.Toolbar)132 Intent (android.content.Intent)115 ViewGroup (android.view.ViewGroup)104 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)102 Nullable (android.support.annotation.Nullable)99 Context (android.content.Context)97 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)96 Bundle (android.os.Bundle)93 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)91 Test (org.junit.Test)90 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)88 Paint (android.graphics.Paint)87