當前位置: 首頁>>代碼示例>>Java>>正文


Java GridLayoutManager.setSmoothScrollbarEnabled方法代碼示例

本文整理匯總了Java中android.support.v7.widget.GridLayoutManager.setSmoothScrollbarEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java GridLayoutManager.setSmoothScrollbarEnabled方法的具體用法?Java GridLayoutManager.setSmoothScrollbarEnabled怎麽用?Java GridLayoutManager.setSmoothScrollbarEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v7.widget.GridLayoutManager的用法示例。


在下文中一共展示了GridLayoutManager.setSmoothScrollbarEnabled方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onViewCreated

import android.support.v7.widget.GridLayoutManager; //導入方法依賴的package包/類
@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);
    mLoadingView = (ProgressBar) view.findViewById(R.id.loading);
    GridLayoutManager gridLayoutManager = new GridLayoutManager(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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:BoxingBottomSheetFragment.java

示例2: initRecycleView

import android.support.v7.widget.GridLayoutManager; //導入方法依賴的package包/類
private void initRecycleView() {
    GridLayoutManager gridLayoutManager = new GridLayoutManager(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());
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:12,代碼來源:BoxingViewFragment.java

示例3: initRecyclerView

import android.support.v7.widget.GridLayoutManager; //導入方法依賴的package包/類
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);
}
 
開發者ID:Skykai521,項目名稱:InstagramPhotoPicker,代碼行數:9,代碼來源:PhotoPickerFragment.java

示例4: initView

import android.support.v7.widget.GridLayoutManager; //導入方法依賴的package包/類
private void initView() {
  tvItemPurpose.setText(appAutoDeploy.getPurpose());
  tvItemNumber.setText(appAutoDeploy.getChangeNo());
  tvItemPeople.setText(appAutoDeploy.getProposer());
  tvItemStartTime.setText(
      FormatUtlis.getStringFormatTime(appAutoDeploy.getStartTime(), "MM/dd HH:mm"));
  tvItemEndTime.setText(
      FormatUtlis.getStringFormatTime(appAutoDeploy.getEndTime(), "MM/dd HH:mm"));
  tvItemName.setText(appAutoDeploy.getBusinessName());
  List<BAutoDeployInfo> displayInfo = appAutoDeploy.getDisplayInfo();
  for (int i = 0; i < displayInfo.size(); i++) {
    ip += displayInfo.get(i).getIp();
    if (i == displayInfo.size() - 1) {
    } else {
      ip += displayInfo.get(i).getIp() + ";";
    }

    name += displayInfo.get(i).getScriptName();
    if (i == displayInfo.size() - 1) {
    } else {
      name += displayInfo.get(i).getScriptName() + ";";
    }
  }
  tvItemIp.setText(ip);

  ReleaseAppItem2RecyclerViewAdapter releaseAppItemRecyclerViewAdapter =
      new ReleaseAppItem2RecyclerViewAdapter(getActivity(), displayInfo);
  GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2);
  gridLayoutManager.setSmoothScrollbarEnabled(true);
  gridLayoutManager.setAutoMeasureEnabled(true);
  rvApp.setLayoutManager(gridLayoutManager);
  rvApp.setHasFixedSize(true);
  rvApp.setNestedScrollingEnabled(false);
  rvApp.setAdapter(releaseAppItemRecyclerViewAdapter);
  rvApp.setFocusable(false);

  refreshLayout.setEnableLoadmore(false);
  refreshLayout.setEnableRefresh(false);

  //List<String> stringList = new ArrayList<>();
  //for (int i = 0; i < 15; i++) {
  //  stringList.add("測試數據" + i);
  //}

  detaillog = appAutoDeploy.getDetaillog();

  releaseStatusRecyclerViewAdapter =
      new ReleaseStatusRecyclerViewAdapter(getActivity(), detaillog);
  LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
  linearLayoutManager.setSmoothScrollbarEnabled(true);
  linearLayoutManager.setAutoMeasureEnabled(true);
  recyclerView.setBackgroundColor(getResources().getColor(R.color.black));
  recyclerView.setLayoutManager(linearLayoutManager);
  recyclerView.setHasFixedSize(true);
  recyclerView.setNestedScrollingEnabled(false);
  recyclerView.setAdapter(releaseStatusRecyclerViewAdapter);

  recyclerView.setFocusable(false);
}
 
開發者ID:Lingzh0ng,項目名稱:ITSM,代碼行數:60,代碼來源:ReleaseDetailsFragment.java


注:本文中的android.support.v7.widget.GridLayoutManager.setSmoothScrollbarEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。