Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
a41d63bb
G
Graphic Ui
项目概览
OpenHarmony
/
Graphic Ui
大约 1 年 前同步成功
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Graphic Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a41d63bb
编写于
4月 01, 2021
作者:
Y
YueBiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix codestyle bugs
上级
97a5cc07
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
19 addition
and
18 deletion
+19
-18
frameworks/components/ui_slider.cpp
frameworks/components/ui_slider.cpp
+8
-4
frameworks/components/ui_swipe_view.cpp
frameworks/components/ui_swipe_view.cpp
+9
-12
test/uitest/test_rotate_input/ui_test_rotate_input.cpp
test/uitest/test_rotate_input/ui_test_rotate_input.cpp
+2
-2
未找到文件。
frameworks/components/ui_slider.cpp
浏览文件 @
a41d63bb
...
...
@@ -220,7 +220,8 @@ void UISlider::DrawForeground(const Rect& invalidatedArea, Rect& coords)
switch
(
direction_
)
{
case
Direction
::
DIR_LEFT_TO_RIGHT
:
{
length
=
GetCurrentPos
(
progressWidth_
-
1
);
coords
.
SetRect
(
startPoint
.
x
,
startPoint
.
y
,
startPoint
.
x
+
progressWidth
-
1
,
startPoint
.
y
+
progressHeight_
-
1
);
coords
.
SetRect
(
startPoint
.
x
,
startPoint
.
y
,
startPoint
.
x
+
progressWidth
-
1
,
startPoint
.
y
+
progressHeight_
-
1
);
left
=
startPoint
.
x
-
radius
-
1
;
right
=
left
+
length
;
...
...
@@ -229,7 +230,8 @@ void UISlider::DrawForeground(const Rect& invalidatedArea, Rect& coords)
}
case
Direction
::
DIR_RIGHT_TO_LEFT
:
{
length
=
GetCurrentPos
(
progressWidth_
-
1
);
coords
.
SetRect
(
startPoint
.
x
,
startPoint
.
y
,
startPoint
.
x
+
progressWidth
-
1
,
startPoint
.
y
+
progressHeight_
-
1
);
coords
.
SetRect
(
startPoint
.
x
,
startPoint
.
y
,
startPoint
.
x
+
progressWidth
-
1
,
startPoint
.
y
+
progressHeight_
-
1
);
right
=
startPoint
.
x
+
progressWidth
+
radius
+
1
;
left
=
right
-
length
;
...
...
@@ -238,7 +240,8 @@ void UISlider::DrawForeground(const Rect& invalidatedArea, Rect& coords)
}
case
Direction
::
DIR_TOP_TO_BOTTOM
:
{
length
=
GetCurrentPos
(
progressHeight_
-
1
);
coords
.
SetRect
(
startPoint
.
x
,
startPoint
.
y
,
startPoint
.
x
+
progressWidth_
-
1
,
startPoint
.
y
+
progressHeight
-
1
);
coords
.
SetRect
(
startPoint
.
x
,
startPoint
.
y
,
startPoint
.
x
+
progressWidth_
-
1
,
startPoint
.
y
+
progressHeight
-
1
);
top
=
startPoint
.
y
-
radius
+
1
;
bottom
=
top
+
length
;
...
...
@@ -247,7 +250,8 @@ void UISlider::DrawForeground(const Rect& invalidatedArea, Rect& coords)
}
case
Direction
::
DIR_BOTTOM_TO_TOP
:
{
length
=
GetCurrentPos
(
progressHeight_
-
1
);
coords
.
SetRect
(
startPoint
.
x
,
startPoint
.
y
,
startPoint
.
x
+
progressWidth_
-
1
,
startPoint
.
y
+
progressHeight
-
1
);
coords
.
SetRect
(
startPoint
.
x
,
startPoint
.
y
,
startPoint
.
x
+
progressWidth_
-
1
,
startPoint
.
y
+
progressHeight
-
1
);
bottom
=
startPoint
.
y
+
progressHeight
+
radius
+
1
;
top
=
bottom
-
length
;
...
...
frameworks/components/ui_swipe_view.cpp
浏览文件 @
a41d63bb
...
...
@@ -18,11 +18,7 @@
namespace
OHOS
{
UISwipeView
::
UISwipeView
(
uint8_t
direction
)
:
swipeListener_
(
nullptr
),
curIndex_
(
0
),
blankSize_
(
DEFAULT_BLANK_SIZE
),
curView_
(
nullptr
),
loop_
(
false
)
:
swipeListener_
(
nullptr
),
curIndex_
(
0
),
blankSize_
(
DEFAULT_BLANK_SIZE
),
curView_
(
nullptr
),
loop_
(
false
)
{
#if ENABLE_ROTATE_INPUT
rotateFactor_
=
1
;
...
...
@@ -177,7 +173,7 @@ bool UISwipeView::OnRotateEvent(const RotateEvent& event)
return
UIView
::
OnRotateEvent
(
event
);
}
if
(
event
.
GetRotate
()
!=
0
)
{
int8_t
sign
=
rotateFactor_
<
0
?
-
1
:
1
;
int8_t
sign
=
(
rotateFactor_
<
0
)
?
-
1
:
1
;
// 4 : need to fit for the device
if
(
MATH_ABS
(
event
.
GetRotate
())
>
blankSize_
/
(
4
*
static_cast
<
uint16_t
>
(
MATH_ABS
(
rotateFactor_
))))
{
SwitchToPage
(
curIndex_
-
sign
*
event
.
GetRotate
());
...
...
@@ -306,8 +302,9 @@ void UISwipeView::SortChild()
loop_
=
tmpLoop
;
}
void
UISwipeView
::
RefreshCurrentViewInner
(
int16_t
distance
,
int16_t
(
UIView
::*
pfnGetXOrY
)()
const
,
int16_t
(
UIView
::*
pfnGetWidthOrHeight
)())
void
UISwipeView
::
RefreshCurrentViewInner
(
int16_t
distance
,
int16_t
(
UIView
::*
pfnGetXOrY
)()
const
,
int16_t
(
UIView
::*
pfnGetWidthOrHeight
)())
{
if
(
childrenHead_
==
nullptr
)
{
curIndex_
=
0
;
...
...
@@ -356,8 +353,8 @@ void UISwipeView::RefreshCurrentViewInner(int16_t distance, int16_t (UIView::*pf
* that is, the x or y coordinate plus 7/10 width or height.
*/
if
(((
curView_
->*
pfnGetXOrY
)()
+
((
curView_
->*
pfnGetWidthOrHeight
)()
>>
1
)
<
swipeMid
)
&&
((
curView_
->*
pfnGetXOrY
)()
+
((
curView_
->*
pfnGetWidthOrHeight
)()
*
7
/
10
)
-
accelerationOffset
<
swipeMid
))
{
((
curView_
->*
pfnGetXOrY
)()
+
((
curView_
->*
pfnGetWidthOrHeight
)()
*
7
/
10
)
-
accelerationOffset
<
swipeMid
))
{
curIndex_
++
;
}
}
else
if
(
distance
>
0
)
{
...
...
@@ -366,8 +363,8 @@ void UISwipeView::RefreshCurrentViewInner(int16_t distance, int16_t (UIView::*pf
* that is, the x or y coordinate plus 3/10 width or height.
*/
if
(((
curView_
->*
pfnGetXOrY
)()
+
((
curView_
->*
pfnGetWidthOrHeight
)()
>>
1
)
>
swipeMid
)
&&
((
curView_
->*
pfnGetXOrY
)()
+
((
curView_
->*
pfnGetWidthOrHeight
)()
*
3
/
10
)
+
accelerationOffset
>
swipeMid
))
{
((
curView_
->*
pfnGetXOrY
)()
+
((
curView_
->*
pfnGetWidthOrHeight
)()
*
3
/
10
)
+
accelerationOffset
>
swipeMid
))
{
curIndex_
--
;
}
}
else
{
...
...
test/uitest/test_rotate_input/ui_test_rotate_input.cpp
浏览文件 @
a41d63bb
...
...
@@ -37,7 +37,7 @@ static int16_t g_sliderW = 40;
static
int16_t
g_sliderH
=
300
;
static
int16_t
g_testButtonW
=
80
;
static
int16_t
g_testButtonH
=
40
;
static
const
char
*
g_pickerRange
[]
=
{
"A0"
,
"B1"
,
"C2"
,
"D3"
,
"E4"
,
"F5"
,
"G6"
,
"H7"
,
"I8"
,
"J9"
,
"K10"
,
"L11"
};
static
const
char
*
g_pickerRange
[]
=
{
"A0"
,
"B1"
,
"C2"
,
"D3"
,
"E4"
,
"F5"
,
"G6"
,
"H7"
,
"I8"
,
"J9"
,
"K10"
,
"L11"
};
#if ENABLE_MOTOR
void
Print
(
MotorType
motorType
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录