Merge pull request #11295 from t895/onlayout-fix
Android: Fix condition where we set grid span too early
This commit is contained in:
commit
8ac8d5afb6
|
@ -75,6 +75,11 @@ public final class PlatformGamesFragment extends Fragment implements PlatformGam
|
||||||
@Override
|
@Override
|
||||||
public void onGlobalLayout()
|
public void onGlobalLayout()
|
||||||
{
|
{
|
||||||
|
if (mBinding.getRoot().getMeasuredWidth() == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int columns = mBinding.getRoot().getMeasuredWidth() /
|
int columns = mBinding.getRoot().getMeasuredWidth() /
|
||||||
requireContext().getResources().getDimensionPixelSize(R.dimen.card_width);
|
requireContext().getResources().getDimensionPixelSize(R.dimen.card_width);
|
||||||
if (columns == 0)
|
if (columns == 0)
|
||||||
|
|
Loading…
Reference in New Issue