Search in sources :

Example 16 with GridLayoutManager

use of android.support.v7.widget.GridLayoutManager in project Carbon by ZieIony.

the class AnimationsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_demo);
    Samples.initToolbar(this, getString(R.string.animationsActivity_title));
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    ViewModel[] items = new ViewModel[] { new ViewModel(WidgetAnimationsActivity.class, getString(R.string.widgetAnimationsActivity_title)), new ViewModel(ImageFadeActivity.class, getString(R.string.imageFadeActivity_title)), new ViewModel(ListRippleActivity.class, getString(R.string.listRippleActivity_title)), new ViewModel(RippleComparisonActivity.class, getString(R.string.rippleComparisonActivity_title), false, true), new ViewModel(RippleActivity.class, getString(R.string.rippleActivity_title)) };
    recyclerView.setLayoutManager(getResources().getBoolean(R.bool.tablet) ? new GridLayoutManager(this, 2, LinearLayoutManager.VERTICAL, false) : new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.setAdapter(new MainListAdapter(items));
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 17 with GridLayoutManager

use of android.support.v7.widget.GridLayoutManager in project Carbon by ZieIony.

the class AppsLibrariesActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_demo);
    Samples.initToolbar(this, getString(R.string.appsLibrariesActivity_title));
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    ViewModel[] items = new ViewModel[] { new ViewModel(CalculatorActivity.class, getString(R.string.calculatorActivity_title), true), new ViewModel(PicassoActivity.class, getString(R.string.picassoActivity_title)), new ViewModel(RecyclerCardsActivity.class, getString(R.string.recyclerCardsActivity_title)), new ViewModel(DrawerActivity.class, getString(R.string.drawerActivity_title)), new ViewModel(DesignActivity.class, getString(R.string.designActivity_title)), new ViewModel(ConstraintLayoutActivity.class, getString(R.string.constraintLayoutActivity_title)) };
    recyclerView.setLayoutManager(getResources().getBoolean(R.bool.tablet) ? new GridLayoutManager(this, 2, LinearLayoutManager.VERTICAL, false) : new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.setAdapter(new MainListAdapter(items));
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 18 with GridLayoutManager

use of android.support.v7.widget.GridLayoutManager in project Carbon by ZieIony.

the class GuidelinesActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_demo);
    Samples.initToolbar(this, getString(R.string.guidelinesActivity_title));
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    ViewModel[] items = new ViewModel[] { new ViewModel(ButtonsUsageActivity.class, getString(R.string.buttonsUsageActivity_title)), new ViewModel(ToolbarsUsageActivity.class, getString(R.string.toolbarsUsageActivity_title)) };
    recyclerView.setLayoutManager(getResources().getBoolean(R.bool.tablet) ? new GridLayoutManager(this, 2, LinearLayoutManager.VERTICAL, false) : new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.setAdapter(new MainListAdapter(items));
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) RecyclerView(carbon.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 19 with GridLayoutManager

use of android.support.v7.widget.GridLayoutManager in project Carbon by ZieIony.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Samples.initToolbar(this, getString(R.string.app_name));
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    ViewModel[] items = new ViewModel[] { new ViewModel(AnimationsActivity.class, getString(R.string.animationsActivity_title)), new ViewModel(AppsLibrariesActivity.class, getString(R.string.appsLibrariesActivity_title)), new ViewModel(ColorsActivity.class, getString(R.string.colorsActivity_title)), new ViewModel(ComponentsActivity.class, getString(R.string.componentsActivity_title)), new ViewModel(DemosActivity.class, getString(R.string.demosActivity_title)), new ViewModel(FeaturesActivity.class, getString(R.string.featuresActivity_title)), new ViewModel(GuidelinesActivity.class, getString(R.string.guidelinesActivity_title)), new ViewModel(WidgetsActivity.class, getString(R.string.widgetsActivity_title)) };
    recyclerView.setLayoutManager(getResources().getBoolean(R.bool.tablet) ? new GridLayoutManager(this, 2, LinearLayoutManager.VERTICAL, false) : new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.setAdapter(new MainListAdapter(items));
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) RecyclerView(carbon.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 20 with GridLayoutManager

use of android.support.v7.widget.GridLayoutManager in project actor-platform by actorapp.

the class StickersAdapter method scrollToSticker.

public void scrollToSticker(Sticker s) {
    updatePackSelector = false;
    int position = 0;
    for (Sticker st : stickers) {
        if (st.getId() == s.getId()) {
            break;
        }
        position++;
    }
    ((GridLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(position, 0);
}
Also used : Sticker(im.actor.core.entity.Sticker) GridLayoutManager(android.support.v7.widget.GridLayoutManager)

Aggregations

GridLayoutManager (android.support.v7.widget.GridLayoutManager)264 RecyclerView (android.support.v7.widget.RecyclerView)118 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)68 View (android.view.View)60 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)38 TextView (android.widget.TextView)32 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)15 MaterialViewPagerHeaderDecorator (com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator)14 BindView (butterknife.BindView)13 ArrayList (java.util.ArrayList)13 Handler (android.os.Handler)12 Toolbar (android.support.v7.widget.Toolbar)12 ImageView (android.widget.ImageView)12 Context (android.content.Context)11 Intent (android.content.Intent)11 Point (android.graphics.Point)9 Nullable (android.support.annotation.Nullable)9 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)9 SuppressLint (android.annotation.SuppressLint)8 AdapterView (android.widget.AdapterView)8