diff --git a/.gitignore b/.gitignore index b8363dd8f02e393670d570d88b0969cf410cd284..0526d3faec963dfb6502e219bcca516287c7c891 100644 --- a/.gitignore +++ b/.gitignore @@ -1,39 +1,15 @@ -# Built application files -*.ap_ - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ -out/ - -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ - -# Intellij *.iml -.idea/workspace.xml - -# Keystore files -*.jks +/local.properties +/.idea +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +/.gradle \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 9070d82b02fefc4866d5834ffbcfcd73baeadc42..0000000000000000000000000000000000000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 2ad7c15dbeb8084d2f1509c3a2e5cdf7cb2be88d..0000000000000000000000000000000000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 00079d20a7dae66b7576507d9f3b8b99f2e3f0f0..0000000000000000000000000000000000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddfbbc029bcab630581847471d7f238ec53..0000000000000000000000000000000000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 707afa9d570f82af7d238d593d84edcc30bfd36d..b523807a1c5778cb3ea23e151174b5e2c1d6a076 100644 --- a/README.md +++ b/README.md @@ -1,126 +1,133 @@ -# StateButton +# RoundCorners -###中文版这里: https://github.com/niniloveyou/StateButton/blob/master/README_CHINESE.md +**本项目是基于开源项目RoundCorners进行鸿蒙化的移植和开发的,可以通过项目标签以及github地址 +( https://github.com/niniloveyou/StateButton )追踪到原安卓项目版本** -Do you hate to write a background for each button? +### 项目介绍 -Do you hate to write a bunch of selector? +- 项目名称:RoundCorners工具类 +- 所属系列:openharmony第三方组件适配移植 +- 功能:button点击效果 +- 项目移植状态:移植完成 +- 调用差异:无 +- 开发版本:sdk5,DevEco Studio2.1 beta3 +- 项目作者和维护人:王鹏 +- 联系方式:wangpeng067@chinasoftinc.com +- 原项目Doc地址:https://github.com/niniloveyou/StateButton +- 编程语言:Java -That's why I'm writing this view. +### 效果演示 +![0](/gif/0.gif) + + +### 安装教程 -Here to download demo ----------- -https://github.com/niniloveyou/StateButton/blob/master/demo.apk +1. 在项目根目录下的build.gradle文件中添加。 +``` +allproject{ + +} +``` +2. 在entry模块下的build.gradle文件中添加依赖。 +``` +dependencies{ + +} +``` -Screenshot ----------- -![](https://github.com/niniloveyou/StateButton/blob/master/image.png) +如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, -![](https://github.com/niniloveyou/StateButton/blob/master/stateButton.gif) +并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 -### Download -``` - allprojects { - repositories { - ...... - maven { url 'https://jitpack.io' } - } - } - implementation 'com.github.niniloveyou:StateButton:v1.0.0' - -``` - -Customizable attributes ------------------------ - -| Attribute | default value | xml | java | -|------------------------|------------------------|--------------------------|-------------------------------------| -| normalTextColor | original text color | normalTextColor | setNormalTextColor(int color) | -| pressedTextColor | original text color | pressedTextColor | setPressedTextColor(int color) | -| unableTextColor | original text color | unableTextColor | setUnableTextColor(int color) | -| strokeDashWidth | 0 | strokeDashWidth | setStrokeDash(int dashWidth, int dashGap) | -| strokeDashGap | 0 | strokeDashGap | setStrokeDash(int dashWidth, int dashGap) | -| normalStrokeWidth | 0 | normalStrokeWidth | setNormalStrokeWidth(int widht) | -| pressedStrokeWidth | 0 | pressedStrokeWidth | setPressedStrokeWidth(int widht) | -| unableStrokeWidth | 0 | unableStrokeWidth | setUnableStrokeWidth(int widht) | -| normalStrokeColor | 0 | normalStrokeColor | setNormalStrokeColor(int color) | -| pressedStrokeColor | 0 | pressedStrokeColor | setPressedStrokeColor(int color) | -| unableStrokeColor | 0 | unableStrokeColor | setUnableStrokeColor(int color) | -| normalBackgroundColor | 0 | normalBackgroundColor | setNormalBackgroundColor(int color) | -| pressedBackgroundColor | 0 | pressedBackgroundColor | setPressedBackgroundColor(int color) | -| unableBackgroundColor | 0 | unableBackgroundColor | setUnableBackgroundColor(int color) | -| radius | 0 | radius | setRadius(int radius) / setRadius(float[] radii) | -| round | false | round | setRound(boolean round) | -| animationDuration | 0ms | animationDuration | setAnimationDuration(int duration) | - -Usage ------ -If the default values of custom attribues did not meet your requirement, you can easily re-config that attributes. This is sample code that you can refer. you can also browse demo app for more details. - -### via xml (sample) -- Define `xmlns:app="http://schemas.android.com/apk/res-auto"` on root of your xml file +### 使用说明 + +StateButton + +1. 布局文件定义,提供控件:StateButton ```xml - +