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));
}
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));
}
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));
}
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;
}
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;
}
Aggregations