forked from floraachy/ImageKnife
128 lines
3.0 KiB
Plaintext
128 lines
3.0 KiB
Plaintext
/*
|
|
* Copyright (C) 2024 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 router from '@system.router';
|
|
|
|
@Entry
|
|
@Component
|
|
struct Index {
|
|
|
|
|
|
aboutToAppear(): void {
|
|
|
|
}
|
|
|
|
build() {
|
|
|
|
Column() {
|
|
Button("测试HSP场景预加载").onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/TestHspPreLoadImage',
|
|
|
|
});
|
|
})
|
|
Button("单个图片使用").onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/SingleImage',
|
|
|
|
});
|
|
})
|
|
Button("多图 + LazyForEach").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/ManyPhotoShowPage',
|
|
|
|
});
|
|
})
|
|
Button("多图 + reuse + LazyForeach").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/UserPage',
|
|
|
|
});
|
|
})
|
|
Button("长图显示").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/LongImagePage',
|
|
|
|
});
|
|
})
|
|
Button("缩放图片").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/TransformPage',
|
|
|
|
});
|
|
})
|
|
Button("消息+List").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/TestImageFlash',
|
|
|
|
});
|
|
})
|
|
Button("自定义缓存key").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/SignatureTestPage',
|
|
|
|
});
|
|
})
|
|
Button("预加载图片到文件缓存").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/TestPrefetchToFileCache',
|
|
|
|
});
|
|
})
|
|
Button("从缓存获取图片显示").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/TestIsUrlExist',
|
|
|
|
});
|
|
})
|
|
Button("测试单个请求头").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/TestHeader',
|
|
|
|
});
|
|
})
|
|
Button("测试写入缓存策略").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/TestWriteCacheStage',
|
|
|
|
});
|
|
})
|
|
Button("图片变换").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/ImageTransformation',
|
|
|
|
});
|
|
|
|
})
|
|
|
|
Button("不同的ObjectFit").margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/ObjectFitPage',
|
|
|
|
});
|
|
|
|
})
|
|
|
|
Button('测试图片加载成功/失败事件').margin({top:10}).onClick(()=>{
|
|
router.push({
|
|
uri: 'pages/LoadStatePage',
|
|
})
|
|
})
|
|
|
|
}
|
|
.width('100%')
|
|
|
|
.height('100%')
|
|
}
|
|
} |