Skip to content
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

Merged
merged 3 commits into from Jan 9, 2020

Conversation

mpbw2
Copy link
Contributor

@mpbw2 mpbw2 commented Jan 9, 2020

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)

…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">
Copy link
Member

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);
Copy link
Member

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();
Copy link
Member

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;
Copy link
Member

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))
Copy link
Member

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);
Copy link
Member

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;
Copy link
Member

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>();
Copy link
Member

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?

@kspearrin kspearrin closed this Jan 9, 2020
@kspearrin kspearrin reopened this Jan 9, 2020
@kspearrin kspearrin merged commit 21c7b48 into master Jan 9, 2020
@mpbw2 mpbw2 deleted the feature-accessibility-overlay branch January 10, 2020 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants