Skip to content
Permalink
Browse files
Merge pull request #11295 from t895/onlayout-fix
Android: Fix condition where we set grid span too early
  • Loading branch information
JosJuice committed Nov 22, 2022
2 parents 8f5a58f + e677885 commit 8ac8d5a
Showing 1 changed file with 5 additions and 0 deletions.
@@ -75,6 +75,11 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState)
@Override
public void onGlobalLayout()
{
if (mBinding.getRoot().getMeasuredWidth() == 0)
{
return;
}

int columns = mBinding.getRoot().getMeasuredWidth() /
requireContext().getResources().getDimensionPixelSize(R.dimen.card_width);
if (columns == 0)

0 comments on commit 8ac8d5a

Please sign in to comment.