当前位置: 首页>>代码示例>>Java>>正文


Java GridLayoutManager.setAutoMeasureEnabled方法代码示例

本文整理汇总了Java中android.support.v7.widget.GridLayoutManager.setAutoMeasureEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java GridLayoutManager.setAutoMeasureEnabled方法的具体用法?Java GridLayoutManager.setAutoMeasureEnabled怎么用?Java GridLayoutManager.setAutoMeasureEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.widget.GridLayoutManager的用法示例。


在下文中一共展示了GridLayoutManager.setAutoMeasureEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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.setAutoMeasureEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。