From 327c8efcba87d7de724b5b4dd4cdaf93c3b1efb0 Mon Sep 17 00:00:00 2001 From: xujianhong Date: Thu, 8 Jul 2021 14:58:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ufreedom/floatingview/Floating.java | 45 +------------------ .../ufreedom/floatingview/util/LogUtil.java | 2 +- .../ufreedom/floatingview/ExampleTest.java | 2 +- .../java/com/ufreedom/demo/MainAbility.java | 2 +- .../java/com/ufreedom/demo/MyApplication.java | 2 +- .../main/java/com/ufreedom/demo/UiUtils.java | 2 +- .../ufreedom/demo/slice/MainAbilitySlice.java | 2 +- .../util/AnimatorStateChangedListener.java | 2 +- .../com/ufreedom/demo/ExampleOhosTest.java | 2 +- .../java/com/ufreedom/demo/ExampleTest.java | 2 +- 10 files changed, 10 insertions(+), 53 deletions(-) diff --git a/FloatingViewLib/src/main/java/com/ufreedom/floatingview/Floating.java b/FloatingViewLib/src/main/java/com/ufreedom/floatingview/Floating.java index 17152ff..59502b6 100644 --- a/FloatingViewLib/src/main/java/com/ufreedom/floatingview/Floating.java +++ b/FloatingViewLib/src/main/java/com/ufreedom/floatingview/Floating.java @@ -21,13 +21,11 @@ import com.ufreedom.floatingview.transition.FloatingTransition; import com.ufreedom.floatingview.transition.YumFloating; import com.ufreedom.floatingview.util.LogUtil; import ohos.aafwk.ability.AbilitySlice; -import ohos.agp.components.AttrSet; import ohos.agp.components.Component; import ohos.agp.components.ComponentContainer; import ohos.agp.components.LayoutScatter; import ohos.agp.components.StackLayout; import ohos.agp.utils.Rect; -import ohos.app.Context; /** * Floating @@ -38,7 +36,6 @@ import ohos.app.Context; public class Floating { private StackLayout mFloatingDecorView; private SpringSystem mSpringSystem; - private AbilitySlice mAbility; /** * Floating @@ -48,11 +45,10 @@ public class Floating { * @throws NullPointerException Ability should not be null */ public Floating(AbilitySlice ability, Component topComponent) { - this.mAbility = ability; if (ability == null) { throw new NullPointerException("Ability should not be null"); } - mFloatingDecorView = new FloatingDecorView(ability); + mFloatingDecorView = new StackLayout(ability); mFloatingDecorView.setLayoutConfig(new StackLayout.LayoutConfig(StackLayout.LayoutConfig.MATCH_PARENT, StackLayout.LayoutConfig.MATCH_PARENT)); @@ -111,44 +107,5 @@ public class Floating { floatingAnimator.applyFloating(new YumFloating(targetView, mSpringSystem)); return mFloatingDecorView; } - - /** - * FloatingDecorView - * - * @since 2021-04-23 - */ - public class FloatingDecorView extends StackLayout { - - /** - * FloatingDecorView - * - * @param context - */ - public FloatingDecorView(Context context) { - this(context, null); - } - - /** - * FloatingDecorView - * - * @param context - * @param attrs - */ - public FloatingDecorView(Context context, AttrSet attrs) { - this(context, attrs, null); - } - - /** - * FloatingDecorView - * - * @param context - * @param attrs - * @param defStyle - */ - public FloatingDecorView(Context context, AttrSet attrs, String defStyle) { - super(context, attrs, defStyle); - } - } - } diff --git a/FloatingViewLib/src/main/java/com/ufreedom/floatingview/util/LogUtil.java b/FloatingViewLib/src/main/java/com/ufreedom/floatingview/util/LogUtil.java index 1ef568e..75e976e 100644 --- a/FloatingViewLib/src/main/java/com/ufreedom/floatingview/util/LogUtil.java +++ b/FloatingViewLib/src/main/java/com/ufreedom/floatingview/util/LogUtil.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/FloatingViewLib/src/test/java/com/ufreedom/floatingview/ExampleTest.java b/FloatingViewLib/src/test/java/com/ufreedom/floatingview/ExampleTest.java index 12f2cb5..0a07e1b 100644 --- a/FloatingViewLib/src/test/java/com/ufreedom/floatingview/ExampleTest.java +++ b/FloatingViewLib/src/test/java/com/ufreedom/floatingview/ExampleTest.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ufreedom/demo/MainAbility.java b/entry/src/main/java/com/ufreedom/demo/MainAbility.java index ca27bdd..ed2f08d 100644 --- a/entry/src/main/java/com/ufreedom/demo/MainAbility.java +++ b/entry/src/main/java/com/ufreedom/demo/MainAbility.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ufreedom/demo/MyApplication.java b/entry/src/main/java/com/ufreedom/demo/MyApplication.java index 1934fbd..53fbbc2 100644 --- a/entry/src/main/java/com/ufreedom/demo/MyApplication.java +++ b/entry/src/main/java/com/ufreedom/demo/MyApplication.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ufreedom/demo/UiUtils.java b/entry/src/main/java/com/ufreedom/demo/UiUtils.java index 3598700..afd0446 100644 --- a/entry/src/main/java/com/ufreedom/demo/UiUtils.java +++ b/entry/src/main/java/com/ufreedom/demo/UiUtils.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ufreedom/demo/slice/MainAbilitySlice.java b/entry/src/main/java/com/ufreedom/demo/slice/MainAbilitySlice.java index 09ade7e..4008d72 100644 --- a/entry/src/main/java/com/ufreedom/demo/slice/MainAbilitySlice.java +++ b/entry/src/main/java/com/ufreedom/demo/slice/MainAbilitySlice.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ufreedom/demo/util/AnimatorStateChangedListener.java b/entry/src/main/java/com/ufreedom/demo/util/AnimatorStateChangedListener.java index 86afb61..be0032c 100644 --- a/entry/src/main/java/com/ufreedom/demo/util/AnimatorStateChangedListener.java +++ b/entry/src/main/java/com/ufreedom/demo/util/AnimatorStateChangedListener.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/ohosTest/java/com/ufreedom/demo/ExampleOhosTest.java b/entry/src/ohosTest/java/com/ufreedom/demo/ExampleOhosTest.java index 62a3d06..0414719 100644 --- a/entry/src/ohosTest/java/com/ufreedom/demo/ExampleOhosTest.java +++ b/entry/src/ohosTest/java/com/ufreedom/demo/ExampleOhosTest.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/test/java/com/ufreedom/demo/ExampleTest.java b/entry/src/test/java/com/ufreedom/demo/ExampleTest.java index a6ba95b..c536f19 100644 --- a/entry/src/test/java/com/ufreedom/demo/ExampleTest.java +++ b/entry/src/test/java/com/ufreedom/demo/ExampleTest.java @@ -2,7 +2,7 @@ * 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 + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * -- Gitee