Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MobileScreenReadersApi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
public_accessibility_software
MobileScreenReadersApi
Commits
dc2db644
Commit
dc2db644
authored
Nov 30, 2020
by
Mattia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6bd56c4e
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
48 additions
and
45 deletions
+48
-45
AndroidFocusEvents.cs
SampleApp/SampleApp.Android/AndroidFocusEvents.cs
+2
-2
iOSFocusEvents.cs
SampleApp/SampleApp.iOS/iOSFocusEvents.cs
+2
-2
iOSMagicTap.cs
SampleApp/SampleApp.iOS/iOSMagicTap.cs
+4
-12
CustomImage.cs
SampleApp/SampleApp/CustomRenderers/CustomImage.cs
+13
-0
Functionality17.xaml
SampleApp/SampleApp/Views/Functionality17.xaml
+2
-2
Functionality2.xaml.cs
SampleApp/SampleApp/Views/Functionality2.xaml.cs
+0
-2
Functionality22.xaml
SampleApp/SampleApp/Views/Functionality22.xaml
+1
-1
Functionality22.xaml.cs
SampleApp/SampleApp/Views/Functionality22.xaml.cs
+1
-1
Functionality23.xaml
SampleApp/SampleApp/Views/Functionality23.xaml
+1
-1
Functionality23.xaml.cs
SampleApp/SampleApp/Views/Functionality23.xaml.cs
+1
-2
Functionality3.xaml.cs
SampleApp/SampleApp/Views/Functionality3.xaml.cs
+17
-11
Functionality4.xaml.cs
SampleApp/SampleApp/Views/Functionality4.xaml.cs
+2
-2
Functionality6.xaml.cs
SampleApp/SampleApp/Views/Functionality6.xaml.cs
+2
-7
No files found.
SampleApp/SampleApp.Android/AndroidFocusEvents.cs
View file @
dc2db644
...
@@ -3,12 +3,12 @@ using Android.Content;
...
@@ -3,12 +3,12 @@ using Android.Content;
using
Android.Service.Autofill
;
using
Android.Service.Autofill
;
using
Android.Views.Accessibility
;
using
Android.Views.Accessibility
;
using
CustomViewAccessibility.Droid
;
using
CustomViewAccessibility.Droid
;
using
SampleApp.
DependencyService
s
;
using
SampleApp.
CustomRenderer
s
;
using
SampleApp.Views
;
using
SampleApp.Views
;
using
Xamarin.Forms
;
using
Xamarin.Forms
;
using
Xamarin.Forms.Platform.Android
;
using
Xamarin.Forms.Platform.Android
;
[assembly: ExportRenderer(typeof(
IFocusEvents
), typeof(AndroidFocusEvents))]
[assembly: ExportRenderer(typeof(
CustomImage
), typeof(AndroidFocusEvents))]
namespace
CustomViewAccessibility.Droid
namespace
CustomViewAccessibility.Droid
{
{
public
class
AndroidFocusEvents
:
ImageRenderer
public
class
AndroidFocusEvents
:
ImageRenderer
...
...
SampleApp/SampleApp.iOS/iOSFocusEvents.cs
View file @
dc2db644
using
System
;
using
System
;
using
SampleApp.
DependencyService
s
;
using
SampleApp.
CustomRenderer
s
;
using
Xamarin.Forms
;
using
Xamarin.Forms
;
using
SampleApp.iOS
;
using
SampleApp.iOS
;
using
Xamarin.Forms.Platform.iOS
;
using
Xamarin.Forms.Platform.iOS
;
using
SampleApp.Views
;
using
SampleApp.Views
;
[assembly: ExportRenderer(typeof(
IFocusEvents
), typeof(iOSFocusEvents))]
[assembly: ExportRenderer(typeof(
CustomImage
), typeof(iOSFocusEvents))]
namespace
SampleApp.iOS
namespace
SampleApp.iOS
{
{
public
class
iOSFocusEvents
:
ImageRenderer
public
class
iOSFocusEvents
:
ImageRenderer
...
...
SampleApp/SampleApp.iOS/iOSMagicTap.cs
View file @
dc2db644
...
@@ -21,11 +21,6 @@ namespace SampleApp.iOS
...
@@ -21,11 +21,6 @@ namespace SampleApp.iOS
SetNativeControl
(
new
MyView
());
SetNativeControl
(
new
MyView
());
}
}
}
}
}
}
public
class
MyView
:
UITextView
public
class
MyView
:
UITextView
...
@@ -34,22 +29,19 @@ namespace SampleApp.iOS
...
@@ -34,22 +29,19 @@ namespace SampleApp.iOS
public
MyView
()
:
base
()
public
MyView
()
:
base
()
{
{
base
.
Text
=
"Select this label with the accessibility focus and perform a magic tap (tap with two fingers) to change the background color."
;
base
.
Text
=
"Perform a magic tap (tap with two fingers) to change the background color."
;
Console
.
WriteLine
(
"My View created"
);
base
.
AccessibilityPerformMagicTap
();
base
.
AccessibilityPerformMagicTap
();
base
.
Editable
=
false
;
base
.
Editable
=
false
;
base
.
Font
=
base
.
Font
.
WithSize
(
30
);
Functionality23
.
customEditor
.
BackgroundColor
=
Color
.
White
;
Functionality23
.
customEditor
.
TextColor
=
Color
.
Black
;
}
}
public
override
bool
AccessibilityPerformMagicTap
()
public
override
bool
AccessibilityPerformMagicTap
()
{
{
Console
.
WriteLine
(
"MAGIC TAP"
);
//random color
//random color
Color
randomColor
=
Color
.
FromRgb
(
rnd
.
Next
(
256
),
rnd
.
Next
(
256
),
rnd
.
Next
(
256
));
Color
randomColor
=
Color
.
FromRgb
(
rnd
.
Next
(
256
),
rnd
.
Next
(
256
),
rnd
.
Next
(
256
));
Functionality23
.
customEditor
.
Text
=
"MAGIC TAP"
;
Functionality23
.
customEditor
.
Text
=
"MAGIC TAP"
;
Functionality23
.
customEditor
.
BackgroundColor
=
randomColor
;
Functionality23
.
customEditor
.
BackgroundColor
=
randomColor
;
Functionality23
.
customEditor
.
TextColor
=
Color
.
White
;
Functionality23
.
customEditor
.
TextColor
=
Color
.
White
;
...
...
SampleApp/SampleApp/
DependencyServices/IFocusEvents
.cs
→
SampleApp/SampleApp/
CustomRenderers/CustomImage
.cs
View file @
dc2db644
using
System
;
using
System
;
using
Xamarin.Forms
;
using
Xamarin.Forms
;
namespace
SampleApp.
DependencyService
s
namespace
SampleApp.
CustomRenderer
s
{
{
public
class
IFocusEvents
:
Image
public
class
CustomImage
:
Image
{
{
public
IFocusEvents
()
public
CustomImage
()
{
{
}
}
...
...
SampleApp/SampleApp/Views/Functionality17.xaml
View file @
dc2db644
...
@@ -5,11 +5,11 @@
...
@@ -5,11 +5,11 @@
<Label
Text=
"This is an example text."
Margin=
"50"
x:Name=
"TextToRead"
></Label>
<Label
Text=
"This is an example text."
Margin=
"50"
x:Name=
"TextToRead"
></Label>
<StackLayout>
<StackLayout>
<Label
Text=
"Ch
e
nge the volume"
></Label>
<Label
Text=
"Ch
a
nge the volume"
></Label>
<Slider
Minimum=
"0.0"
Maximum=
"1.0"
ValueChanged=
"Slider_Volume_ValueChanged"
Value=
"0.5"
></Slider>
<Slider
Minimum=
"0.0"
Maximum=
"1.0"
ValueChanged=
"Slider_Volume_ValueChanged"
Value=
"0.5"
></Slider>
</StackLayout>
</StackLayout>
<StackLayout>
<StackLayout>
<Label
Text=
"Ch
e
nge the pitch"
></Label>
<Label
Text=
"Ch
a
nge the pitch"
></Label>
<Slider
Minimum=
"0.1"
Maximum=
"2.0"
ValueChanged=
"Slider_Pitch_ValueChanged"
Value=
"1.0"
></Slider>
<Slider
Minimum=
"0.1"
Maximum=
"2.0"
ValueChanged=
"Slider_Pitch_ValueChanged"
Value=
"1.0"
></Slider>
</StackLayout>
</StackLayout>
<Button
Text=
"Read the example text"
Clicked=
"Button_Clicked"
></Button>
<Button
Text=
"Read the example text"
Clicked=
"Button_Clicked"
></Button>
...
...
SampleApp/SampleApp/Views/Functionality2.xaml.cs
View file @
dc2db644
...
@@ -32,7 +32,6 @@ namespace SampleApp.Views
...
@@ -32,7 +32,6 @@ namespace SampleApp.Views
{
{
if
(
topDown
)
if
(
topDown
)
{
{
label2
.
Text
=
"3"
;
label2
.
Text
=
"3"
;
label2
.
TabIndex
=
3
;
label2
.
TabIndex
=
3
;
label3
.
Text
=
"2"
;
label3
.
Text
=
"2"
;
...
@@ -50,7 +49,6 @@ namespace SampleApp.Views
...
@@ -50,7 +49,6 @@ namespace SampleApp.Views
FocusOrderLabel
.
Text
=
"Focus order is: TOP-DOWN"
;
FocusOrderLabel
.
Text
=
"Focus order is: TOP-DOWN"
;
}
}
topDown
=
!
topDown
;
topDown
=
!
topDown
;
}
}
}
}
}
}
SampleApp/SampleApp/Views/Functionality22.xaml
View file @
dc2db644
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<StackLayout
VerticalOptions=
"Center"
HorizontalOptions=
"Center"
>
<StackLayout
VerticalOptions=
"Center"
HorizontalOptions=
"Center"
>
<Label
Text=
""
x:Name=
"labelAv"
HorizontalTextAlignment=
"Center"
></Label>
<Label
Text=
""
x:Name=
"labelAv"
HorizontalTextAlignment=
"Center"
></Label>
<Label
Text=
"Click on show header button to check witch view is header"
x:Name=
"label1"
HorizontalTextAlignment=
"Center"
></Label>
<Label
Text=
"Click on show header button to check witch view is header"
x:Name=
"label1"
HorizontalTextAlignment=
"Center"
></Label>
<Label
Text=
"Click on show pane button to check witch view
is pan
e"
x:Name=
"label2"
HorizontalTextAlignment=
"Center"
></Label>
<Label
Text=
"Click on show pane button to check witch view
has a pane titl
e"
x:Name=
"label2"
HorizontalTextAlignment=
"Center"
></Label>
<Button
Text=
"Show header"
Clicked=
"Button_Clicked"
x:Name=
"button1"
></Button>
<Button
Text=
"Show header"
Clicked=
"Button_Clicked"
x:Name=
"button1"
></Button>
<Button
Text=
"Show pane"
Clicked=
"Button_Clicked1"
x:Name=
"button2"
></Button>
<Button
Text=
"Show pane"
Clicked=
"Button_Clicked1"
x:Name=
"button2"
></Button>
</StackLayout>
</StackLayout>
...
...
SampleApp/SampleApp/Views/Functionality22.xaml.cs
View file @
dc2db644
...
@@ -85,7 +85,7 @@ namespace SampleApp.Views
...
@@ -85,7 +85,7 @@ namespace SampleApp.Views
{
{
Heading
.
SetHeading
(
label1
);
Heading
.
SetHeading
(
label1
);
Pane
.
SetPane
(
label2
,
"
test
"
);
Pane
.
SetPane
(
label2
,
"
PaneTitle
"
);
}
}
}
}
...
...
SampleApp/SampleApp/Views/Functionality23.xaml
View file @
dc2db644
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns=
"http://xamarin.com/schemas/2014/forms"
xmlns:x=
"http://schemas.microsoft.com/winfx/2009/xaml"
x:Class=
"SampleApp.Views.Functionality23"
>
<ContentPage
xmlns=
"http://xamarin.com/schemas/2014/forms"
xmlns:x=
"http://schemas.microsoft.com/winfx/2009/xaml"
x:Class=
"SampleApp.Views.Functionality23"
>
<StackLayout
x:Name=
"background"
HorizontalOptions=
"
Center"
VerticalOptions=
"Center
"
>
<StackLayout
x:Name=
"background"
HorizontalOptions=
"
FillAndExpand"
VerticalOptions=
"FillAndExpand
"
>
</StackLayout>
</StackLayout>
</ContentPage>
</ContentPage>
SampleApp/SampleApp/Views/Functionality23.xaml.cs
View file @
dc2db644
...
@@ -8,7 +8,7 @@ namespace SampleApp.Views
...
@@ -8,7 +8,7 @@ namespace SampleApp.Views
{
{
public
partial
class
Functionality23
:
ContentPage
public
partial
class
Functionality23
:
ContentPage
{
{
public
static
CustomView
customEditor
=
new
CustomView
{
Text
=
""
,
IsReadOnly
=
true
};
public
static
CustomView
customEditor
=
new
CustomView
{
Text
=
""
,
HorizontalOptions
=
LayoutOptions
.
FillAndExpand
,
VerticalOptions
=
LayoutOptions
.
FillAndExpand
};
public
Functionality23
()
public
Functionality23
()
{
{
InitializeComponent
();
InitializeComponent
();
...
@@ -19,7 +19,6 @@ namespace SampleApp.Views
...
@@ -19,7 +19,6 @@ namespace SampleApp.Views
AutomationProperties
.
SetIsInAccessibleTree
(
customEditor
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
customEditor
,
true
);
background
.
Children
.
Add
(
customEditor
);
background
.
Children
.
Add
(
customEditor
);
}
}
}
}
}
}
SampleApp/SampleApp/Views/Functionality3.xaml.cs
View file @
dc2db644
...
@@ -9,15 +9,19 @@ namespace SampleApp.Views
...
@@ -9,15 +9,19 @@ namespace SampleApp.Views
public
partial
class
Functionality3
:
ContentPage
public
partial
class
Functionality3
:
ContentPage
{
{
IAssignFocus
assignFocus
;
IAssignFocus
assignFocus
;
IScreenReaderEnabled
screenReaderEnabled
;
Boolean
focus
=
true
;
Boolean
focus
=
true
;
public
Functionality3
()
public
Functionality3
()
{
{
InitializeComponent
();
InitializeComponent
();
assignFocus
=
DependencyService
.
Get
<
IAssignFocus
>();
assignFocus
=
DependencyService
.
Get
<
IAssignFocus
>();
screenReaderEnabled
=
DependencyService
.
Resolve
<
IScreenReaderEnabled
>();
AutomationProperties
.
SetIsInAccessibleTree
(
label
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
label
,
true
);
}
}
void
Button_Clicked
(
System
.
Object
sender
,
System
.
EventArgs
e
)
void
Button_Clicked
(
System
.
Object
sender
,
System
.
EventArgs
e
)
{
if
(
screenReaderEnabled
.
IsScreenReaderEnabled
())
{
{
if
(
focus
)
if
(
focus
)
{
{
...
@@ -33,5 +37,7 @@ namespace SampleApp.Views
...
@@ -33,5 +37,7 @@ namespace SampleApp.Views
}
}
focus
=
!
focus
;
focus
=
!
focus
;
}
}
}
}
}
}
}
SampleApp/SampleApp/Views/Functionality4.xaml.cs
View file @
dc2db644
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.ComponentModel
;
using
System.Reflection
;
using
System.Reflection
;
using
SampleApp.
DependencyService
s
;
using
SampleApp.
CustomRenderer
s
;
using
Xamarin.Forms
;
using
Xamarin.Forms
;
...
@@ -19,7 +19,7 @@ namespace SampleApp.Views
...
@@ -19,7 +19,7 @@ namespace SampleApp.Views
InitializeComponent
();
InitializeComponent
();
// immagine campanello
// immagine campanello
IFocusEvents
BellImage
=
new
IFocusEvents
CustomImage
BellImage
=
new
CustomImage
{
{
Source
=
ImageSource
.
FromResource
(
"SampleApp.images.bell.png"
,
typeof
(
Functionality4
).
GetTypeInfo
().
Assembly
)
Source
=
ImageSource
.
FromResource
(
"SampleApp.images.bell.png"
,
typeof
(
Functionality4
).
GetTypeInfo
().
Assembly
)
};
};
...
...
SampleApp/SampleApp/Views/Functionality6.xaml.cs
View file @
dc2db644
...
@@ -18,16 +18,11 @@ namespace SampleApp.Views
...
@@ -18,16 +18,11 @@ namespace SampleApp.Views
void
EntryName_TextChanged
(
object
sender
,
TextChangedEventArgs
e
)
void
EntryName_TextChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
{
var
newText
=
e
.
NewTextValue
;
AutomationProperties
.
SetName
(
forkImage
,
e
.
NewTextValue
);
AutomationProperties
.
SetName
(
forkImage
,
e
.
NewTextValue
);
}
}
void
EntryHelpText_TextChanged
(
object
sender
,
TextChangedEventArgs
e
)
void
EntryHelpText_TextChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
{
var
newText
=
e
.
NewTextValue
;
AutomationProperties
.
SetHelpText
(
forkImage
,
e
.
NewTextValue
);
AutomationProperties
.
SetHelpText
(
forkImage
,
e
.
NewTextValue
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment