提交 d9644328 编写于 作者: Z zhangrao

delete animator

Signed-off-by: Nzhangrao <zhangrao@huawei.com>
上级 e33e2fff
......@@ -154,7 +154,6 @@
"pages/stateStyle",
"pages/focus",
"pages/placement",
"pages/animator",
"pages/imageAnimator",
"pages/animationStatus",
"pages/sourceType",
......
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Curves from '@ohos.curves';
@Entry
@Component
struct AnimatorTest {
@State valueX: number = 0;
@State valueY: number = 0;
@State valueW: number = 100;
@State valueH: number = 100;
@State valueS: AnimationStatus = AnimationStatus.Initial;
private curve1 = Curves.init(Curve.EaseIn);
private curve2 = Curves.init(Curve.EaseOut);
private curve3 = Curves.cubicBezier(0.1, 0.0, 0.1, 1.0);
private curve4 = Curves.spring(100, 1, 228, 30);
build() {
Column() {
Text('自定义动画')
.position({ x: this.valueX, y: this.valueY })
.size({ width: this.valueW, height: this.valueH })
.fontSize(20)
Animator('id')
.duration(1000)
.state(this.valueS)
.key('animator')
.curve(Curve.EaseOut)
.fillMode(FillMode.Backwards)
.iterations(0)
.motion(SpringMotion.apply())
.onFrame((value: number) => {
console.log("animator onFrame init")
this.valueX = 100 * this.curve1.interpolate(value)
this.valueY = 100 * this.curve2.interpolate(value)
this.valueW = 100 * this.curve3.interpolate(value)
this.valueH = 100 * this.curve4.interpolate(value)
})
.onRepeat(() => {
console.log("animator repeat init")
})
Row() {
Button('Running')
.onClick(() => {
this.valueS = AnimationStatus.Running
})
Button('Paused')
.onClick(() => {
this.valueS = AnimationStatus.Paused
})
Button('Stopped')
.onClick(() => {
this.valueS = AnimationStatus.Stopped
})
Button('Initial')
.onClick(() => {
this.valueS = AnimationStatus.Initial
})
}
}
}
}
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils';
export default function animatorJsunit() {
describe('animatorTest', function () {
beforeEach(async function (done) {
console.info('beforeEach ===================animator test beforeEach called===================');
let options = {
uri: 'pages/animator',
}
try {
router.clear();
let pages = router.getState();
console.info('beforeEach get prompt state pages:' + JSON.stringify(pages));
if (!('animator' == pages.name)) {
console.info('beforeEach get prompt state pages.name:' + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info('beforeEach push prompt page result:' + JSON.stringify(result));
}
} catch (err) {
console.error('beforeEach push prompt page error:' + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info('[ afterEach ] ===================animator test after each called===================');
});
it('testAnimator01', 0, async function (done) {
console.info('[testAnimator01] START');
await Utils.sleep(1000);
let strJson = getInspectorByKey('animator');
let obj = JSON.parse(strJson);
console.info("[testAnimator01] component obj is: " + JSON.stringify(obj));
expect(obj.$type).assertEqual('Animator');
done();
});
})
}
......@@ -94,7 +94,6 @@ import rowJsunit from './RowJsunit.test.ets';
import scrollBarJsunit from './ScrollBarJsunit.test.ets';
import searchJsunit from './SearchJsunit.test.ets';
import placementJsunit from './PlacementJsunit.test.ets';
import animatorJsunit from './AnimatorJsunit.test.ets';
import imageAnimatorJsunit from './ImageAnimatorJsunit.test.ets'
import animationStatusJsunit from './AnimationStatusJsunit.test.ets';
import curvesJsunit from './CurvesJsunit.test.ets';
......@@ -218,7 +217,6 @@ export default function testsuite() {
searchJsunit();
scrollBarJsunit();
placementJsunit();
animatorJsunit();
imageAnimatorJsunit();
animationStatusJsunit();
curvesJsunit();
......@@ -261,4 +259,4 @@ export default function testsuite() {
PanDirectionJsunit();
sideBarJsunit();
systemAppJsunit(); //此测试文件会终止APP运行,提代码请将文件放在此文件之前
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册