# ohos-ui
**Repository Path**: HarmonyOS-tpc/ohos-ui
## Basic Information
- **Project Name**: ohos-ui
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 2
- **Created**: 2021-06-26
- **Last Updated**: 2025-01-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# ohos-ui
## 目录
* [功能介绍](#功能介绍)
* [演示](#演示)
* [集成](#集成)
* [布局文件](#布局文件)
* [自定义属性说明](#自定义属性说明)
* [接口说明](#接口说明)
## 功能介绍
- [x] ohos ui 库
## 演示
|圆形的显示/隐藏动画 | 动作视图|
|:---:|:---:|
|
|
|
## 集成
```
方式一:
添加har到entry下的libs文件夹内
将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即你的IDE新建项目中所用的版本)
entry的build.gradle内添加如下代码
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
方式二:
allprojects{{
repositories{
maveCentral()
}
}
implementation 'io.openharmony.tpc.thirdlib:ohos-ui:1.0.0'
```
## 布局文件
动作视图
```xml
```
您可以通过以下的方式动态更改操作
```
actionView.setAction(new BackAction(), ActionView.ROTATE_COUNTER_CLOCKWISE);
```
内置以下动作:
DrawerAction
BackAction
CloseAction
PlusAction
圆形的显示/隐藏动画
```xml
```
## 自定义属性说明
属性名 | 说明 | 默认值
:----------- | :----------- | :-----------
ACTIONVIEW_AV_COLOR | 颜色 | WHITE
ACTIONVIEW_AV_ACTION | id | 0
## 接口说明
```java
/**
* Sets the new action. If an action was set before a transition will be started.
*
* @param action
*/
public void setAction(final Action action)
/**
* Sets the new action. If an action was set before a transition will be started.
*
* @param action
* @param rotation Can be either {@link #ROTATE_CLOCKWISE} or {@link #ROTATE_COUNTER_CLOCKWISE}.
*/
public void setAction(final Action action, final int rotation)
/**
* Sets the new action.
*
* @param action
* @param animate If a prior action was set and {@code true} a transition will be started, otherwise not.
*/
public void setAction(final Action action, final boolean animate)
/**
* Sets a new action transition.
*
* @param fromAction The initial action.
* @param toAction The target action.
* @param rotation The rotation direction used for the transition {@link #ROTATE_CLOCKWISE} or {@link #ROTATE_COUNTER_CLOCKWISE}.
* @param delay The delay in ms before the transition is started.
*/
public void setAction(final Action fromAction, final Action toAction, final int rotation, long delay)
/**
* Set the animation duration used for Action transitions
*
* @param animationDuration the duration in ms
*/
public void setAnimationDuration(long animationDuration)
/**
* 显示圆形动画
*
* @param x 点击的x轴坐标
* @param y 点击的y轴坐标
* @param color 设置的动画颜色
* @param listener 动画状态变化监听
*/
public void reveal(final int x, final int y, final RgbColor color, Animator.StateChangedListener listener)
/**
* 显示圆形动画
*
* @param x 点击的x轴坐标
* @param y 点击的y轴坐标
* @param color 设置的动画颜色
* @param startRadius 动画圆开始半径
* @param duration 动画时长
* @param listener 动画状态变化监听
*/
public void reveal(final int x, final int y, final RgbColor color, final int startRadius, long duration, final Animator.StateChangedListener listener)
/**
* 隐藏圆形动画
*
* @param x
* @param y
* @param color 设置的动画颜色
* @param listener
*/
public void hide(final int x, final int y, final RgbColor color, final Animator.StateChangedListener listener)
/**
* 隐藏圆形动画
*
* @param x 点击的x轴坐标
* @param y 点击的y轴坐标
* @param color 设置的动画颜色
* @param endRadius 动画结束时圆半径
* @param duration 动画时长
* @param listener 动画状态变化监听
*/
public void hide(final int x, final int y, final RgbColor color, final int endRadius, final long duration, final Animator.StateChangedListener listener)
```