# ValueCounter **Repository Path**: HarmonyOS-tpc/ValueCounter ## Basic Information - **Project Name**: ValueCounter - **Description**: 实现组件计数器功能 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 2 - **Created**: 2021-04-15 - **Last Updated**: 2025-02-06 ## Categories & Tags **Categories**: harmonyos-counter **Tags**: None ## README # ValueCounter ## 自定义组件功能 实现组件计数器功能 ## 导入依赖 方式一: 通过library生成har包,添加har包到libs文件夹内 在entry的gradle内添加如下代码 implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) 方式二: allprojects{ repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:valueCounter:1.0.4' ## Step2 ## Step3 Reference the View in Java code. valueCounterView = (ValueCounterView) findComponentById(ResourceTable.Id_valueCounter); getValue valueCounterView.getValue(); ## 示例截图 ![image](https://gitee.com/openharmony-tpc/ValueCounter/raw/master/screenshot/test.gif) ## entry运行要求 通过DevEco studio,并下载SDK 将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即你的IDE新建项目中所用的版本)