Skip to content

Commit faf45fc

Browse files
committed
Fixed NoSuchFieldError for some devices when trying to convert dps to pixels.
1 parent f6c25d9 commit faf45fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bottom-navigation-bar/MiscUtils.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public static int DpToPixel (Context context, float dp)
5656

5757
try
5858
{
59-
return (int)(dp * (metrics.DensityDpi / 160f));
59+
return (int)(dp * ((int)metrics.DensityDpi / 160f));
6060
}
61-
catch (Java.Lang.NoSuchFieldError ignored)
61+
catch (Java.Lang.NoSuchFieldError)
6262
{
6363
return (int)TypedValue.ApplyDimension (ComplexUnitType.Dip, dp, metrics);
6464
}

0 commit comments

Comments
 (0)