use of android.support.v7.widget.LinearLayoutManager 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.LinearLayoutManager in project AndroidPhotoFilters by Zomato.
the class MainActivity method initHorizontalList.
private void initHorizontalList() {
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
layoutManager.scrollToPosition(0);
thumbListView.setLayoutManager(layoutManager);
thumbListView.setHasFixedSize(true);
bindDataToAdapter();
}
use of android.support.v7.widget.LinearLayoutManager 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.LinearLayoutManager 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;
}
use of android.support.v7.widget.LinearLayoutManager in project remusic by aa112901.
the class FolderFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.recylerview, container, false);
// folderInfos = MusicUtils.queryFolder(mContext);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
mAdapter = new Adapter(null);
recyclerView.setAdapter(mAdapter);
recyclerView.setHasFixedSize(true);
setItemDecoration();
isAZSort = mPreferences.getFoloerSortOrder().equals(SortOrder.FolderSortOrder.FOLDER_A_Z);
dialogText = (TextView) view.findViewById(R.id.dialog_text);
sideBar = (SideBar) view.findViewById(R.id.sidebar);
sideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() {
@Override
public void onTouchingLetterChanged(String s) {
dialogText.setText(s);
sideBar.setView(dialogText);
Log.e("scrol", " " + s);
if (positionMap.get(s) != null) {
int i = positionMap.get(s);
Log.e("scrolget", " " + i);
((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(i, 0);
}
}
});
reloadAdapter();
return view;
}
Aggregations