Search in sources :

Example 76 with RecyclerView

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

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

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

use of android.support.v7.widget.RecyclerView in project remusic by aa112901.

the class DownMusicFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.down_music_recylerview, container, false);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(layoutManager);
    folderDetailAdapter = new FolderDetailAdapter(null);
    recyclerView.setAdapter(folderDetailAdapter);
    recyclerView.setHasFixedSize(true);
    setItemDecoration();
    reloadAdapter();
    return view;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) TextView(android.widget.TextView) View(android.view.View)

Example 80 with RecyclerView

use of android.support.v7.widget.RecyclerView in project remusic by aa112901.

the class FolderDetailFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_common, container, false);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(layoutManager);
    folderDetailAdapter = new FolderDetailAdapter(null);
    recyclerView.setAdapter(folderDetailAdapter);
    setItemDecoration();
    reloadAdapter();
    recyclerView.setHasFixedSize(true);
    toolbar = (Toolbar) view.findViewById(R.id.toolbar);
    ((AppCompatActivity) mContext).setSupportActionBar(toolbar);
    toolbar.setPadding(0, CommonUtils.getStatusHeight(mContext), 0, 0);
    ab = ((AppCompatActivity) mContext).getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.actionbar_back);
    ab.setDisplayHomeAsUpEnabled(true);
    String folder = folder_path.substring(folder_path.lastIndexOf(File.separator), folder_path.length());
    ab.setTitle(folder.substring(folder.lastIndexOf(File.separator) + 1, folder.length()));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mContext.onBackPressed();
        }
    });
    return view;
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1778 View (android.view.View)1237 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1106 TextView (android.widget.TextView)384 GridLayoutManager (android.support.v7.widget.GridLayoutManager)234 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)225 ImageView (android.widget.ImageView)210 ArrayList (java.util.ArrayList)190 Toolbar (android.support.v7.widget.Toolbar)137 Intent (android.content.Intent)117 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)102 ViewGroup (android.view.ViewGroup)101 Nullable (android.support.annotation.Nullable)99 Context (android.content.Context)96 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)96 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)93 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)93 Bundle (android.os.Bundle)92 Test (org.junit.Test)90 Paint (android.graphics.Paint)80