From 351f40c901ee55a3afca65e126040e4b1325ea3f Mon Sep 17 00:00:00 2001 From: renpengfei Date: Mon, 24 May 2021 11:16:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0JavaDoc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../slice/MainAbilitySlice.java | 12 +++++++ .../ExampleOhosTest.java | 36 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/entry/src/main/java/com/glidebitmappoolsample/slice/MainAbilitySlice.java b/entry/src/main/java/com/glidebitmappoolsample/slice/MainAbilitySlice.java index 2ccadfa..ce83914 100644 --- a/entry/src/main/java/com/glidebitmappoolsample/slice/MainAbilitySlice.java +++ b/entry/src/main/java/com/glidebitmappoolsample/slice/MainAbilitySlice.java @@ -143,6 +143,9 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL }).start(); } + /** + * 资源优化缓存 + */ private void runResourceOptimized() { new Thread(new Runnable() { @Override @@ -176,6 +179,9 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL GlideBitmapPool.putBitmap(pixelMap10); } + /** + * 文件优化缓存 + */ private void runFileOptimized() { new Thread(new Runnable() { @Override @@ -197,6 +203,9 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL }).start(); } + /** + * 文件指定大小优化缓存 + */ private void runDownSample() { new Thread(new Runnable() { @Override @@ -219,6 +228,9 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL }).start(); } + /** + * 清除缓存 + */ private void clearMemory() { GlideBitmapPool.clearMemory(); HiLog.error(logLabel, "clearMemory"); diff --git a/entry/src/ohosTest/java/com/glidebitmappoolsample/ExampleOhosTest.java b/entry/src/ohosTest/java/com/glidebitmappoolsample/ExampleOhosTest.java index e1ccb5f..42c08fb 100644 --- a/entry/src/ohosTest/java/com/glidebitmappoolsample/ExampleOhosTest.java +++ b/entry/src/ohosTest/java/com/glidebitmappoolsample/ExampleOhosTest.java @@ -1,3 +1,18 @@ +/* + * 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 an 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. + */ + package com.glidebitmappoolsample; import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; @@ -9,12 +24,18 @@ import java.lang.reflect.Method; import static org.junit.Assert.assertEquals; public class ExampleOhosTest { + /** + * 包名test + */ @Test public void testBundleName() { final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); assertEquals("com.glidebitmappoolsample", actualBundleName); } + /** + * 正常资源回收机制test + */ @Test public void releaseBitmapMethod(){ try { @@ -35,6 +56,9 @@ public class ExampleOhosTest { } } + /** + * 普通文件回收机制test + */ @Test public void runNormalFile(){ try { @@ -55,6 +79,9 @@ public class ExampleOhosTest { } } + /** + * 资源优化缓存test + */ @Test public void runResourceOptimized(){ try { @@ -75,6 +102,9 @@ public class ExampleOhosTest { } } + /** + * 文件优化缓存test + */ @Test public void runFileOptimized(){ try { @@ -95,6 +125,9 @@ public class ExampleOhosTest { } } + /** + * 文件指定大小优化缓存test + */ @Test public void runDownSample(){ try { @@ -115,6 +148,9 @@ public class ExampleOhosTest { } } + /** + * 清除缓存test + */ @Test public void clearMemory(){ try { -- Gitee From c116385debeb9fdd1d00cce79bf3c772ba9dab7c Mon Sep 17 00:00:00 2001 From: renpengfei Date: Mon, 24 May 2021 11:23:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9Readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 8110f38..9637eda 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Glide Bitmap Pool -**本项目是基于开源项目Glide Bitmap Pool进行openharmony的移植和开发的,可以通过项目标签以及github地址 ( https://github.com/Sunzxyong/GlideBitmapPool ) 追踪到原项目版本** - ## 项目介绍 - 项目名称:GlideBitmapPool工具类 @@ -11,10 +9,6 @@ - 调用差异:openharmony与原库内存展示有差异 - 基线版本:release 0.0.1 - 开发版本:sdk5,DevEco Studio2.1 beta4 -- 原项目Doc地址: - -## 项目介绍 - - 编程语言:Java ## 安装教程 -- Gitee