1 Star 2 Fork 0

Archermind-TI / GABottleLoading

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

GABottleLoading

Bottle Loading

实现效果图如下:

Note:

  • 1.动画中的瓶身及水的颜色都可以自我定义;
  • 2.整体宽高自行定义,内部元素均根据整体宽高自动缩放适应;

2 如何使用

2.1 获取项目资源

dependencies {
	implementation 'com.gitee.archermind-ti:GABottleLoading:1.0.0'
}

2.2 在布局文件中添加GABottleLoadingView

<com.gastudio.gabottleloading.library.GABottleLoadingView
	ohos:id="$+id:bottle_view_small"
	ohos:height="match_parent"
	ohos:width="0vp"
	ohos:weight="1"/>

Note

  • 如果View的背景颜色采用#ff191f26色值,将可以达到最佳的视觉效果.

2.3 在布局中中找到组件

((GABottleLoadingView) findComponentById(ResourceTable.Id_bottle_view_small)).performAnimation();

3 核心接口和自定义属性

3.1 核心接口

  • perfromAnimation(): Start the animation;
  • cancel(): Release resources
  • setDebug(): can see the how it work

3.2 自定义属性

3.2.1 添加自定义属性命名空间

<DirectionalLayout
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    xmlns:gastudio="http://schemas.huawei.com/apk/res/ohos" 
    ...
/>

3.2.2 添加自定义属性

<com.gastudio.gabottleloading.library.GABottleLoadingView
	ohos:id="$+id:bottle_view_big"
	ohos:height="0vp"
	ohos:width="match_parent"
	ohos:top_margin="16vp"
	ohos:background_element="#ff191f26"
	gastudio:bottle_color="white"
	gastudio:water_color="blue"
	ohos:weight="2" />

License

Copyright 2017 GAStudio

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.

空文件

简介

Bezier storm(贝塞尔风暴 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/archermind-ti/gabottleloading.git
git@gitee.com:archermind-ti/gabottleloading.git
archermind-ti
gabottleloading
GABottleLoading
master

搜索帮助