Java Code Examples for android.support.v7.widget.GridLayoutManager#setSmoothScrollbarEnabled()
The following examples show how to use
android.support.v7.widget.GridLayoutManager#setSmoothScrollbarEnabled() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DappCommpanyDetailsActivity.java From PocketEOS-Android with GNU Lesser General Public License v3.0 | 6 votes |
@Override protected void initViews(Bundle savedInstanceState) { commpany = getIntent().getParcelableExtra("bean"); setCenterTitle(commpany.getEnterpriseName()); MyApplication.getInstance().showImage(commpany.getPublicImage(), mCommpanyImg); mCommpanyDesc.setText(commpany.getSummary()); GridLayoutManager layoutManager1 = new GridLayoutManager(this, 2); layoutManager1.setOrientation(GridLayoutManager.VERTICAL); layoutManager1.setSmoothScrollbarEnabled(true); if (Utils.getSpUtils().getString("loginmode").equals("phone")) { mRecycleBussinessApplication.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.HORIZONTAL, 1, getResources().getColor(R.color.line))); mRecycleBussinessApplication.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.VERTICAL, 1, getResources().getColor(R.color.line))); }else { mRecycleBussinessApplication.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.HORIZONTAL, 1, getResources().getColor(R.color.blackbox_line))); mRecycleBussinessApplication.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.VERTICAL, 1, getResources().getColor(R.color.blackbox_line))); } mRecycleBussinessApplication.setLayoutManager(layoutManager1); mBussinessDappAdapter = new EmptyWrapper(AdapterManger.getDappBussnessAdapter(this, mBussinessDappList)); mBussinessDappAdapter.setEmptyView(R.layout.empty_project); mRecycleBussinessApplication.setAdapter(mBussinessDappAdapter); }
Example 2
Source File: BoxingBottomSheetFragment.java From boxing with Apache License 2.0 | 6 votes |
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mEmptyTxt = (TextView) view.findViewById(R.id.empty_txt); mRecycleView = (RecyclerView) view.findViewById(R.id.media_recycleview); mRecycleView.setHasFixedSize(true); mLoadingView = (ProgressBar) view.findViewById(R.id.loading); GridLayoutManager gridLayoutManager = new HackyGridLayoutManager(getActivity(), GRID_COUNT); gridLayoutManager.setSmoothScrollbarEnabled(true); mRecycleView.setLayoutManager(gridLayoutManager); mRecycleView.addItemDecoration(new SpacesItemDecoration(getResources().getDimensionPixelOffset(R.dimen.boxing_media_margin), GRID_COUNT)); mRecycleView.setAdapter(mMediaAdapter); mRecycleView.addOnScrollListener(new ScrollListener()); mMediaAdapter.setOnMediaClickListener(new OnMediaClickListener()); mMediaAdapter.setOnCameraClickListener(new OnCameraClickListener()); view.findViewById(R.id.finish_txt).setOnClickListener(this); }
Example 3
Source File: PhotoPickerFragment.java From InstagramPhotoPicker with MIT License | 5 votes |
private void initRecyclerView() { GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), GRID_COUNT); gridLayoutManager.setSmoothScrollbarEnabled(true); photoRecyclerView.setLayoutManager(gridLayoutManager); photoRecyclerView.addItemDecoration(new SpacesItemDecoration(getResources().getDimensionPixelOffset(com.bilibili.boxing_impl.R.dimen.media_margin), GRID_COUNT)); mediaAdapter.setOnMediaClickListener(new OnMediaClickListener()); photoRecyclerView.setAdapter(mediaAdapter); }
Example 4
Source File: BoxingViewFragment.java From boxing with Apache License 2.0 | 5 votes |
private void initRecycleView() { GridLayoutManager gridLayoutManager = new HackyGridLayoutManager(getActivity(), GRID_COUNT); gridLayoutManager.setSmoothScrollbarEnabled(true); mRecycleView.setLayoutManager(gridLayoutManager); mRecycleView.addItemDecoration(new SpacesItemDecoration(getResources().getDimensionPixelOffset(R.dimen.boxing_media_margin), GRID_COUNT)); mMediaAdapter.setOnCameraClickListener(new OnCameraClickListener()); mMediaAdapter.setOnCheckedListener(new OnMediaCheckedListener()); mMediaAdapter.setOnMediaClickListener(new OnMediaClickListener()); mRecycleView.setAdapter(mMediaAdapter); mRecycleView.addOnScrollListener(new ScrollListener()); }
Example 5
Source File: DappFragment.java From PocketEOS-Android with GNU Lesser General Public License v3.0 | 4 votes |
@Override protected void initViews(Bundle savedInstanceState) { //系统刷新 mSpring.setHeader(new AppDefeatHeadView(getContext())); mSpring.setGive(SpringView.Give.BOTH); mSpring.setType(SpringView.Type.FOLLOW); mSpring.setListener(new SpringView.OnFreshListener() { @Override public void onRefresh() { mBussinessDappList.clear(); mHeaderList.clear(); ivLsit.clear(); presenter.getData(); // 获取服务器数据 } @Override public void onLoadmore() { mSpring.onFinishFreshAndLoad(); } }); GridLayoutManager layoutManager = new GridLayoutManager(getActivity(), 4); layoutManager.setOrientation(GridLayoutManager.VERTICAL); layoutManager.setSmoothScrollbarEnabled(true); mRecycleApplication.setLayoutManager(layoutManager); mHeaderAdapter = AdapterManger.getDappHeadAdapter(getActivity(), mHeaderList); mRecycleApplication.setAdapter(mHeaderAdapter); GridLayoutManager layoutManager1 = new GridLayoutManager(getActivity(), 2); layoutManager1.setOrientation(GridLayoutManager.VERTICAL); layoutManager1.setSmoothScrollbarEnabled(true); if (Utils.getSpUtils().getString("loginmode").equals("phone")) { mRecycleBussinessApplication.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.HORIZONTAL, 1, getResources().getColor(R.color.line))); mRecycleBussinessApplication.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.VERTICAL, 1, getResources().getColor(R.color.line))); } else { mRecycleBussinessApplication.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.HORIZONTAL, 1, getResources().getColor(R.color.blackbox_line))); mRecycleBussinessApplication.addItemDecoration(new RecycleViewDivider(getContext(), LinearLayoutManager.VERTICAL, 1, getResources().getColor(R.color.blackbox_line))); } mRecycleBussinessApplication.setLayoutManager(layoutManager1); mBussinessDappAdapter = new EmptyWrapper(AdapterManger.getDappBussnessAdapter(getActivity(), mBussinessDappList)); mBussinessDappAdapter.setEmptyView(R.layout.empty_project); mRecycleBussinessApplication.setAdapter(mBussinessDappAdapter); }