formatting touchups

This commit is contained in:
Kyle Spearrin 2020-01-29 08:46:21 -05:00
parent 9a66b9003f
commit c3649a9c80
2 changed files with 10 additions and 8 deletions

View File

@ -370,7 +370,7 @@ namespace Bit.Droid.Accessibility
var anchorViewRectTop = anchorViewRect.Top; var anchorViewRectTop = anchorViewRect.Top;
anchorViewRect.Dispose(); anchorViewRect.Dispose();
int calculatedTop = rootRectHeight - anchorViewRectTop; var calculatedTop = rootRectHeight - anchorViewRectTop;
if((int)Build.VERSION.SdkInt >= 24) if((int)Build.VERSION.SdkInt >= 24)
{ {
calculatedTop -= GetNavigationBarHeight(); calculatedTop -= GetNavigationBarHeight();
@ -385,7 +385,8 @@ namespace Bit.Droid.Accessibility
Point point = null; Point point = null;
if(anchorNode != null) if(anchorNode != null)
{ {
anchorNode.Refresh(); // update node's info since this is still a reference from an older event // Update node's info since this is still a reference from an older event
anchorNode.Refresh();
if(!anchorNode.VisibleToUser) if(!anchorNode.VisibleToUser)
{ {
return new Point(-1, -1); return new Point(-1, -1);
@ -406,7 +407,7 @@ namespace Bit.Droid.Accessibility
{ {
return new Point(-1, -1); return new Point(-1, -1);
} }
Rect inputWindowRect = GetInputMethodWindowRect(windows); var inputWindowRect = GetInputMethodWindowRect(windows);
if(inputWindowRect != null) if(inputWindowRect != null)
{ {
limitLowY += inputWindowRect.Height(); limitLowY += inputWindowRect.Height();
@ -419,7 +420,6 @@ namespace Bit.Droid.Accessibility
} }
point = GetOverlayAnchorPosition(root, anchorNode, rootNodeHeight); point = GetOverlayAnchorPosition(root, anchorNode, rootNodeHeight);
if(point.Y < limitLowY || point.Y > limitHighY) if(point.Y < limitLowY || point.Y > limitHighY)
{ {
point.X = -1; point.X = -1;

View File

@ -29,7 +29,8 @@ namespace Bit.Droid.Accessibility
private const string BitwardenWebsite = "vault.bitwarden.com"; private const string BitwardenWebsite = "vault.bitwarden.com";
private AccessibilityNodeInfo _anchorNode = null; private AccessibilityNodeInfo _anchorNode = null;
private int _lastAnchorX, _lastAnchorY = 0; private int _lastAnchorX = 0;
private int _lastAnchorY = 0;
private static bool _overlayAnchorObserverRunning = false; private static bool _overlayAnchorObserverRunning = false;
private IWindowManager _windowManager = null; private IWindowManager _windowManager = null;
private LinearLayout _overlayView = null; private LinearLayout _overlayView = null;
@ -64,7 +65,7 @@ namespace Bit.Droid.Accessibility
return; return;
} }
// AccessibilityHelpers.PrintTestData(root, e); // AccessibilityHelpers.PrintTestData(RootInActiveWindow, e);
AccessibilityNodeInfo root = null; AccessibilityNodeInfo root = null;
@ -83,6 +84,7 @@ namespace Bit.Droid.Accessibility
{ {
break; break;
} }
var isKnownBroswer = AccessibilityHelpers.SupportedBrowsers.ContainsKey(root.PackageName); var isKnownBroswer = AccessibilityHelpers.SupportedBrowsers.ContainsKey(root.PackageName);
if(e.EventType == EventTypes.ViewClicked && isKnownBroswer) if(e.EventType == EventTypes.ViewClicked && isKnownBroswer)
{ {
@ -255,8 +257,8 @@ namespace Bit.Droid.Accessibility
{ {
return; return;
} }
_overlayAnchorObserverRunning = true;
_overlayAnchorObserverRunning = true;
_overlayAnchorObserverRunnable = new Java.Lang.Runnable(() => _overlayAnchorObserverRunnable = new Java.Lang.Runnable(() =>
{ {
if(_overlayAnchorObserverRunning) if(_overlayAnchorObserverRunning)
@ -283,8 +285,8 @@ namespace Bit.Droid.Accessibility
{ {
windows = Windows; windows = Windows;
} }
var anchorPosition = AccessibilityHelpers.GetOverlayAnchorPosition(_anchorNode, root, windows);
var anchorPosition = AccessibilityHelpers.GetOverlayAnchorPosition(_anchorNode, root, windows);
if(anchorPosition == null) if(anchorPosition == null)
{ {
CancelOverlayPrompt(); CancelOverlayPrompt();