Search in sources :

Example 56 with LinearLayoutManager

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

the class WidgetsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_demo);
    Samples.initToolbar(this, getString(R.string.widgetsActivity_title));
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    ViewModel[] items = new ViewModel[] { new ViewModel(CheckBoxRadioActivity.class, getString(R.string.checkBoxRadioActivity_title)), new ViewModel(ButtonsActivity.class, getString(R.string.buttonsActivity_title)), new ViewModel(CircularProgressActivity.class, getString(R.string.circularProgressActivity_title)), new ViewModel(ProgressBarsActivity.class, getString(R.string.progressBarsActivity_title)), new ViewModel(SnackbarActivity.class, getString(R.string.snackbarActivity_title)), new ViewModel(SVGActivity.class, getString(R.string.svgActivity_title)), new ViewModel(TextFieldsActivity.class, getString(R.string.textFieldsActivity_title)), new ViewModel(TabsActivity.class, getString(R.string.tabsActivity_title)), new ViewModel(ScrollViewActivity.class, getString(R.string.scrollViewActivity_title)), new ViewModel(RecyclerActivity.class, getString(R.string.recyclerViewActivity_title)), new ViewModel(ExpandableRecyclerActivity.class, getString(R.string.expandableRecyclerActivity_title)), new ViewModel(DropDownActivity.class, getString(R.string.dropDownActivityActivity_title)), new ViewModel(NavigationViewActivity.class, getString(R.string.navigationViewActivity_title)), new ViewModel(SeekBarActivity.class, getString(R.string.seekBarActivity_title)), new ViewModel(ToolbarActivity.class, getString(R.string.toolbarActivity_title)), new ViewModel(FlowLayoutActivity.class, getString(R.string.flowLayoutActivity_title)), new ViewModel(TableLayoutActivity.class, getString(R.string.tableLayoutActivity_title)), new ViewModel(FloatingActionMenuActivity.class, getString(R.string.floatingActionMenuActivity_title)), new ViewModel(BottomBarActivity.class, getString(R.string.bottomBarActivity_title), true), new ViewModel(BottomSheetActivity.class, getString(R.string.bottomSheetActivity_title), true) };
    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 57 with LinearLayoutManager

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

the class DrawerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_drawer);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle(R.string.app_name);
    drawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);
    drawerMenu = (LinearLayout) findViewById(R.id.drawerMenu);
    RecyclerView drawerList = (RecyclerView) findViewById(R.id.drawerList);
    drawerList.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    FruitAdapter adapter = new FruitAdapter(fruits, null);
    drawerList.setAdapter(adapter);
    adapter.setOnItemClickedListener(position -> {
        setTitle(fruits.get(position));
        drawerLayout.closeDrawer(drawerMenu);
    });
}
Also used : RecyclerView(carbon.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 58 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager 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 59 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager 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 60 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager 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)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1976 RecyclerView (android.support.v7.widget.RecyclerView)1085 View (android.view.View)822 TextView (android.widget.TextView)352 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)235 ArrayList (java.util.ArrayList)204 ImageView (android.widget.ImageView)186 Intent (android.content.Intent)150 Toolbar (android.support.v7.widget.Toolbar)134 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)131 GridLayoutManager (android.support.v7.widget.GridLayoutManager)125 BindView (butterknife.BindView)124 Bundle (android.os.Bundle)109 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)105 Nullable (android.support.annotation.Nullable)98 ViewGroup (android.view.ViewGroup)82 Context (android.content.Context)81 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)80 AdapterView (android.widget.AdapterView)70 List (java.util.List)69