鸿蒙开源组件——对话框变形动画

jacksky
发布于 2021-8-17 17:43
浏览
0收藏

FabDialogMorph

项目介绍

  • 项目名称:FabDialogMorph
  • 所属系列:openharmony的第三方组件适配移植
  • 功能:Ohos 上的 Fab 和对话框变形动画
  • 项目移植状态:完成
  • 调用差异:无
  • 开发版本:sdk6,DevEco Studio2.2 Beta1
  • 基线版本:master分支

效果演示鸿蒙开源组件——对话框变形动画-鸿蒙开发者社区

使用说明

java

     public void setStackLayoutWindow(StackLayout stackLayout, boolean isShow) {
   
           int intColor = Color.getIntColor("#AA000000");
           stackLayout.setAlpha(0);
           stackLayout.setClickable(true);
           ShapeElement shapeElementOver = new ShapeElement();
           if (isShow) {
               stackLayout.setVisibility(Component.HIDE);
               shapeElementOver.setRgbColor(getRgbColor(intColor));
           } else {
               stackLayout.setVisibility(Component.VISIBLE);
               shapeElementOver.setRgbColor(new RgbColor(0, 0, 0, 0));
           }
           stackLayout.setBackground(shapeElementOver);
   
       }
    
public boolean showOverlay(Component overlayLayout, AnimationGroupEnd end) {
        AnimatorValue animatorValue = new AnimatorValue();
        animatorValue.setDuration(duration);
        animatorValue.setValueUpdateListener((animatorValue1, v) -> {
            overlayLayout.setTag(animatorValue);
            overlayLayout.setAlpha(v);
            if (v >= FLOAT_005) {
                overlayLayout.setVisibility(Component.VISIBLE);
            }
        });
        animatorValue.start();
        animatorValue.setStateChangedListener(new Animator.StateChangedListener() {
            @Override
            public void onStart(Animator animator) {

            }

            @Override
            public void onStop(Animator animator) {

            }

            @Override
            public void onCancel(Animator animator) {

            }

            @Override
            public void onEnd(Animator animator) {
                end.animationGroup();
                end.animationGroupEnd();
            }

            @Override
            public void onPause(Animator animator) {

            }

            @Override
            public void onResume(Animator animator) {

            }
        });
        return true;
    }

 

测试信息

CodeCheck代码测试无异常

CloudTest代码测试无异常

病毒安全检测通过

当前版本demo功能与原组件基本无差异

版本迭代

  • 0.0.1-SNAPSHOT

版权和许可信息

The MIT License (MIT)

Copyright (c) 2016 Hujiawei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

 

FabDialogMorph-master.zip 84.41K 12次下载
已于2021-8-17 17:43:27修改
收藏
回复
举报
回复
    相关推荐