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
6bd56c4e
Commit
6bd56c4e
authored
Nov 21, 2020
by
Mattia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
d40e6438
Changes
30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
410 additions
and
59 deletions
+410
-59
UserPrefs.xml
SampleApp/.vs/SampleApp/xs/UserPrefs.xml
+10
-13
SampleApp-Debug.json
...leApp/.vs/SampleApp/xs/project-cache/SampleApp-Debug.json
+1
-1
SampleApp.Android-Debug.json
...s/SampleApp/xs/project-cache/SampleApp.Android-Debug.json
+1
-1
SampleApp.iOS-Debug|iPhone.json
...ampleApp/xs/project-cache/SampleApp.iOS-Debug|iPhone.json
+1
-1
SampleApp.iOS-Debug|iPhoneSimulator.json
...xs/project-cache/SampleApp.iOS-Debug|iPhoneSimulator.json
+1
-1
AndroidFocusEvents.cs
SampleApp/SampleApp.Android/AndroidFocusEvents.cs
+4
-2
AndroidHeaderPane.cs
SampleApp/SampleApp.Android/AndroidHeaderPane.cs
+48
-0
AndroidReadText.cs
SampleApp/SampleApp.Android/AndroidReadText.cs
+22
-0
SampleApp.Android.csproj
SampleApp/SampleApp.Android/SampleApp.Android.csproj
+2
-0
SampleApp.iOS.csproj
SampleApp/SampleApp.iOS/SampleApp.iOS.csproj
+2
-0
iOSAssignFocus.cs
SampleApp/SampleApp.iOS/iOSAssignFocus.cs
+1
-0
iOSFocusEvents.cs
SampleApp/SampleApp.iOS/iOSFocusEvents.cs
+1
-0
iOSMagicTap.cs
SampleApp/SampleApp.iOS/iOSMagicTap.cs
+59
-0
iOSReadText.cs
SampleApp/SampleApp.iOS/iOSReadText.cs
+30
-0
CustomView.cs
SampleApp/SampleApp/CustomRenderers/CustomView.cs
+10
-0
IAccessibilityHeading.cs
...App/SampleApp/DependencyServices/IAccessibilityHeading.cs
+14
-0
IAccessibilityPane.cs
SampleApp/SampleApp/DependencyServices/IAccessibilityPane.cs
+13
-0
IReadText.cs
SampleApp/SampleApp/DependencyServices/IReadText.cs
+10
-0
ListPageViewModel.cs
SampleApp/SampleApp/ViewModels/ListPageViewModel.cs
+5
-3
Functionality11.xaml
SampleApp/SampleApp/Views/Functionality11.xaml
+5
-1
Functionality11.xaml.cs
SampleApp/SampleApp/Views/Functionality11.xaml.cs
+13
-1
Functionality2.xaml
SampleApp/SampleApp/Views/Functionality2.xaml
+1
-1
Functionality22.xaml
SampleApp/SampleApp/Views/Functionality22.xaml
+7
-3
Functionality22.xaml.cs
SampleApp/SampleApp/Views/Functionality22.xaml.cs
+80
-1
Functionality23.xaml
SampleApp/SampleApp/Views/Functionality23.xaml
+2
-3
Functionality23.xaml.cs
SampleApp/SampleApp/Views/Functionality23.xaml.cs
+10
-0
Functionality5.xaml.cs
SampleApp/SampleApp/Views/Functionality5.xaml.cs
+36
-16
Functionality7.xaml
SampleApp/SampleApp/Views/Functionality7.xaml
+0
-1
Functionality7.xaml.cs
SampleApp/SampleApp/Views/Functionality7.xaml.cs
+1
-0
MainPage.xaml.cs
SampleApp/SampleApp/Views/MainPage.xaml.cs
+20
-10
No files found.
SampleApp/.vs/SampleApp/xs/UserPrefs.xml
View file @
6bd56c4e
<Properties
StartupConfiguration=
"{1EE7473C-9A98-44EF-8124-C4D1E0E468F8}|Default"
>
<MonoDevelop.Ide.Workbench>
<Properties
StartupConfiguration=
"{0E082BA3-B87F-40B4-9700-878BE1A55954}|Default"
>
<MonoDevelop.Ide.Workbench
ActiveDocument=
"SampleApp/ViewModels/ListPageViewModel.cs"
>
<Files>
<File
FileName=
"SampleApp/Views/MainPage.xaml.cs"
Line=
"66"
Column=
"23"
/>
<File
FileName=
"SampleApp/ViewModels/ListPageViewModel.cs"
Line=
"24"
Column=
"91"
/>
</Files>
<Pads>
<Pad
Id=
"ProjectPad"
>
<State
name=
"__root__"
>
<Node
name=
"SampleApp"
expanded=
"True"
>
<Node
name=
"SampleApp"
expanded=
"True"
>
<Node
name=
"Views"
expanded=
"True"
>
<Node
name=
"Functionality2.xaml"
expanded=
"True"
>
<Node
name=
"Functionality2.xaml.cs"
selected=
"True"
/>
</Node>
<Node
name=
"Functionality4.xaml"
expanded=
"True"
/>
<Node
name=
"MainPage.xaml"
expanded=
"True"
/>
</Node>
<Node
name=
"images"
expanded=
"True"
/>
</Node>
<Node
name=
"SampleApp.iOS"
expanded=
"True"
/>
</Node>
</State>
</Pad>
</Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.ItemProperties.SampleApp.Android
AndroidDesignerPreferredTheme=
"Theme.AppCompat.Light.NoActionBar"
PreferredExecutionTarget=
"Android.
pixel_2_q_10_0_-_api
_29"
/>
<MonoDevelop.Ide.ItemProperties.SampleApp.iOS
automaticSigning=
"False"
PreferredExecutionTarget=
"MonoDevelop.IPhone.IPhone
SimulatorTarget.702581F9-973B-4F9F-A1E7-5A202CF499AB
"
/>
<MonoDevelop.Ide.ItemProperties.SampleApp.Android
AndroidDesignerPreferredTheme=
"Theme.AppCompat.Light.NoActionBar"
PreferredExecutionTarget=
"Android.
Pixel_3_API
_29"
/>
<MonoDevelop.Ide.ItemProperties.SampleApp.iOS
automaticSigning=
"False"
PreferredExecutionTarget=
"MonoDevelop.IPhone.IPhone
DeviceTarget.d0d4bfac7e5fd6f1456633ef7d45122e2fa38791
"
/>
<MonoDevelop.Ide.DebuggingService.PinnedWatches
/>
<MonoDevelop.Ide.Workspace
ActiveConfiguration=
"Debug"
/>
<MonoDevelop.Ide.Workspace
ActiveConfiguration=
"Debug
|iPhone
"
/>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore
/>
</MonoDevelop.Ide.DebuggingService.Breakpoints>
...
...
SampleApp/.vs/SampleApp/xs/project-cache/SampleApp-Debug.json
View file @
6bd56c4e
This diff is collapsed.
Click to expand it.
SampleApp/.vs/SampleApp/xs/project-cache/SampleApp.Android-Debug.json
View file @
6bd56c4e
This diff is collapsed.
Click to expand it.
SampleApp/.vs/SampleApp/xs/project-cache/SampleApp.iOS-Debug|iPhone.json
View file @
6bd56c4e
This diff is collapsed.
Click to expand it.
SampleApp/.vs/SampleApp/xs/project-cache/SampleApp.iOS-Debug|iPhoneSimulator.json
View file @
6bd56c4e
This diff is collapsed.
Click to expand it.
SampleApp/SampleApp.Android/AndroidFocusEvents.cs
View file @
6bd56c4e
...
...
@@ -4,6 +4,7 @@ using Android.Service.Autofill;
using
Android.Views.Accessibility
;
using
CustomViewAccessibility.Droid
;
using
SampleApp.DependencyServices
;
using
SampleApp.Views
;
using
Xamarin.Forms
;
using
Xamarin.Forms.Platform.Android
;
...
...
@@ -51,12 +52,13 @@ namespace CustomViewAccessibility.Droid
base
.
OnInitializeAccessibilityEvent
(
e
);
if
(
e
.
EventType
==
EventTypes
.
ViewAccessibilityFocused
)
{
Functionality4
.
myLabel
.
Text
=
"Bell Image Has Focus"
;
Console
.
WriteLine
(
"ACCESSIBILITY I am in focus"
);
}
else
if
(
e
.
EventType
==
EventTypes
.
ViewAccessibilityFocusCleared
)
{
Functionality4
.
myLabel
.
Text
=
"Bell Image does not have focus"
;
Console
.
WriteLine
(
"ACCESSIBILITY I am in NOT in focus"
);
}
}
...
...
SampleApp/SampleApp.Android/AndroidHeaderPane.cs
0 → 100644
View file @
6bd56c4e
using
System
;
using
SampleApp.DependencyServices
;
using
SampleApp.Droid
;
using
Xamarin.Forms
;
using
Xamarin.Forms.Platform.Android
;
[assembly: Dependency(typeof(AndroidHeaderPane))]
namespace
SampleApp.Droid
{
public
class
AndroidHeaderPane
:
IAccessibilityHeading
,
IAccessibilityPane
{
public
AndroidHeaderPane
()
{
}
public
void
SetHeading
(
View
v
)
{
v
.
GetRenderer
().
View
.
AccessibilityHeading
=
true
;
}
//check if the passed view (vc) is a header
public
bool
CheckHeading
(
View
vc
)
{
if
(
vc
.
GetRenderer
().
View
.
AccessibilityHeading
==
true
)
{
return
true
;
}
return
false
;
}
public
void
SetPane
(
View
v
,
string
t
)
{
v
.
GetRenderer
().
View
.
AccessibilityPaneTitle
=
t
;
}
public
bool
CheckPane
(
View
vc
)
{
if
(
vc
.
GetRenderer
().
View
.
AccessibilityPaneTitle
==
null
)
{
return
false
;
}
return
true
;
}
}
}
SampleApp/SampleApp.Android/AndroidReadText.cs
0 → 100644
View file @
6bd56c4e
using
System
;
using
SampleApp.DependencyServices
;
using
SampleApp.Droid
;
using
Xamarin.Forms
;
using
Xamarin.Forms.Platform.Android
;
[assembly: Dependency(typeof(AndroidReadText))]
namespace
SampleApp.Droid
{
public
class
AndroidReadText
:
IReadText
{
public
AndroidReadText
()
{
}
public
void
ReadText
(
Label
t
)
{
t
.
GetRenderer
().
View
.
AnnounceForAccessibility
(
t
.
Text
);
}
}
}
SampleApp/SampleApp.Android/SampleApp.Android.csproj
View file @
6bd56c4e
...
...
@@ -64,6 +64,8 @@
<Compile
Include=
"AndroidFocusEvents.cs"
/>
<Compile
Include=
"AndroidHasFocus.cs"
/>
<Compile
Include=
"AndroidScreenReaderEnabled.cs"
/>
<Compile
Include=
"AndroidReadText.cs"
/>
<Compile
Include=
"AndroidHeaderPane.cs"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"Resources\AboutResources.txt"
/>
...
...
SampleApp/SampleApp.iOS/SampleApp.iOS.csproj
View file @
6bd56c4e
...
...
@@ -73,6 +73,8 @@
<Compile
Include=
"iOSFocusEvents.cs"
/>
<Compile
Include=
"iOSHasFocus.cs"
/>
<Compile
Include=
"iOSScreenReaderEnabled.cs"
/>
<Compile
Include=
"iOSReadText.cs"
/>
<Compile
Include=
"iOSMagicTap.cs"
/>
</ItemGroup>
<ItemGroup>
<InterfaceDefinition
Include=
"Resources\LaunchScreen.storyboard"
/>
...
...
SampleApp/SampleApp.iOS/iOSAssignFocus.cs
View file @
6bd56c4e
...
...
@@ -12,6 +12,7 @@ namespace SampleApp.iOS
{
public
void
AssignFocus
(
View
v
)
{
UIAccessibility
.
PostNotification
(
notification
:
UIAccessibilityPostNotification
.
ScreenChanged
,
argument
:
v
.
GetRenderer
().
NativeView
);
}
...
...
SampleApp/SampleApp.iOS/iOSFocusEvents.cs
View file @
6bd56c4e
...
...
@@ -56,5 +56,6 @@ namespace SampleApp.iOS
}
}
SampleApp/SampleApp.iOS/iOSMagicTap.cs
0 → 100644
View file @
6bd56c4e
using
System
;
using
SampleApp.CustomRenderers
;
using
Xamarin.Forms
;
using
SampleApp.iOS
;
using
Xamarin.Forms.Platform.iOS
;
using
SampleApp.Views
;
using
UIKit
;
[assembly: ExportRenderer(typeof(CustomView), typeof(iOSMagicTap))]
namespace
SampleApp.iOS
{
public
class
iOSMagicTap
:
EditorRenderer
{
protected
override
void
OnElementChanged
(
ElementChangedEventArgs
<
Editor
>
e
)
{
base
.
OnElementChanged
(
e
);
if
(
Control
!=
null
)
{
SetNativeControl
(
new
MyView
());
}
}
}
public
class
MyView
:
UITextView
{
private
Random
rnd
=
new
Random
();
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."
;
Console
.
WriteLine
(
"My View created"
);
base
.
AccessibilityPerformMagicTap
();
base
.
Editable
=
false
;
}
public
override
bool
AccessibilityPerformMagicTap
()
{
Console
.
WriteLine
(
"MAGIC TAP"
);
//random color
Color
randomColor
=
Color
.
FromRgb
(
rnd
.
Next
(
256
),
rnd
.
Next
(
256
),
rnd
.
Next
(
256
));
Functionality23
.
customEditor
.
Text
=
"MAGIC TAP"
;
Functionality23
.
customEditor
.
BackgroundColor
=
randomColor
;
Functionality23
.
customEditor
.
TextColor
=
Color
.
White
;
return
true
;
}
}
}
\ No newline at end of file
SampleApp/SampleApp.iOS/iOSReadText.cs
0 → 100644
View file @
6bd56c4e
using
System
;
using
System.Threading.Tasks
;
using
SampleApp.DependencyServices
;
using
SampleApp.iOS
;
using
UIKit
;
using
Xamarin.Forms
;
using
Xamarin.Forms.Platform.iOS
;
[assembly: Dependency(typeof(iOSReadText))]
namespace
SampleApp.iOS
{
public
class
iOSReadText
:
IReadText
{
public
iOSReadText
()
{
}
public
void
ReadText
(
Label
t
)
{
Device
.
StartTimer
(
TimeSpan
.
FromMilliseconds
(
100.0
),
()
=>
{
Foundation
.
NSString
ss
=
new
Foundation
.
NSString
(
t
.
Text
);
UIAccessibility
.
PostNotification
(
UIAccessibilityPostNotification
.
Announcement
,
ss
);
return
false
;
// runs again, or false to stop
});
}
}
}
SampleApp/SampleApp/CustomRenderers/CustomView.cs
0 → 100644
View file @
6bd56c4e
using
System
;
using
Xamarin.Forms
;
namespace
SampleApp.CustomRenderers
{
public
class
CustomView
:
Editor
{
}
}
SampleApp/SampleApp/DependencyServices/IAccessibilityHeading.cs
0 → 100644
View file @
6bd56c4e
using
System
;
using
Xamarin.Forms
;
namespace
SampleApp.DependencyServices
{
public
interface
IAccessibilityHeading
{
void
SetHeading
(
View
v
);
bool
CheckHeading
(
View
vc
);
}
}
SampleApp/SampleApp/DependencyServices/IAccessibilityPane.cs
0 → 100644
View file @
6bd56c4e
using
System
;
using
Xamarin.Forms
;
namespace
SampleApp.DependencyServices
{
public
interface
IAccessibilityPane
{
void
SetPane
(
View
v
,
string
t
);
bool
CheckPane
(
View
vc
);
}
}
SampleApp/SampleApp/DependencyServices/IReadText.cs
0 → 100644
View file @
6bd56c4e
using
System
;
using
Xamarin.Forms
;
namespace
SampleApp.DependencyServices
{
public
interface
IReadText
{
void
ReadText
(
Label
t
);
}
}
SampleApp/SampleApp/ViewModels/ListPageViewModel.cs
View file @
6bd56c4e
...
...
@@ -79,7 +79,7 @@ namespace SampleApp.ViewModels
{
Name
=
"11"
,
Description
=
"Read a text with the screen-reader TTS"
,
Availability
=
"
Not available on XAMARIN
"
,
Availability
=
"
Indirect Implementation
"
,
});
explicitTTS
.
Add
(
new
APIFunctionality
{
...
...
@@ -143,13 +143,15 @@ namespace SampleApp.ViewModels
{
Name
=
"22"
,
Description
=
"Support navigation by specifying which views are headers or panes"
,
Availability
=
"Not available on XAMARIN"
,
Availability
=
"Not available on iOS"
,
});
miscellanous
.
Add
(
new
APIFunctionality
{
Name
=
"23"
,
Description
=
"Define how to respond to user actions that are only available when the screen reader is active"
,
Availability
=
"Not available on XAMARIN"
,
Availability
=
"Not available on Android"
,
});
miscellanous
.
Add
(
new
APIFunctionality
{
...
...
SampleApp/SampleApp/Views/Functionality11.xaml
View file @
6bd56c4e
<?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.Functionality11"
>
<ContentPage.Content>
<Label
Text=
"Not available on XAMARIN"
></Label>
<StackLayout
HorizontalOptions=
"Center"
VerticalOptions=
"Center"
>
<Label
x:Name=
"label"
Text=
"The text to speech will be read by the screen reader."
HorizontalTextAlignment=
"Center"
></Label>
<Button
Clicked=
"Button_Clicked"
Text=
"Read the text above"
x:Name=
"button"
></Button>
</StackLayout>
</ContentPage.Content>
</ContentPage>
SampleApp/SampleApp/Views/Functionality11.xaml.cs
View file @
6bd56c4e
using
System
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
SampleApp.DependencyServices
;
using
Xamarin.Forms
;
namespace
SampleApp.Views
{
public
partial
class
Functionality11
:
ContentPage
{
IReadText
readText
;
public
Functionality11
()
{
InitializeComponent
();
readText
=
DependencyService
.
Get
<
IReadText
>();
AutomationProperties
.
SetIsInAccessibleTree
(
label
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
button
,
true
);
}
void
Button_Clicked
(
System
.
Object
sender
,
System
.
EventArgs
e
)
{
readText
.
ReadText
(
label
);
}
}
}
SampleApp/SampleApp/Views/Functionality2.xaml
View file @
6bd56c4e
...
...
@@ -17,7 +17,7 @@
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label
x:Name=
"FocusOrderLabel"
Grid.Row=
"0"
></Label>
<Label
x:Name=
"FocusOrderLabel"
Grid.Row=
"0"
Grid.ColumnSpan=
"4"
></Label>
<Label
x:Name=
"label1"
Text=
"1"
Grid.Row=
"1"
Grid.Column=
"0"
BackgroundColor=
"AliceBlue"
VerticalTextAlignment=
"Center"
HorizontalTextAlignment=
"Center"
></Label>
<Label
x:Name=
"label2"
Text=
"2"
Grid.Row=
"2"
Grid.Column=
"2"
BackgroundColor=
"AntiqueWhite"
VerticalTextAlignment=
"Center"
HorizontalTextAlignment=
"Center"
></Label>
<Label
x:Name=
"label3"
Text=
"3"
Grid.Row=
"3"
Grid.Column=
"1"
BackgroundColor=
"LightYellow"
VerticalTextAlignment=
"Center"
HorizontalTextAlignment=
"Center"
></Label>
...
...
SampleApp/SampleApp/Views/Functionality22.xaml
View file @
6bd56c4e
<?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.Functionality22"
>
<ContentPage.Content>
<Label
Text=
"Not available on XAMARIN"
></Label>
</ContentPage.Content>
<StackLayout
VerticalOptions=
"Center"
HorizontalOptions=
"Center"
>
<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 pane button to check witch view is pane"
x:Name=
"label2"
HorizontalTextAlignment=
"Center"
></Label>
<Button
Text=
"Show header"
Clicked=
"Button_Clicked"
x:Name=
"button1"
></Button>
<Button
Text=
"Show pane"
Clicked=
"Button_Clicked1"
x:Name=
"button2"
></Button>
</StackLayout>
</ContentPage>
SampleApp/SampleApp/Views/Functionality22.xaml.cs
View file @
6bd56c4e
using
System
;
using
System.Collections.Generic
;
using
SampleApp.DependencyServices
;
using
Xamarin.Forms
;
namespace
SampleApp.Views
{
public
partial
class
Functionality22
:
ContentPage
{
IAccessibilityHeading
Heading
;
IAccessibilityPane
Pane
;
public
Functionality22
()
{
InitializeComponent
();
Heading
=
DependencyService
.
Get
<
IAccessibilityHeading
>();
Pane
=
DependencyService
.
Get
<
IAccessibilityPane
>();
if
(
Device
.
RuntimePlatform
==
Device
.
iOS
)
{
labelAv
.
Text
=
"NOT AVAILABLE ON iOS"
;
}
AutomationProperties
.
SetIsInAccessibleTree
(
label1
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
label2
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
button1
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
button2
,
true
);
}
//SHOW HEADER BUTTON CLICKED
void
Button_Clicked
(
System
.
Object
sender
,
System
.
EventArgs
e
)
{
if
(
Device
.
RuntimePlatform
==
Device
.
Android
)
{
if
(
Heading
.
CheckHeading
(
label1
))
{
string
labelValue
=
label1
.
Text
;
label1
.
Text
=
"HEADER"
;
//reset label value after 3 seconds
Device
.
StartTimer
(
TimeSpan
.
FromMilliseconds
(
3000.0
),
()
=>
{
label1
.
Text
=
labelValue
;
return
false
;
// runs again, or false to stop
});
}
}
}
//SHOW PANE BUTTON CLICKED
void
Button_Clicked1
(
System
.
Object
sender
,
System
.
EventArgs
e
)
{
if
(
Device
.
RuntimePlatform
==
Device
.
Android
)
{
if
(
Pane
.
CheckPane
(
label2
))
{
string
labelValue
=
label2
.
Text
;
label2
.
Text
=
"PANE"
;
//reset label value after 3 seconds
Device
.
StartTimer
(
TimeSpan
.
FromMilliseconds
(
3000.0
),
()
=>
{
label2
.
Text
=
labelValue
;
return
false
;
// runs again, or false to stop
});
}
}
}
protected
override
void
OnAppearing
()
{
base
.
OnAppearing
();
//only Android has this function
if
(
Device
.
RuntimePlatform
==
Device
.
Android
)
{
Heading
.
SetHeading
(
label1
);
Pane
.
SetPane
(
label2
,
"test"
);
}
}
}
}
SampleApp/SampleApp/Views/Functionality23.xaml
View file @
6bd56c4e
<?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.Content>
<Label
Text=
"Not available on XAMARIN"
></Label>
</ContentPage.Content>
<StackLayout
x:Name=
"background"
HorizontalOptions=
"Center"
VerticalOptions=
"Center"
>
</StackLayout>
</ContentPage>
SampleApp/SampleApp/Views/Functionality23.xaml.cs
View file @
6bd56c4e
using
System
;
using
System.Collections.Generic
;
using
SampleApp.CustomRenderers
;
using
Xamarin.Forms
;
...
...
@@ -7,9 +8,18 @@ namespace SampleApp.Views
{
public
partial
class
Functionality23
:
ContentPage
{
public
static
CustomView
customEditor
=
new
CustomView
{
Text
=
""
,
IsReadOnly
=
true
};
public
Functionality23
()
{
InitializeComponent
();
if
(
Device
.
RuntimePlatform
==
Device
.
Android
)
{
customEditor
.
Text
=
"NOT AVAILABLE ON Android"
;
}
AutomationProperties
.
SetIsInAccessibleTree
(
customEditor
,
true
);
background
.
Children
.
Add
(
customEditor
);
}
}
}
SampleApp/SampleApp/Views/Functionality5.xaml.cs
View file @
6bd56c4e
...
...
@@ -16,6 +16,8 @@ namespace SampleApp.Views
IIsFocused
dependency
;
bool
onView
=
true
;
public
Functionality5
()
{
InitializeComponent
();
...
...
@@ -27,33 +29,51 @@ namespace SampleApp.Views
background
.
Children
.
Add
(
labelYN
);
background
.
Children
.
Add
(
infoLabel
);
AutomationProperties
.
SetIsInAccessibleTree
(
label
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
labelYN
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
infoLabel
,
true
);
AutomationProperties
.
SetIsInAccessibleTree
(
bellImage
,
true
);
AutomationProperties
.
SetHelpText
(
bellImage
,
"Bell Image"
);
// timer che si ripete ogni 2 secondi
Device
.
StartTimer
(
TimeSpan
.
From
Milliseconds
(
2000
.0
),
()
=>
Device
.
StartTimer
(
TimeSpan
.
From
Seconds
(
2
.0
),
()
=>
{
Console
.
WriteLine
(
"TIMER FIRED"
);
Device
.
BeginInvokeOnMainThread
(()
=>
if
(
onView
)
{
if
(
dependency
.
isFocused
(
bellImage
))
{
Console
.
WriteLine
(
"is focused"
);
labelYN
.
TextColor
=
Color
.
Green
;
labelYN
.
Text
=
"YES"
;
}
else
Console
.
WriteLine
(
"TIMER FIRED"
);
Device
.
BeginInvokeOnMainThread
(()
=>
{
Console
.
WriteLine
(
"is NOT focused"
);
labelYN
.
TextColor
=
Color
.
Red
;
labelYN
.
Text
=
"NO"
;
}
});
return
true
;
// runs again, or false to stop
if
(
dependency
.
isFocused
(
bellImage
))
{
Console
.
WriteLine
(
"is focused"
);
labelYN
.
TextColor
=
Color
.
Green
;
labelYN
.
Text
=
"YES"
;
}
else
{
Console
.
WriteLine
(
"is NOT focused"
);
labelYN
.
TextColor
=
Color
.
Red
;
labelYN
.
Text
=
"NO"
;
}
});
return
true
;
// timer runs again
}
return
false
;
//timer stops
});
}
//stop the timer when view changes
protected
override
void
OnDisappearing
()
{
base
.
OnDisappearing
();
onView
=
false
;
}
}
}
SampleApp/SampleApp/Views/Functionality7.xaml
View file @
6bd56c4e
<?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.Functionality7"
>
<ContentPage.Content>
<Label
Text=
"PROVA 7"
></Label>
</ContentPage.Content>
</ContentPage>
SampleApp/SampleApp/Views/Functionality7.xaml.cs
View file @
6bd56c4e
...
...
@@ -10,6 +10,7 @@ namespace SampleApp.Views
public
Functionality7
()
{
InitializeComponent
();
}
}
}
SampleApp/SampleApp/Views/MainPage.xaml.cs
View file @
6bd56c4e
...
...
@@ -51,34 +51,41 @@ namespace SampleApp
await
Navigation
.
PushAsync
(
new
Functionality6
());
break
;
case
"7"
:
await
Navigation
.
PushAsync
(
new
Functionality7
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality7());
break
;
case
"8"
:
await
Navigation
.
PushAsync
(
new
Functionality8
());
break
;
case
"9"
:
await
Navigation
.
PushAsync
(
new
Functionality9
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality9());
break
;
case
"10"
:
await
Navigation
.
PushAsync
(
new
Functionality10
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality10());
break
;
case
"11"
:
await
Navigation
.
PushAsync
(
new
Functionality11
());
break
;
case
"12"
:
await
Navigation
.
PushAsync
(
new
Functionality12
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality12());
break
;
case
"13"
:
await
Navigation
.
PushAsync
(
new
Functionality13
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality13());
break
;
case
"14"
:
await
Navigation
.
PushAsync
(
new
Functionality14
());
break
;
case
"15"
:
await
Navigation
.
PushAsync
(
new
Functionality15
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality15());
break
;
case
"16"
:
await
Navigation
.
PushAsync
(
new
Functionality16
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality16());
break
;
case
"17"
:
await
Navigation
.
PushAsync
(
new
Functionality17
());
...
...
@@ -87,10 +94,12 @@ namespace SampleApp
await
Navigation
.
PushAsync
(
new
Functionality18
());
break
;
case
"19"
:
await
Navigation
.
PushAsync
(
new
Functionality19
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality19());
break
;
case
"20"
:
await
Navigation
.
PushAsync
(
new
Functionality20
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality20());
break
;
case
"21"
:
await
Navigation
.
PushAsync
(
new
Functionality21
());
...
...
@@ -102,7 +111,8 @@ namespace SampleApp
await
Navigation
.
PushAsync
(
new
Functionality23
());
break
;
case
"24"
:
await
Navigation
.
PushAsync
(
new
Functionality24
());
// TO IMPLEMENT
//await Navigation.PushAsync(new Functionality24());
break
;
}
...
...
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