-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced accessibility service notification with in-line overlay. #695
Conversation
…uires draw-over permission to be enabled (will prompt if not, though this will be enhanced in subsequent commits)
@@ -16,4 +16,13 @@ | |||
<string name="PasswordGenerator"> | |||
Password Generator | |||
</string> | |||
<string name="AccessibilityOverlayLine1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move these into AppResources so that they can be translated. We only use this strings file for a select few things that we cannot use AppResources for.
|
||
public static LinearLayout GetOverlayView(Context context) | ||
{ | ||
LayoutInflater inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use var
|
||
public static Point GetOverlayAnchorPosition(AccessibilityNodeInfo root, AccessibilityEvent e) | ||
{ | ||
Rect rootRect = new Rect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use var
{ | ||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity; | ||
|
||
int barHeight = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use var
{ | ||
if(notificationManager == null || string.IsNullOrWhiteSpace(uri)) | ||
if (!AccessibilityHelpers.OverlayPermitted(this)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to adjust formatting settings to match.
WindowManagerFlags.NotFocusable | WindowManagerFlags.NotTouchModal, | ||
Android.Graphics.Format.Transparent); | ||
|
||
Point anchorPosition = AccessibilityHelpers.GetOverlayAnchorPosition(root, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var
|
||
if(Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch) | ||
Boolean updateView = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var
.SetContentIntent(pendingIntent); | ||
if (_windowManager == null) | ||
{ | ||
_windowManager = GetSystemService(WindowService).JavaCast<IWindowManager>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never seen this JavaCast before. Is that different than a regular cast?
Replaced accessibility service notification with in-line overlay. Requires draw-over permission to be enabled (will prompt if not, though this will be enhanced in subsequent commits)