1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 15:53:44 +00:00

Made node recycling approach a bit more surgical to appease older versions of Android, and adjusted anchor position offset for older versions of Android (#711)

This commit is contained in:
Matt Portune
2020-01-29 07:23:49 -05:00
committed by GitHub
parent 34e32403b0
commit 9a66b9003f
3 changed files with 13 additions and 21 deletions

View File

@@ -253,6 +253,7 @@ namespace Bit.Droid.Accessibility
if(dispose)
{
n?.Recycle();
n?.Dispose();
}
return nodes;
}
@@ -291,7 +292,6 @@ namespace Bit.Droid.Accessibility
if(usernameEditText != null)
{
isUsernameEditText = IsSameNode(usernameEditText, e.Source);
usernameEditText.Recycle();
}
allEditTexts.Dispose();
@@ -370,7 +370,12 @@ namespace Bit.Droid.Accessibility
var anchorViewRectTop = anchorViewRect.Top;
anchorViewRect.Dispose();
var calculatedTop = rootRectHeight - anchorViewRectTop - GetNavigationBarHeight();
int calculatedTop = rootRectHeight - anchorViewRectTop;
if((int)Build.VERSION.SdkInt >= 24)
{
calculatedTop -= GetNavigationBarHeight();
}
return new Point(anchorViewRectLeft, calculatedTop);
}
@@ -385,6 +390,10 @@ namespace Bit.Droid.Accessibility
{
return new Point(-1, -1);
}
if(!anchorNode.Focused)
{
return null;
}
// node.VisibleToUser doesn't always give us exactly what we want, so attempt to tighten up the range
// of visibility