Search in sources :

Example 1 with AsymmetricRecyclerViewAdapter

use of com.felipecsl.asymmetricgridview.AsymmetricRecyclerViewAdapter in project AsymmetricGridView by felipecsl.

the class RecyclerViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recyclerview);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    AsymmetricRecyclerView recyclerView = (AsymmetricRecyclerView) findViewById(R.id.recyclerView);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    actionBar.setHomeAsUpIndicator(R.drawable.ic_menu);
    actionBar.setDisplayHomeAsUpEnabled(true);
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    if (navigationView != null) {
        setupDrawerContent(navigationView);
    }
    RecyclerViewAdapter adapter = new RecyclerViewAdapter(demoUtils.moarItems(50));
    recyclerView.setRequestedColumnCount(3);
    recyclerView.setDebugging(true);
    recyclerView.setRequestedHorizontalSpacing(Utils.dpToPx(this, 3));
    recyclerView.addItemDecoration(new SpacesItemDecoration(getResources().getDimensionPixelSize(R.dimen.recycler_padding)));
    recyclerView.setAdapter(new AsymmetricRecyclerViewAdapter<>(this, recyclerView, adapter));
}
Also used : NavigationView(android.support.design.widget.NavigationView) AGVRecyclerViewAdapter(com.felipecsl.asymmetricgridview.AGVRecyclerViewAdapter) AsymmetricRecyclerViewAdapter(com.felipecsl.asymmetricgridview.AsymmetricRecyclerViewAdapter) AsymmetricRecyclerView(com.felipecsl.asymmetricgridview.AsymmetricRecyclerView) ActionBar(android.support.v7.app.ActionBar) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

NavigationView (android.support.design.widget.NavigationView)1 ActionBar (android.support.v7.app.ActionBar)1 Toolbar (android.support.v7.widget.Toolbar)1 AGVRecyclerViewAdapter (com.felipecsl.asymmetricgridview.AGVRecyclerViewAdapter)1 AsymmetricRecyclerView (com.felipecsl.asymmetricgridview.AsymmetricRecyclerView)1 AsymmetricRecyclerViewAdapter (com.felipecsl.asymmetricgridview.AsymmetricRecyclerViewAdapter)1