Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
1787c3fb
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1787c3fb
编写于
6月 09, 2017
作者:
M
Michael Goderbauer
提交者:
GitHub
6月 09, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adding SemanticsFlag.isSelected (#3764)
* Adding SemanticsFlag.isSelected * typo
上级
b91d2f1b
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
20 addition
and
0 deletion
+20
-0
lib/ui/semantics.dart
lib/ui/semantics.dart
+13
-0
lib/ui/semantics/semantics_node.h
lib/ui/semantics/semantics_node.h
+1
-0
shell/platform/android/io/flutter/view/AccessibilityBridge.java
...platform/android/io/flutter/view/AccessibilityBridge.java
+2
-0
shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm
...tform/darwin/ios/framework/Source/accessibility_bridge.mm
+4
-0
未找到文件。
lib/ui/semantics.dart
浏览文件 @
1787c3fb
...
...
@@ -112,6 +112,7 @@ class SemanticsAction {
class
SemanticsFlags
{
static
const
int
_kHasCheckedStateIndex
=
1
<<
0
;
static
const
int
_kIsCheckedIndex
=
1
<<
1
;
static
const
int
_kIsSelectedIndex
=
1
<<
2
;
const
SemanticsFlags
.
_
(
this
.
index
);
...
...
@@ -133,12 +134,22 @@ class SemanticsFlags {
/// For example, if a checkbox has a visible checkmark, [isChecked] is true.
static
const
SemanticsFlags
isChecked
=
const
SemanticsFlags
.
_
(
_kIsCheckedIndex
);
/// Whether a semantics node is selected.
///
/// If true, the semantics node is "selected". If false, the semantics node is
/// "unselected".
///
/// For example, the active tab in a tab bar has [isSelected] set to true.
static
const
SemanticsFlags
isSelected
=
const
SemanticsFlags
.
_
(
_kIsSelectedIndex
);
/// The possible semantics flags.
///
/// The map's key is the [index] of the flag and the value is the flag itself.
static
final
Map
<
int
,
SemanticsFlags
>
values
=
const
<
int
,
SemanticsFlags
>{
_kHasCheckedStateIndex:
hasCheckedState
,
_kIsCheckedIndex:
isChecked
,
_kIsSelectedIndex:
isSelected
,
};
@override
...
...
@@ -148,6 +159,8 @@ class SemanticsFlags {
return
'SemanticsFlags.hasCheckedState'
;
case
_kIsCheckedIndex:
return
'SemanticsFlags.isChecked'
;
case
_kIsSelectedIndex:
return
'SemanticsFlags.isSelected'
;
}
return
null
;
}
...
...
lib/ui/semantics/semantics_node.h
浏览文件 @
1787c3fb
...
...
@@ -31,6 +31,7 @@ enum class SemanticsAction : int32_t {
enum
class
SemanticsFlags
:
int32_t
{
kHasCheckedState
=
1
<<
0
,
kIsChecked
=
1
<<
1
,
kIsSelected
=
1
<<
2
,
};
struct
SemanticsNode
{
...
...
shell/platform/android/io/flutter/view/AccessibilityBridge.java
浏览文件 @
1787c3fb
...
...
@@ -48,6 +48,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider {
private
static
final
int
SEMANTICS_FLAG_HAS_CHECKED_STATE
=
1
<<
0
;
private
static
final
int
SEMANTICS_FLAG_IS_CHECKED
=
1
<<
1
;
private
static
final
int
SEMANTICS_FLAG_IS_SELECTED
=
1
<<
2
;
AccessibilityBridge
(
FlutterView
owner
)
{
assert
owner
!=
null
;
...
...
@@ -119,6 +120,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider {
result
.
setCheckable
((
object
.
flags
&
SEMANTICS_FLAG_HAS_CHECKED_STATE
)
!=
0
);
result
.
setChecked
((
object
.
flags
&
SEMANTICS_FLAG_IS_CHECKED
)
!=
0
);
result
.
setSelected
((
object
.
flags
&
SEMANTICS_FLAG_IS_SELECTED
)
!=
0
);
result
.
setText
(
object
.
label
);
// TODO(ianh): use setTraversalBefore/setTraversalAfter to set
...
...
shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm
浏览文件 @
1787c3fb
...
...
@@ -116,6 +116,10 @@ blink::SemanticsAction GetSemanticsActionForScrollDirection(
_node
.
HasAction
(
blink
::
SemanticsAction
::
kDecrease
))
{
traits
|=
UIAccessibilityTraitAdjustable
;
}
if
(
_node
.
HasFlag
(
blink
::
SemanticsFlags
::
kIsSelected
)
||
_node
.
HasFlag
(
blink
::
SemanticsFlags
::
kIsChecked
))
{
traits
|=
UIAccessibilityTraitSelected
;
}
return
traits
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录