# StatusView **Repository Path**: HarmonyOS-tpc/StatusView ## Basic Information - **Project Name**: StatusView - **Description**: openharmony系统自定义状态Component。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2021-04-01 - **Last Updated**: 2024-11-25 ## Categories & Tags **Categories**: harmony **Tags**: None ## README # StatusView openharmony系统自定义状态Component。 # Usage Add to XML 如果要使用ConnectionStatusView ```java ``` 如果您想使用自己的布局获取状态 ```java ``` 然后调用状态方法 ```java statusView.setStatus(Status.LOADING); statusView.setStatus(Status.ERROR); statusView.setStatus(Status.COMPLETE); statusView.setStatus(Status.IDLE); //hide status ``` 如果要在调用oncomplete后自动关闭,请添加app:dismissOnComplete="true"为属性。 # Getters 您可以为所有状态(错误/完成/加载)添加自定义视图。而且,您还可以获取此视图来控制包含的UI小部件,例如按钮/图像视图 ```java View viewError = statusView.getErrorView(); View viewComplete = statusView.getCompleteView(); View viewLoading = statusView.getLoadingView(); ``` # Listeners ```java statusView.setOnErrorClickListener(listener); statusView.setOnLoadingClickListener(listener); ``` ## entry运行要求 通过DevEco studio,并下载openharmonySDK 将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即您当前IDE新建项目中所用的版本) ## 集成 ``` allprojects{ repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:StatusView:1.0.3' ``` # License Copyright 2017 Mert Şimşek. 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.