Skip to content

Instantly share code, notes, and snippets.

@namhyun-gu
Last active August 2, 2017 06:49
Show Gist options
  • Save namhyun-gu/1d57983c941e7be1c7e14bd0472a2096 to your computer and use it in GitHub Desktop.
Save namhyun-gu/1d57983c941e7be1c7e14bd0472a2096 to your computer and use it in GitHub Desktop.
Meaning of RecyclerView.setHasFixedSize
// Reference document
// https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html#setHasFixedSize(boolean)
// stackoverflow: https://stackoverflow.com/questions/28827597/when-do-we-use-the-recyclerview-sethasfixedsize
RecyclerView recyclerView = findViewById(R.id.recyclerview_id);
recyclerView.setHasFixedSize(true); // Not depend on the adapter content.
recyclerView.setHasFixedSize(false); // Depend on the adapter content.
// * Default value is false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment