本文整理汇总了Java中android.support.v7.widget.LinearLayoutManager.setAutoMeasureEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java LinearLayoutManager.setAutoMeasureEnabled方法的具体用法?Java LinearLayoutManager.setAutoMeasureEnabled怎么用?Java LinearLayoutManager.setAutoMeasureEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.LinearLayoutManager
的用法示例。
在下文中一共展示了LinearLayoutManager.setAutoMeasureEnabled方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initRecyclerView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initRecyclerView() {
mIconListRvAdapter = new SelectIconRvAdapter();
mLinearLayoutManager = new LinearLayoutManager(activity);
mLinearLayoutManager.setAutoMeasureEnabled(true);
mLinearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
mIconRecyclerView.setLayoutManager(mLinearLayoutManager);
mIconRecyclerView.setAdapter(mIconListRvAdapter);
mSelectList = mIconListRvAdapter.getList();
mAdapter.setTypePool(mTypePool);
mSmartRecycleView.setFirstPage(1)
.setAutoRefresh(false)
.setPageSize(20)
.setAdapter(mAdapter)
.loadMoreEnable(false)
.refreshEnable(false)
.setLayoutManger(SmartRecycleView.LayoutManagerType.LINEAR_LAYOUT);
mSmartRecycleView.handleData(mData);
}
示例2: initRecyclerView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initRecyclerView() {
mIconListRvAdapter = new SelectIconRvAdapter();
mLinearLayoutManager = new LinearLayoutManager(mContext);
mLinearLayoutManager.setAutoMeasureEnabled(true);
mLinearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
mIconRecyclerView.setLayoutManager(mLinearLayoutManager);
mIconRecyclerView.setAdapter(mIconListRvAdapter);
mSelectList = mIconListRvAdapter.getList();
mAdapter.setTypePool(mTypePool);
mSmartRecycleView.setFirstPage(1)
.setAutoRefresh(false)
.setPageSize(20)
.setAdapter(mAdapter)
.loadMoreEnable(false)
.refreshEnable(false)
.setLayoutManger(SmartRecycleView.LayoutManagerType.LINEAR_LAYOUT);
mSmartRecycleView.handleData(mData);
}
示例3: updateList
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
public void updateList(List<QueryGoodsSalesDetailRepModel.OrderDtlModel> list) {
LinearLayoutManager lm = new LinearLayoutManager(getContext());
lm.setAutoMeasureEnabled(true);
dtlList.setLayoutManager(lm);
dtlList.setAdapter(new CommonRcvAdapter<QueryGoodsSalesDetailRepModel.OrderDtlModel>(list) {
@NonNull
@Override
public AdapterItem createItem(Object o) {
return new Item();
}
});
}
示例4: updatePayList
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
public void updatePayList(List<QueryGoodsSalesDetailRepModel.PaymentModel> list) {
LinearLayoutManager lm = new LinearLayoutManager(getContext());
lm.setAutoMeasureEnabled(true);
payList.setLayoutManager(lm);
payList.setAdapter(new CommonRcvAdapter<QueryGoodsSalesDetailRepModel.PaymentModel>(list) {
@NonNull
@Override
public AdapterItem createItem(Object o) {
return new PayItem();
}
});
}
示例5: initRecycleView
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void initRecycleView() {
LinearLayoutManager layoutManager = new LinearLayoutManager(this){
@Override
public boolean canScrollVertically() {
return false;
}
};
layoutManager.setAutoMeasureEnabled(true);
recyclerView.setLayoutManager(layoutManager);
adapter = new SearchRecyclerAdapter();
recyclerView.setAdapter(adapter);
adapter.setClickItemListener(this);
}
示例6: onResume
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
@Override
public void onResume() {
super.onResume();
if (mRecycler != null && mRecycler.getAdapter() == null) {
String packageName = getArguments().getString(Intent.EXTRA_PACKAGE_NAME);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
linearLayoutManager.setAutoMeasureEnabled(true);
mRecycler.setLayoutManager(linearLayoutManager);
mRecycler.addItemDecoration(new DividerItemDecoration(mRecycler.getContext(),
LinearLayoutManager.VERTICAL));
mRecycler.setAdapter(new OpsItemAdapter(this, packageName));
}
}
示例7: setupPanels
import android.support.v7.widget.LinearLayoutManager; //导入方法依赖的package包/类
private void setupPanels() {
final PanelAdapter mPanelsAdapter = new PanelAdapter(getActivity());
LinearLayoutManager llm = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
llm.setAutoMeasureEnabled(true);
mPanelsRecyclerView.setAdapter(mPanelsAdapter);
mPanelsRecyclerView.setLayoutManager(llm);
GetPanelsTask mTask = new GetPanelsTask(info.getStreamerName(), new GetPanelsTask.Delegate() {
@Override
public void onPanelsFetched(List<Panel> result) {
mPanelsAdapter.addPanels(result);
}
});
mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
}
}