Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
130ddd7e
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
130ddd7e
编写于
7月 31, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 31, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9599 【ACE子系统】cherrypick OpenHarmony-4.0-Beta2
Merge pull request !9599 from hekun/cherry-pick-1690633312
上级
3c21cc5a
313653dc
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
105 addition
and
33 deletion
+105
-33
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/BlurStyle.ets
...ent_ui/entry/src/main/ets/MainAbility/pages/BlurStyle.ets
+8
-0
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/CanvasRenderer.ets
...i/entry/src/main/ets/MainAbility/pages/CanvasRenderer.ets
+38
-6
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/ClickMouseTouchEvent.ets
...y/src/main/ets/MainAbility/pages/ClickMouseTouchEvent.ets
+6
-1
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragEvent.ets
...ent_ui/entry/src/main/ets/MainAbility/pages/DragEvent.ets
+36
-1
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/EntryOptions.ets
..._ui/entry/src/main/ets/MainAbility/pages/EntryOptions.ets
+2
-15
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/ModalTransition.ets
.../entry/src/main/ets/MainAbility/pages/ModalTransition.ets
+10
-2
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/TransitionEffect.ets
...entry/src/main/ets/MainAbility/pages/TransitionEffect.ets
+5
-8
未找到文件。
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/BlurStyle.ets
浏览文件 @
130ddd7e
...
...
@@ -27,6 +27,14 @@ struct BlurStyle1 {
.backgroundBlurStyle(BlurStyle.BACKGROUND_THICK)
Text("BlurStyle.BACKGROUND_ULTRA_THICK").margin(5).id("BACKGROUND_ULTRA_THICK")
.backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
Column({ space: 100 }) {
// 绘制一个直径为150的圆,默认填充色为黑色
Circle({ width: 150, height: 200 })
// 绘制一个直径为150的圆,
Circle({ width: 150, height: 200 })
.backgroundColor(Color.White)
.foregroundColor(ColoringStrategy.INVERT)
}.width('100%').backgroundColor(Color.Blue)
}.width('90%').height("90%")
}
}
\ No newline at end of file
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/CanvasRenderer.ets
浏览文件 @
130ddd7e
...
...
@@ -16,22 +16,54 @@
@Entry
@Component
struct CanvasRenderer1 {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private settings: RenderingContextSettings = new RenderingContextSettings(true)
;
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
;
private offCanvas: OffscreenCanvas = new OffscreenCanvas(600, 600)
private img:ImageBitmap = new ImageBitmap("resource/media/icon.png");
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context)
// .imageSmooththingQuality(ImageSmooththingQuality.high)
.width('100%')
.height('100%')
.backgroundColor('#ffff00')
.onReady(() =>{
this.offCanvas
var offContext = this.offCanvas.getContext("2d", this.settings)
offContext.fillStyle = 0x0000FF
offContext.fillRect(20, 20, 150, 100)
let offctx = offContext
offctx.imageSmoothingEnabled = true
offctx.imageSmoothingQuality = 'high'
offctx.drawImage(this.img, 0, 0, 400, 200)
var image = this.offCanvas.transferToImageBitmap()
this.context.transferFromImageBitmap(image)
})
Canvas(this.context)
.width('100%')
.height('100%')
.backgroundColor('#ffff00')
.onReady(() =>{
var offContext = this.offCanvas.getContext("2d", this.settings)
let offctx = offContext
offctx.imageSmoothingEnabled = true
offctx.imageSmoothingQuality = 'medium'
offctx.drawImage(this.img, 0, 300, 400, 500)
var image = this.offCanvas.transferToImageBitmap()
this.context.transferFromImageBitmap(image)
})
Canvas(this.context)
.width('100%')
.height('100%')
.backgroundColor('#ffff00')
.onReady(() =>{
var offContext = this.offCanvas.getContext("2d", this.settings)
let offctx = offContext
offctx.imageSmoothingEnabled = true
offctx.imageSmoothingQuality = 'low'
offctx.drawImage(this.img, 0, 600, 400, 800)
var image = this.offCanvas.transferToImageBitmap()
this.context.transferFromImageBitmap(image)
})
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/ClickMouseTouchEvent.ets
浏览文件 @
130ddd7e
...
...
@@ -12,6 +12,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function Rect1(x, y, z){
return {width: x, height: y, radios: z}
}
@Entry
@Component
...
...
@@ -24,12 +27,14 @@ struct ClickExample {
build() {
Column() {
Rect(Rect1(200, 80, 1)).margin(10)
Text(this.displayX).id("displayX")
Text(this.displayY).id("displayY")
Text(this.windowX).id("windowX")
Text(this.windowY).id("windowY")
Text(this.intentionCode).id("intentionCode")
Row({ space: 20 }) {
Button('Click').width(100).height(40).id("Button_click")
.onClick((event: ClickEvent) => {
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/DragEvent.ets
浏览文件 @
130ddd7e
...
...
@@ -12,9 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import dragController from "@ohos.arkui.dragController"
import UDMF from '@ohos.data.UDMF'
import promptAction from '@ohos.promptAction';
import promptAction from '@ohos.promptAction';
@Entry
@Component
struct DragEvent {
...
...
@@ -31,6 +33,14 @@ struct DragEvent {
@State useCustomDropAnimation1: string = "useCustomDropAnimation";
@State imgState: Visibility = Visibility.Visible;
@Builder DraggingBuilder() {
Column() {
Text("DraggingBuilder")
}
.width(100)
.height(100)
.backgroundColor(Color.Blue)
}
build() {
Row() {
...
...
@@ -38,6 +48,7 @@ struct DragEvent {
Text(this.dragBehavior).id("dragBehavior").margin(5)
Text(this.dragRet).id("dragRet").margin(5)
Text(this.useCustomDropAnimation1).id("useCustomDropAnimation").margin(5)
Image($r('app.media.icon')).margin(5)
.width(100)
.height(100)
...
...
@@ -45,7 +56,9 @@ struct DragEvent {
.margin({left: 15})
.visibility(this.imgState)
.onDragStart((event)=>{
event.dragBehavior = DragBehavior.COPY
event.setResult(DragRet.DRAG_SUCCESS);
})
.onDragEnd((event)=>{
event.dragBehavior = DragBehavior.MOVE
...
...
@@ -63,9 +76,31 @@ struct DragEvent {
promptAction.showToast({duration: 100, message: 'Drag Canceled'});
} else if (event.getResult() === DragRet.DROP_DISABLED) {
promptAction.showToast({duration: 100, message: 'Drop Disabled'});
}else if (event.getResult() === DragRet.DROP_ENABLED) {
promptAction.showToast({duration: 100, message: 'Drop Enabled'});
}
this.dragRet = event.getResult().toString()
})
Button('touch to execute drag')
.onTouch((event) => {
if (event.type == TouchType.Down) {
let text = new UDMF.Text()
let unifiedData = new UDMF.UnifiedData(text)
let dragInfo: dragController.DragInfo = {
pointerId: 0,
data: unifiedData,
extraParams: ''
}
dragController.executeDrag(this.DraggingBuilder.bind(this), dragInfo, (err, {event, extraParams}) => {
if (event.getResult() == DragRet.DRAG_SUCCESS) {
// ...
} else if (event.getResult() == DragRet.DRAG_FAILED) {
// ...
}
})
}
})
}.width('90%')
.height('100%')
.margin({left: '5%'})
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/EntryOptions.ets
浏览文件 @
130ddd7e
...
...
@@ -14,8 +14,9 @@
*/
@Entry({ routeName : 'ApiRect' })
@Component
struct
Hello
Component {
struct
My
Component {
@State message: string = 'Hello, World!';
build() {
...
...
@@ -28,18 +29,4 @@ struct HelloComponent {
})
}
}
}
@Entry
@Component
struct myPage {
build() {
Column() {
Text('ArkUI message')
HelloComponent({ message: 'Hello, World!' });
Divider()
HelloComponent({ message: '你好!' });
}
}
}
\ No newline at end of file
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/ModalTransition.ets
浏览文件 @
130ddd7e
...
...
@@ -15,7 +15,7 @@
@Entry
@Component
struct ModalTransition1 {
struct ModalTransition1
1
{
@State isShow:boolean = false
@State isShow2:boolean = false
...
...
@@ -41,7 +41,7 @@ struct ModalTransition1 {
.fontSize(20)
.onClick(()=>{
this.isShow2 = true;
}).bindContentCover(this.isShow2, this.myBuilder2(), {modalTransition: ModalTransition.
ALPHA
, backgroundColor: Color.Gray, onAppear: () => {console.log("BindContentCover onAppear.")}, onDisappear: () => {console.log("BindContentCover onDisappear.")}})
}).bindContentCover(this.isShow2, this.myBuilder2(), {modalTransition: ModalTransition.
NONE
, backgroundColor: Color.Gray, onAppear: () => {console.log("BindContentCover onAppear.")}, onDisappear: () => {console.log("BindContentCover onDisappear.")}})
Button("close modal 1")
.margin(10)
...
...
@@ -64,6 +64,14 @@ struct ModalTransition1 {
.fontSize(20)
.margin(10)
.bindContentCover($$this.isShow, this.myBuilder(), {modalTransition: ModalTransition.ALPHA, backgroundColor: Color.Pink, onAppear: () => {console.log("BindContentCover onAppear.")}, onDisappear: () => {console.log("BindContentCover onDisappear.")}})
Button("transition modal 3")
.onClick(() => {
this.isShow = true
})
.fontSize(20)
.margin(10)
.bindContentCover($$this.isShow, this.myBuilder(), {modalTransition: ModalTransition.DEFAULT, backgroundColor: Color.Pink, onAppear: () => {console.log("BindContentCover onAppear.")}, onDisappear: () => {console.log("BindContentCover onDisappear.")}})
}
.justifyContent(FlexAlign.Center)
.backgroundColor(Color.White)
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/TransitionEffect.ets
浏览文件 @
130ddd7e
...
...
@@ -43,22 +43,19 @@ struct TransitionEffectExample1 {
}else{
Image($r('app.media.icon')).width(200).height(200)
.transition(TransitionEffect.IDENTITY
.animation({ duration: 2000, curve: Curve.Ease }).combine(
TransitionEffect.rotate({ z: 1, centerZ: 1, angle: 180 })
))
}
Image($r('app.media.icon')).width(200).height(200)
.transition(
TransitionEffect.SLIDE
.animation({ duration: 2000, curve: Curve.Ease })
.combine(
TransitionEffect.rotate({ z: 1, centerZ: 1, angle: 180 })
TransitionEffect.asymmetric(
TransitionEffect.rotate({ z: 1, centerZ: 1, angle: 180 }),
TransitionEffect.rotate({ z: 1, centerZ: 1, angle: 90 })
)
// .asymmetric({
// appear: TransitionEffect,
// disappear: TransitionEffect })
)
Image($r('app.media.icon')).width(200).height(200)
.transition(TransitionEffect.SLIDE_SWITCH)
}.width('100%')
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录