本文整理匯總了Java中android.support.v7.widget.RecyclerView.hasFixedSize方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.hasFixedSize方法的具體用法?Java RecyclerView.hasFixedSize怎麽用?Java RecyclerView.hasFixedSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.hasFixedSize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void setupView() {
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
mSearchEditText = (EditText) findViewById(R.id.et_search);
// Setup Progress Dialog to show loading state
mDialog = new ProgressDialog(MainActivity.this);
mDialog.setIndeterminate(true);
mDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
mDialog.setTitle(getString(R.string.progress_title));
mDialog.setMessage(getString(R.string.progress_body));
mDialog.setCancelable(false);
mDialog.setCanceledOnTouchOutside(false);
mRecyclerView.setRecycledViewPool(new RecyclerView.RecycledViewPool());
mRecyclerView.setLayoutManager(new LinearLayoutManager(
this, LinearLayoutManager.VERTICAL, false)
);
mRecyclerView.hasFixedSize();
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
DividerItemDecoration mDividerItemDecoration = new DividerItemDecoration(
mRecyclerView.getContext(), LinearLayoutManager.VERTICAL
);
mRecyclerView.addItemDecoration(mDividerItemDecoration);
mAdapter = new DataAdapter(getLayoutInflater());
mRecyclerView.setAdapter(mAdapter);
}
示例2: onCreateView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_file_infos, container, false);
RecyclerView recyclerView = (RecyclerView) root.findViewById(R.id.recycler_view_file_infos);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(mAdapter);
recyclerView.hasFixedSize();
return root;
}