Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
26010cf4
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
26010cf4
编写于
1月 02, 2018
作者:
M
Michael Goderbauer
提交者:
GitHub
1月 02, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add SemanticsFlag.isDisabled (#4503)
上级
37789650
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
2 deletion
+21
-2
lib/ui/semantics.dart
lib/ui/semantics.dart
+14
-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
+3
-2
shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm
...tform/darwin/ios/framework/Source/accessibility_bridge.mm
+3
-0
未找到文件。
lib/ui/semantics.dart
浏览文件 @
26010cf4
...
...
@@ -145,6 +145,7 @@ class SemanticsFlags {
static
const
int
_kIsButtonIndex
=
1
<<
3
;
static
const
int
_kIsTextFieldIndex
=
1
<<
4
;
static
const
int
_kIsFocusedIndex
=
1
<<
5
;
static
const
int
_kIsDisabledIndex
=
1
<<
6
;
const
SemanticsFlags
.
_
(
this
.
index
);
...
...
@@ -193,6 +194,16 @@ class SemanticsFlags {
/// The focused element is usually the current receiver of keyboard inputs.
static
const
SemanticsFlags
isFocused
=
const
SemanticsFlags
.
_
(
_kIsFocusedIndex
);
/// Whether the semantic node is currently disabled.
///
/// A disabled element does not respond to user interaction. For example, a
/// button that currently does not respond to user interaction should be
/// marked as disabled.
///
/// Elements, that never respond to user interactions (e.g. static text)
/// should not be marked as disabled.
static
const
SemanticsFlags
isDisabled
=
const
SemanticsFlags
.
_
(
_kIsDisabledIndex
);
/// The possible semantics flags.
///
/// The map's key is the [index] of the flag and the value is the flag itself.
...
...
@@ -203,6 +214,7 @@ class SemanticsFlags {
_kIsButtonIndex:
isButton
,
_kIsTextFieldIndex:
isTextField
,
_kIsFocusedIndex:
isFocused
,
_kIsDisabledIndex:
isDisabled
,
};
@override
...
...
@@ -220,6 +232,8 @@ class SemanticsFlags {
return
'SemanticsFlags.isTextField'
;
case
_kIsFocusedIndex:
return
'SemanticsFlags.isFocused'
;
case
_kIsDisabledIndex:
return
'SemanticsFlags.isDisabled'
;
}
return
null
;
}
...
...
lib/ui/semantics/semantics_node.h
浏览文件 @
26010cf4
...
...
@@ -41,6 +41,7 @@ enum class SemanticsFlags : int32_t {
kIsButton
=
1
<<
3
,
kIsTextField
=
1
<<
4
,
kIsFocused
=
1
<<
5
,
kIsDisabled
=
1
<<
6
,
};
struct
SemanticsNode
{
...
...
shell/platform/android/io/flutter/view/AccessibilityBridge.java
浏览文件 @
26010cf4
...
...
@@ -65,7 +65,8 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess
IS_SELECTED
(
1
<<
2
),
IS_BUTTON
(
1
<<
3
),
IS_TEXT_FIELD
(
1
<<
4
),
IS_FOCUSED
(
1
<<
5
);
IS_FOCUSED
(
1
<<
5
),
IS_DISABLED
(
1
<<
6
);
Flag
(
int
value
)
{
this
.
value
=
value
;
...
...
@@ -157,7 +158,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess
}
result
.
setBoundsInScreen
(
bounds
);
result
.
setVisibleToUser
(
true
);
result
.
setEnabled
(
true
);
// TODO(ianh): Expose disabled subtrees
result
.
setEnabled
(
!
object
.
hasFlag
(
Flag
.
IS_DISABLED
));
if
(
object
.
hasAction
(
Action
.
TAP
))
{
result
.
addAction
(
AccessibilityNodeInfo
.
ACTION_CLICK
);
...
...
shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm
浏览文件 @
26010cf4
...
...
@@ -194,6 +194,9 @@ bool GeometryComparator(SemanticsObject* a, SemanticsObject* b) {
if
(
_node
.
HasFlag
(
blink
::
SemanticsFlags
::
kIsButton
))
{
traits
|=
UIAccessibilityTraitButton
;
}
if
(
_node
.
HasFlag
(
blink
::
SemanticsFlags
::
kIsDisabled
))
{
traits
|=
UIAccessibilityTraitNotEnabled
;
}
return
traits
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录