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


Java LinearLayoutManager.setSmoothScrollbarEnabled方法代码示例

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


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

示例1: initDialog

import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initDialog() {

        mBottomSheetDialog = new BottomSheetDialog(BottomSheetActivity.this);
        View view = LayoutInflater.from(this).inflate(R.layout.dialog_bottom_sheet, null, false);
        mBottomSheetDialog.setContentView(view);

        RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
        recyclerView.setHasFixedSize(true);
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            list.add("我是第" + i + "个");
        }
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        linearLayoutManager.setSmoothScrollbarEnabled(true);
        recyclerView.setLayoutManager(linearLayoutManager);
        ListRecyclerAdapter adapter = new ListRecyclerAdapter(list);
        recyclerView.setAdapter(adapter);

        setBehaviorCallback();

    }
 
开发者ID:Pingsh,项目名称:Mix,代码行数:22,代码来源:BottomSheetActivity.java

示例2: initView

import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initView(List<String> list) {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    recyclerView.setHasFixedSize(true);
    linearLayoutManager = new LinearLayoutManager(this);
    linearLayoutManager.setSmoothScrollbarEnabled(true);
    recyclerView.setLayoutManager(linearLayoutManager);
    ListRecyclerAdapter adapter = new ListRecyclerAdapter(list);
    recyclerView.setAdapter(adapter);

    FAB = (FloatingActionButton) findViewById(R.id.fab);
    FAB.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            linearLayoutManager.scrollToPosition(0);
            hideFAB();
        }
    });
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:23,代码来源:BackTopActivity.java

示例3: init

import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
public static <T extends SingleTypeAdapter> void init(Context context, RecyclerView recyclerView, T adapter) {
    LinearLayoutManager layoutManager = new LinearLayoutManager(context);
    layoutManager.setSmoothScrollbarEnabled(true);
    layoutManager.setAutoMeasureEnabled(true);
    recyclerView.setAdapter(adapter);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setHasFixedSize(true);
    recyclerView.setNestedScrollingEnabled(false);
}
 
开发者ID:GcsSloop,项目名称:diycode,代码行数:10,代码来源:RecyclerViewUtil.java

示例4: initView

import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的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

示例5: initView

import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initView() {

    if (incidentDto != null) {

      FormatUtlis.setText(tvItemEvent, incidentDto.getAlarmContent());
      FormatUtlis.setText(tvItemLevel,
          String.format(getString(R.string.item_alarm_level_item), incidentDto.getLevel()));
      FormatUtlis.setText(tvItemCount, incidentDto.getIncidentCount());
      FormatUtlis.setText(tvItemPeople, incidentDto.getHandlingName());
      FormatUtlis.setText(tvItemAlarmTime,
          FormatUtlis.chargeStringFormatTime(incidentDto.getAlarmCreationTime(),
              "yyyy-MM-dd HH:mm:ss", "MM/dd HH:mm"));
      FormatUtlis.setText(tvItemDealTime, FormatUtlis.chargeStringFormatTime(incidentDto.getHandlingStartTime(),
          "yyyy-MM-dd HH:mm:ss", "MM/dd HH:mm"));
      FormatUtlis.setText(tvItemCompleteTime,
          FormatUtlis.chargeStringFormatTime(incidentDto.getHandlingEndTime(),
              "yyyy-MM-dd HH:mm:ss", "MM/dd HH:mm"));
      tvContentTitle.setText(incidentDto.getBusinessName());
      tvContentIP.setText(incidentDto.getEntityIp());
      tvContentServer.setText(incidentDto.getEntityName());

      if (TextUtils.isEmpty(incidentDto.getHandlingEndTime())) {
        tvItemContinue.setVisibility(View.GONE);
      } else {
        FormatUtlis.setText(tvItemContinue, incidentDto.getAlarmDuration());
      }

      if (!TextUtils.isEmpty(incidentDto.getRemark())) {

        String remark = incidentDto.getRemark();
        remark = remark.replace("</br>", "\r\n");
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setSmoothScrollbarEnabled(true);
        layoutManager.setAutoMeasureEnabled(true);

        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setHasFixedSize(true);
        recyclerView.setNestedScrollingEnabled(false);
        List<String> list = new ArrayList<>();
        list.add(remark);
        NoteRecyclerViewAdapter adapter = new NoteRecyclerViewAdapter(list);

        recyclerView.addItemDecoration(
            new DividerItemDecoration(ItemDetailsActivity.this, DividerItemDecoration.VERTICAL));
        recyclerView.setAdapter(adapter);
      }
    }
  }
 
开发者ID:Lingzh0ng,项目名称:ITSM,代码行数:49,代码来源:ItemDetailsActivity.java


注:本文中的android.support.v7.widget.LinearLayoutManager.setSmoothScrollbarEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。