This commit is contained in:
coco
2026-07-03 15:56:07 +08:00
commit caef23209c
5767 changed files with 1004268 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
# Built application files
*.apk
*.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
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches
# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Google Services (e.g. APIs or Firebase)
google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
app/debug
.idea
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
+204
View File
@@ -0,0 +1,204 @@
# WidgetCase
<!--https://shields.io/-->
<!--[![auc][aucsvg]][auc] [![api][apisvg]][api] [![License][licensesvg]][license]-->
[![](https://img.shields.io/badge/widget-1.1.6-green.svg)](https://github.com/faith-hb/WidgetCase/) [![](https://img.shields.io/badge/platform-android-blue.svg)](https://github.com/faith-hb/WidgetCase) ![](https://img.shields.io/badge/Gradle-5.1.1-orange.svg) ![](https://img.shields.io/badge/maven-2.0-lightgrey.svg)
> [English Introduction](https://github.com/faith-hb/WidgetCase/blob/master/README_EN.md)
#### 项目介绍
不会自定义View?不会触摸反馈?莫慌,这里将消除你的畏惧感。本库是跟着公司项目走了一年之久的自定义控件Library,稳定性和兼容性已有所保障。由于公司项目偏向于统计类,所以项目里更多的是这方面的控件;但既然把库都抽出来了,就绝不可能只是涉及到统计类这块,会发散到更多的应用场景中去。因此,此库会一直维护下去(决心表的很大)。当然一个人的力量总是有限的,在这期待更多志同道合的码友们的加入,大家在一起干点轰轰烈烈的事情。
#### 特别声明
Library中部分控件来自HenCoder plus 3期课程内容,HenCoder是一个针对Android进阶很有帮助的内容(质量非常高)输出平台,如对HenCoder有兴趣的可以去 https://hencoder.com/ 了解更多情况
#### 效果刷一波,毕竟是看脸吃饭的年代
##### 功能目录
<img src="screenshots/main_btm.jpg" width="280" height="606"/> <img src="screenshots/main_menu.jpg" width="280" height="606"/>
##### 峰值图>>>[TaperChart & TaperChartLayout & HorTaperChart] & 渐变曲线>>>[GradientLine]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/taperchart.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/hortapercharts.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/gradientline.gif)
##### (波浪加载控件)[CircleWaveView] & (仿网易一元夺宝下拉效果)[RefreshView]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/circlewaveview.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/refreshview.gif)
##### 图文混排>>>[ImgTxtMixtureView] & 手势放大缩小图片>>>[MatrixView]
<img src="screenshots/imgtxtmixture.png" width="320" height="565"/> ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/matrixview.gif)
##### 圆环进度>>>[RingView & LegendRingView]
<img src="screenshots/ringview_123.jpeg" width="280" height="497"/> <img src="screenshots/ringview_456.png" width="280" height="497"/> <img src="screenshots/ringview_789.png" width="280" height="497"/>
##### LFT:圆环进度带底部角标>>>[CircleProgressBarView] MID:带刻度的圆环>>>[GradientProBar] RGT:横向进度-带进度提示>>>[HorProBar]
<img src="screenshots/circleprogressbarview.jpeg" width="280" height="497"/> <img src="screenshots/gradientprobar.jpeg" width="280" height="497"/> <img src="screenshots/horprobar.png" width="280" height="497"/>
##### 图片滤镜>>>[ColorMatrixActivity & ColorHueActivity]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/colormartix.gif)
##### 时间刻度尺(支持缩放)>>>[TimeRulerView] & 圆形按钮(跟随设备一起旋转,实时监控旋转方向)>>>[CircleButton]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/timerulerview.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/circlebutton.gif)
##### 自定义滑动控件(支持多指触控、惯性滑动、自定义滚动条)>>>[CustomScrollView] & 自定义ViewPager的滑动动画>>>[ScaleAlphaTransformer]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/customscrollview.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/scalealphatransformer.gif)
##### 图片翻转动画(通过 Camera 和 Canvas 控制位图的翻转折叠效果)>>>[BmpOverturnView]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/bmpoverturn.gif)
#### 自定义控件分布如下
##### 峰值图
1. [TaperChart](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/taperchart/TaperChart.java)
2. [TaperChartLayout](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/taperchart/TaperChartLayout.java)
3. [HorTaperChart](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/taperchart/HorTaperChart.java)
##### 波浪加载控件
[CircleWaveView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/wave/CircleWaveView.java)
##### 仿网易一元夺宝下拉刷新控件
[RefreshView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/touch/RefreshView.java)
##### 圆形进度条
1. [CircleProgress](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/progress/circle/CircleProgress.java)
2. [GradientProBar](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/progress/circle/GradientProBar.java)
3. [CircleProgressBarView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/progress/circle/CircleProgressBarView.java)
4. [CircleView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/progress/circle/CircleView.java)
##### 环形进度条
1. [RingView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/progress/ring/RingView.java)
2. [LegendRingView(内含图例)](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/progress/ring/LegendRingView.java)
##### 半圆/油表
1. [HalfCircleProView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/HalfCircleProView.java)
##### 横向进度条
1. [HorProBar](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/progress/horbar/HorProBar.java)
2. [SectionProBar](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/progress/horbar/SectionProBar.java)
3. [ShadowProBar](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/horbar/progress/ShadowProBar.java)
4. [LoadingLineView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/horbar/progress/LoadingLineView.java)
##### 渐变曲线
[GradientLine](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/GradientLine.java)
##### 图文混排
[ImgTxtMixtureView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/view/ImgTxtMixtureView.java)
##### 防微信图片查看器,双击放大/缩小
[MatrixView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/touch/MatrixView.java)
##### 系统控件重写
1. [FixGridView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/sys/FixGridView.java)
2. [FixListView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/sys/FixListView.java)
3. [NoScrollViewPager](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/sys/NoScrollViewPager.java)
##### 贝塞尔曲线练练手
[PathMorphBezier](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/PathMorphBezier.java)
##### 图片滤镜
1. [ColorMatrix](https://github.com/faith-hb/WidgetCase/blob/master/app/src/main/java/com/doyou/cvc/release/colorfilter/ColorMatrixActivity.kt)
2. [ColorHue](https://github.com/faith-hb/WidgetCase/blob/master/app/src/main/java/com/doyou/cvc/release/colorfilter/ColorHueActivity.kt)
##### 时间刻度尺(支持缩放)
[TimeRulerView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/timeruler/TimeRulerView.java)
##### 圆形按钮(跟随设备一起旋转,实时监控旋转方向)
[CircleButton](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/view/CircleButton.java)
##### 自定义滑动控件(支持多指,支持惯性滑动,支持自定义滚动条)
[CustomScrollView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/touch/CustomScrollView.java)
##### ScaleAlphaTransformer(自定义ViewPager的滑动动画)
[ScaleAlphaTransformer](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/sys/viewpager/transformer/ScaleAlphaTransformer.java)
##### 图片翻转动画
[BmpOverturnView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/animator/BmpOverturnView.java)
#### Download
Step 1.
``` groovy
allprojects {
repositories {
...
maven {
url 'http://47.93.38.184:8081/nexus/content/repositories/faithhb/'
}
maven {
url 'http://47.93.38.184:8081/nexus/content/repositories/github/' // widget发布版本已切换到该目录
}
}
}
```
Step 2.
Gradle:
``` groovy
implementation 'com.faithhb:widgetcase:1.0.3'
```
widgetcase最新版本:[![](https://img.shields.io/badge/widget-1.0.3-green.svg)](http://47.93.38.184:8081/nexus/service/local/repositories/github/content/com/github/widgetcase/1.0.3/widgetcase-1.0.3.aar)
or
aar:
``` groovy
implementation(name: 'hawkeye_widget-release', ext: 'aar')
```
or
添加本地依赖:
``` groovy
implementation project(':hawkeye_widget')
```
#### Proguard
``` groovy
-dontwarn com.dongni.**
-keep class com.dongni.** { *; }
# 页面modle避免混淆
-keep class com.doyou.cv.bean.**{*; }
-keep class com.doyou.cv.WLogger{*; }
-keep class com.doyou.cv.widget.**
-keepclassmembers class com.doyou.cv.widget.** {
public *;
}
# 工具类避免混淆
-keep class com.doyou.cv.utils.**
-keepclassmembers class com.doyou.cv.utils.** {
public *;
}
```
#### 有问题怎么办?
首先有问题的话,可以提issue,我会经常去看的,也可以加我微信。
#### 想加入一起来维护这个开源项目,该怎么操作?
你可以先fork下来这个项目然后自己去修改一些网友的问题或者自己发现的问题和需要优化的地方;当然也可以加入自己原创的自定义控件;再通过发pr的形式给我,我会第一时间查看代码并进行测试及合并代码。
这样坚持提交超过3个pr的小伙伴(并且质量不错的),我会直接邀请他称为该项目的开发者,真正做到方便,快速的维护这个开源库。。。
#### 联系方式:
微信:faith-hb<br>
QQ907167515
#### License
Copyright 2019 faith-hb
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.
+206
View File
@@ -0,0 +1,206 @@
# WidgetCase
<!--https://shields.io/-->
<!--[![auc][aucsvg]][auc] [![api][apisvg]][api] [![License][licensesvg]][license]-->
[![](https://img.shields.io/badge/widget-1.1.6-green.svg)](https://github.com/faith-hb/WidgetCase/) [![](https://img.shields.io/badge/platform-android-blue.svg)](https://github.com/faith-hb/WidgetCase) ![](https://img.shields.io/badge/Gradle-5.1.1-orange.svg) ![](https://img.shields.io/badge/maven-2.0-lightgrey.svg)
> [中文文档](https://github.com/faith-hb/WidgetCase/blob/master/README.md)
#### project introduction
With a year of custom control Library, stability and compatibility have been guaranteed. Because the company projects tend to statistics,
so the project is more in this aspect of the control; But now that I've pulled out all the libraries, I can't just talk about the statistics class,
I can diverge to more scenarios. So, the library will be maintained until Android goes down, and I go down. Of course, a person's power is always limited,
in this look forward to more like-minded code friends to join, we work together to do something spectacular.
#### Effect brush a wave, after all, is to see the face to eat
##### Function directory
<img src="screenshots/main.jpg" width="280" height="606"/> <img src="screenshots/main_menu.jpg" width="280" height="606"/> <img src="screenshots/main_btm.jpg" width="280" height="606"/>
##### Peak figure>>>[TaperChart & TaperChartLayout & HorTaperChart] & The gradient curve>>>[GradientLine]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/taperchart.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/hortapercharts.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/gradientline.gif)
##### (Wave loading view)[CircleWaveView] & (The drop-down effect)[RefreshView]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/circlewaveview.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/refreshview.gif)
##### Graphic mixed>>>[ImgTxtMixtureView] & Gestures to zoom>>>[MatrixView]
<img src="screenshots/imgtxtmixture.png" width="320" height="565"/> ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/matrixview.gif)
##### Circle the progress>>>[RingView & LegendRingView]
<img src="screenshots/ringview_123.jpeg" width="280" height="497"/> <img src="screenshots/ringview_456.png" width="280" height="497"/> <img src="screenshots/ringview_789.png" width="280" height="497"/>
##### LFTCircular progress with bottom corner marks>>>[CircleProgressBarView] MIDRing with scale>>>[GradientProBar] RGTHorizontal progress-Progress indicator>>>[HorProBar]
<img src="screenshots/circleprogressbarview.jpeg" width="280" height="497"/> <img src="screenshots/gradientprobar.jpeg" width="280" height="497"/> <img src="screenshots/horprobar.png" width="280" height="497"/>
##### Image filter>>>[ColorMatrixActivity & ColorHueActivity]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/colormartix.gif)
##### Time scaleSupport the zoom>>>[TimeRulerView] & CircleButtonRotate with the device to monitor the rotation direction in real time>>>[CircleButton]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/timerulerview.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/circlebutton.gif)
##### Custom slide controlSupport multi - finger touch, inertial sliding, custom scroll bar>>>[CustomScrollView] & Custom ViewPager slide animation>>>[ScaleAlphaTransformer]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/customscrollview.gif) ![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/scalealphatransformer.gif)
##### Bitmap flip animationControl the flip and fold effect of bitmap through Camera and Canvas>>>[BmpOverturnView]
![image](https://github.com/faith-hb/WidgetCase/blob/master/screenshots/bmpoverturn.gif)
#### The custom controls are distributed as follows
##### Peak figure
1. [TaperChart](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/TaperChart.java)
2. [TaperChartLayout](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/TaperChartLayout.java)
3. [HorTaperChart](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/HorTaperChart.java)
##### Wave loading view
[CircleWaveView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/wave/CircleWaveView.java)
##### The drop-down effect
[RefreshView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/touch/RefreshView.java)
##### Circular progress bar
1. [CircleProgress](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/circle/CircleProgress.java)
2. [GradientProBar](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/circle/GradientProBar.java)
3. [CircleProgressBarView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/circle/CircleProgressBarView.java)
4. [CircleView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/circle/CircleView.java)
##### Ring progress bar
1. [RingView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/ring/RingView.java)
2. [LegendRingView(It contains legend)](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/ring/LegendRingView.java)
##### semicircle/Fuel meter
1. [HalfCircleProView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/HalfCircleProView.java)
##### Horizontal progress bar
1. [HorProBar](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/horbar/HorProBar.java)
2. [SectionProBar](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/horbar/SectionProBar.java)
3. [ShadowProBar](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/horbar/ShadowProBar.java)
4. [LoadingLineView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/horbar/LoadingLineView.java)
##### The gradient curve
[GradientLine](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/GradientLine.java)
##### Graphic mixed
[ImgTxtMixtureView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/view/ImgTxtMixtureView.java)
##### Anti - WeChat picture viewer, double - click zoom in/out
[MatrixView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/touch/MatrixView.java)
##### System control rewrite
1. [FixGridView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/sys/FixGridView.java)
2. [FixListView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/sys/FixListView.java)
3. [NoScrollViewPager](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/sys/NoScrollViewPager.java)
##### Learn the bezier curve
[PathMorphBezier](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/PathMorphBezier.java)
##### Image filter
1. [ColorMatrix](https://github.com/faith-hb/WidgetCase/blob/master/app/src/main/java/com/doyou/cvc/release/colorfilter/ColorMatrixActivity.kt)
2. [ColorHue](https://github.com/faith-hb/WidgetCase/blob/master/app/src/main/java/com/doyou/cvc/release/colorfilter/ColorHueActivity.kt)
##### Time Ruler
[TimeRulerView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/timeruler/TimeRulerView.java)
##### CircleButtonRotate with the device to monitor the rotation direction in real time
[CircleButton](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/view/CircleButton.java)
##### Custom slide controlSupport multi - finger touch, inertial sliding, custom scroll bar
[CustomScrollView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/touch/CustomScrollView.java)
##### Custom ViewPager slide animation
[ScaleAlphaTransformer](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/sys/viewpager/transformer/ScaleAlphaTransformer.java)
##### Bitmap flip animation
[BmpOverturnView](https://github.com/faith-hb/WidgetCase/blob/master/hawkeye_widget/src/main/java/com/doyou/cv/widget/animator/BmpOverturnView.java)
#### Download
Step 1.
``` groovy
allprojects {
repositories {
...
maven {
url 'http://47.93.38.184:8081/nexus/content/repositories/faithhb/'
}
maven {
url 'http://47.93.38.184:8081/nexus/content/repositories/github/' // widget发布版本已切换到该目录
}
}
}
```
Step 2.
Gradle:
``` groovy
implementation 'com.faithhb:widgetcase:1.0.3'
```
widgetcase The latest version[![](https://img.shields.io/badge/widget-1.0.3-green.svg)](http://47.93.38.184:8081/nexus/service/local/repositories/github/content/com/github/widgetcase/1.0.3/widgetcase-1.0.3.aar)
or
aar:
``` groovy
implementation(name: 'hawkeye_widget-release', ext: 'aar')
```
or
Add local dependencies
``` groovy
implementation project(':hawkeye_widget')
```
#### Proguard
``` groovy
-dontwarn com.dongni.**
-keep class com.dongni.** { *; }
# page modle To avoid confusion
-keep class com.doyou.cv.bean.**{*; }
-keep class com.doyou.cv.WLogger{*; }
-keep class com.doyou.cv.widget.**
-keepclassmembers class com.doyou.cv.widget.** {
public *;
}
# Utility classes avoid confusion
-keep class com.doyou.cv.utils.**
-keepclassmembers class com.doyou.cv.utils.** {
public *;
}
```
#### What if there is a problem?
First of all, if there is a problem, you can issue issue. I will often go to see it. If it can be solved, it will be solved in time.
#### Want to join in the maintenance of this open source project, how to operate?
You can fork down the project first and then modify some netizens' problems or the problems you find and the places that need to be optimized by yourself, and then send them to me in the form of pr. I will immediately check the code, test and merge the code.
I will invite him to be the developer of this project. He will be really convenient and quick to maintain this open source library.
#### contact me
WeChatfaith-hb<br>
QQ907167515<br>
Email:hongbinghp@gmail.com
#### License
Copyright 2019 faith-hb
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.
+1
View File
@@ -0,0 +1 @@
/build
+94
View File
@@ -0,0 +1,94 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: 'signConfig.gradle'
println "测试打印...${widgetcase.keyAlias}"
android {
compileSdkVersion setup.compileSdk
buildToolsVersion = setup.buildTools
defaultConfig {
applicationId "com.doyou.cvc"
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
versionCode release.versionCode
versionName release.versionName
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
signingConfigs {
autoSigning {
// 加载properties
// def properties = new Properties()
// def inputStream = project.rootProject.file('local.properties').newDataInputStream()
// properties.load(inputStream)
//
// keyAlias 'widgetcase'
// keyPassword properties.getProperty('certificates.password')
// storeFile file('../widgetcase')
// storePassword properties.getProperty('certificates.password')
keyAlias widgetcase.keyAlias
keyPassword widgetcase.signPwd
storeFile file(widgetcase.keyStoreFileDir)
storePassword widgetcase.signPwd
}
}
buildTypes {
release {
minifyEnabled true
multiDexEnabled true
zipAlignEnabled true
signingConfig signingConfigs.autoSigning
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
// variant.packageApplicationProvider.get().outputDirectory = new File(project.rootDir.absolutePath + "/apk")
def outName = "WidgetCase"
def fileName = outName + '-v' + variant.versionName + '-' + variant.buildType.name + '.apk'
output.outputFileName = fileName
}
}
}
repositories { // 正确引用aarhttps://blog.csdn.net/qq_35522272/article/details/70214962
flatDir {
dirs 'libs'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
implementation "androidx.appcompat:appcompat:${versions.appcompat}"
implementation "androidx.annotation:annotation:${versions.appcompat}"
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
implementation 'com.google.android:flexbox:1.1.0'
implementation 'com.android.support:design:28.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(':hawkeye_widget')
implementation "com.faithhb:toolslib:${outer.toolslib}"
// aar中依赖的库,主项目也必须依赖,因为aar中依赖的库不会被打进aar包中
// implementation 'com.github:widgetcase:1.0.4'
// implementation(name: 'hawkeye_widget-release', ext: 'aar')
}
Binary file not shown.
+21
View File
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+9
View File
@@ -0,0 +1,9 @@
// 引用自定义插件
apply plugin: 'com.doyou.widgetcase'
// 配置插件属性
widgetcase {
keyAlias 'widgetcase'
signPwd '2019888'
keyStoreFileDir '../widgetcase'
}
@@ -0,0 +1,24 @@
package com.doyou.cvc
import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("com.doyou.cvc", appContext.packageName)
}
}
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.doyou.cvc">
<application
android:name=".WidgetApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".activity.MenuMainActivity"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.ImgTxtMixtureActivity" />
<activity android:name=".activity.RingViewActivity" />
<activity android:name=".activity.taperchart.TaperChartActivity" />
<activity android:name=".activity.taperchart.ContrastActivity" />
<activity android:name=".activity.taperchart.ScrollTaperChartActivity" />
<activity android:name=".activity.GradientLineActivity" />
<activity android:name=".activity.LegendRingViewActivity" />
<activity android:name=".activity.CircleProgressBarViewActivity" />
<activity android:name=".activity.ShadowProBarActivity" />
<activity android:name=".activity.GradientProBarScaleActivity" />
<activity android:name=".activity.HalfCircleProViewActivity" />
<activity android:name=".activity.MatrixViewActivity" />
<activity android:name=".activity.GradientProBarActivity" />
<activity android:name=".activity.ringview.DoubleTxtActivity" />
<activity android:name=".activity.ringview.LegendActivity" />
<activity android:name=".activity.HorScrollSelecteViewActivity" />
<activity android:name=".activity.HorProBarActivity" />
<activity android:name=".activity.SectionProBarActivity" />
<activity android:name=".activity.WaveViewActivity" />
<activity android:name=".activity.colorfilter.ColorMainActivity" />
<activity android:name=".activity.colorfilter.ColorMatrixActivity" />
<activity android:name=".activity.colorfilter.ColorHueActivity" />
<activity android:name=".activity.touch.RefreshViewActivity" />
<activity android:name=".activity.timeruler.TimeRulerActivity" />
<activity android:name=".activity.animator.BmpOverturnActivity" />
<activity
android:name=".activity.CircleBtnActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.touch.CustomScrollViewActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.sys.viewpager.ViewPagerTransformerActivity"
android:screenOrientation="portrait" />
</application>
</manifest>
@@ -0,0 +1,13 @@
package com.doyou.cvc
import android.app.Application
import com.dongni.tools.Common
class WidgetApplication : Application() {
override fun onCreate() {
super.onCreate()
Common.init(this, true)
}
}
@@ -0,0 +1,74 @@
package com.doyou.cvc.activity
import android.content.res.Configuration
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.dongni.tools.Common
import com.doyou.cv.callback.Rotatable
import com.doyou.cvc.R
import com.doyou.cvc.activity.listener.OrientationListener
import kotlinx.android.synthetic.main.activity_circlebtn.*
class CircleBtnActivity : AppCompatActivity(),OrientationListener.Callback {
private val STROKE_WIDTH = 2
private var mOrientationListener:OrientationListener? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_circlebtn)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_circlebutton_view)
mOrientationListener = OrientationListener(
applicationContext)
mOrientationListener!!.callback = this
mOrientationListener!!.enable() // 必须要调用此方法,不然旋转监听无效
videoCb.setStroke(STROKE_WIDTH,resources.getColor(R.color.default_bg_normal_color))
videoCb.setBackgroundDisabledColor(resources.getColor(R.color.bg_disabled_color))
videoCb.setImageResource(R.mipmap.call_answer_video)
audioCb.setStroke(STROKE_WIDTH,resources.getColor(R.color.default_bg_normal_color))
audioCb.setBackgroundDisabledColor(resources.getColor(R.color.bg_normal_color))
audioCb.setImageResource(R.mipmap.call_answer_audio)
cameraCb.setStroke(STROKE_WIDTH,resources.getColor(R.color.default_bg_normal_color))
cameraCb.setBackgroundDisabledColor(resources.getColor(R.color.bg_pressed_color))
cameraCb.setImageResource(R.mipmap.call_camera_on_normal)
}
override fun onDestroy() {
super.onDestroy()
mOrientationListener!!.disable()
}
override fun orientationChanged(orientation: Int, previousOrientation: Int) {
Common.log_d("回调", "orientationChanged:orientation = $orientation->previousOrientation = $previousOrientation")
updateButtons(orientation)
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
Common.log_d("旋转", "onConfigurationChanged")
}
private fun updateButtons(orientation: Int){
var indicators = arrayOf<Rotatable>(videoCb,audioCb,cameraCb)
for (indicator in indicators) {
if (indicator != null) {
indicator!!.setOrientation(orientation * 90, true)
}
}
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,41 @@
package com.doyou.cvc.activity
import android.graphics.Color
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_circle_progress_barview.*
class CircleProgressBarViewActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_circle_progress_barview)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_circle_progressbar_view)
oneCpbv.setProgressWithAnimation(0 / 1f)
oneCpbv.setTargetNum(2345.00f.toString())
twoCpbv.setProgressWithAnimation(249.0f)
twoCpbv.setTargetNum(2345.00f.toString())
threeCpbv.setProgressWithAnimation(49.4f)
threeCpbv.setCenterProgressTextColor(Color.rgb(88,181,250))
threeCpbv.setTargetNum(2345.00f.toString())
setFinishBtn.setOnClickListener {
threeCpbv.setProgressWithAnimation(249.4f)
}
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,71 @@
package com.doyou.cvc.activity
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cv.widget.GradientLine
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_gradientline.*
class GradientLineActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gradientline)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_gradient_line)
gLineUp.postDelayed({
gLineUp.setAnim(true)
gLineUp.setMode(GradientLine.LineMode.DOWN)
},500)
gLineFlat.setAnim(true)
gLineFlat.postDelayed({
gLineFlat.setMode(GradientLine.LineMode.FLAT)
},500)
gLineDown.postDelayed({
gLineDown.setAnim(true,640)
gLineDown.setMode(GradientLine.LineMode.UP)
},500)
gLineBtn.setOnClickListener {
gLineUp.postDelayed({
gLineUp.handleStartAnim()
}, 120)
gLineFlat.handleStartAnim()
gLineDown.postDelayed({
gLineDown.handleStartAnim()
}, 120)
}
gLineAgain.setAnim(true,640)
gLineAgain.setMode(GradientLine.LineMode.FLAT)
var isTure = false
gLineBtn2.setOnClickListener {
if (isTure){
isTure = false
gLineAgain.setMode(GradientLine.LineMode.FLAT)
gLineAgain.handleStartAnim()
}else{
isTure = true
gLineAgain.setMode(GradientLine.LineMode.UP)
gLineAgain.handleStartAnim()
}
}
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,37 @@
package com.doyou.cvc.activity
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.manager.DispatchManager
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_gradientgrobar.*
import java.util.*
class GradientProBarActivity : AppCompatActivity() {
private var mRandom: Random = Random()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gradientgrobar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_gradient_probar)
refeshPro.setOnClickListener {
circlePro.setValue(mRandom.nextFloat() * circlePro.maxValue)
}
showScalebtn.setOnClickListener {
DispatchManager.showAct(this, GradientProBarScaleActivity::class.java)
}
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,22 @@
package com.doyou.cvc.activity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_gradientgrobar_scale.*
import java.util.*
class GradientProBarScaleActivity : AppCompatActivity() {
private var mRandom: Random = Random()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_gradientgrobar_scale)
gpb.setPercent(30)
refeshtn.setOnClickListener {
gpb.setPercent(mRandom.nextInt(100))
}
}
}
@@ -0,0 +1,32 @@
package com.doyou.cvc.activity
import android.graphics.Color
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_halfcircle_proview.*
class HalfCircleProViewActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_halfcircle_proview)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_half_circle_proview)
hcpv.setProgress(0f)
hcpv.setGradientColors(intArrayOf(Color.rgb(255, 196, 0), Color.rgb(255, 105, 83)))
hcpv.postDelayed({
hcpv.setProgress(88f)
}, 320)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,37 @@
package com.doyou.cvc.activity
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_horprobar.*
import java.util.*
class HorProBarActivity : AppCompatActivity() {
private var mRandom: Random = Random()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_horprobar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_hor_probar)
hbBar1.setCurrentProgress(0f)
hbBar2.setCurrentProgress(52.3f)
hbBar3.setCurrentProgress(122.5f)
refeshBtn.setOnClickListener {
hbBar1.setCurrentProgress(mRandom.nextFloat() * 100)
hbBar2.setCurrentProgress(mRandom.nextFloat() * 100)
hbBar3.setCurrentProgress(mRandom.nextFloat() * 200)
}
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,53 @@
package com.doyou.cvc.activity
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_horscroll_selectedview.*
/**
* 带有水平滑动的峰值图
* @autor hongbing
* @date 2019/3/25
*/
class HorScrollSelecteViewActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_horscroll_selectedview)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_hor_scroll_selected_view)
var list:MutableList<String> = ArrayList()
list.add("abc")
list.add("def")
list.add("ccc")
list.add("ddd")
list.add("eee")
list.add("fff")
list.add("ggg")
hssv.setData(list)
// hssv.setDefSelectIndex(0)
lftTv.setOnClickListener {
hssv.setAnLeftOffset()
}
rgtTv.setOnClickListener {
hssv.setAnRightOffset()
}
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,25 @@
package com.doyou.cvc.activity
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
class ImgTxtMixtureActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_imgtxt_mixture)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_imgtxt_mixture)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,118 @@
package com.doyou.cvc.activity
import android.graphics.Color
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.dongni.tools.Common
import com.doyou.cv.bean.CircleBean
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_legend_ringview.*
import java.text.DecimalFormat
class LegendRingViewActivity : AppCompatActivity() {
private val percentFormat = DecimalFormat("#.##%")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_legend_ringview)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_legend_ring_view)
syncRingViewData()
}
private fun syncRingViewData() {
lrv_one.setCircleColors(Color.BLACK, Color.CYAN, Color.GREEN, Color.YELLOW)
var valueSum = 60
var mList: MutableList<CircleBean> = ArrayList()
var cb: CircleBean
val rvMax = lrv_one.max
var startPro = 0f
val size = 3
for (i in 0 until size) { // 计算数值占圆环的比例
cb = CircleBean()
cb.startPro = startPro
if (i == 0){
cb.endPro = (12f / valueSum) * rvMax
}else if (i == 1){
cb.endPro = (32f / valueSum) * rvMax
}else{
cb.endPro = (16f / valueSum) * rvMax
}
cb.centerPro = startPro + cb.endPro / 2
startPro += cb.endPro
Common.log_d("201811091554", cb.toString())
mList.add(cb)
}
lrv_one.setData(mList)
var labels: MutableList<String> = ArrayList()
labels.add("项链")
labels.add("戒指")
labels.add("男你拿")
// labels.add("脚链")
lrv_two.setData(mList)
lrv_three.isOpenDebug(true)
lrv_three.setCircleColors(Color.BLACK, Color.CYAN, Color.GREEN, Color.YELLOW)
lrv_three.setData(mList, labels)
btn.setOnClickListener {
labels.clear()
labels.add("嗷嗷嗷")
labels.add("嘿嘿嘿")
// labels.add("哈哈")
labels.add("嘿嘿嘿")
lrv_three.setData(mList, labels)
}
var mList1: MutableList<CircleBean> = ArrayList()
for (i in 0 until 4) { // 计算数值占圆环的比例
cb = CircleBean()
cb.startPro = startPro
if (i == 0){
cb.endPro = (12f / valueSum) * rvMax
}else if (i == 1){
cb.endPro = (32f / valueSum) * rvMax
}else if(i == 2){
cb.endPro = (16f / valueSum) * rvMax
}else{
cb.endPro = (8f / valueSum) * rvMax
}
cb.centerPro = startPro + cb.endPro / 2
startPro += cb.endPro
Common.log_d("201811091554", cb.toString())
mList1.add(cb)
}
var labels1: MutableList<String> = ArrayList()
labels1.add("项链")
labels1.add("戒指")
labels1.add("男你拿")
labels1.add("嘿嘿")
lrv_left.setData(mList1, labels1)
lrv_right.setData(mList, labels)
// lrv_right.setData(null, null)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,25 @@
package com.doyou.cvc.activity
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
class MatrixViewActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_matrix_view)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_matrix_view)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,232 @@
package com.doyou.cvc.activity
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.view.View
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
import com.dongni.tools.EmptyUtils
import com.dongni.tools.ToastUtils
import com.doyou.cvc.R
import com.doyou.cvc.activity.animator.BmpOverturnActivity
import com.doyou.cvc.activity.colorfilter.ColorMainActivity
import com.doyou.cvc.activity.sys.viewpager.ViewPagerTransformerActivity
import com.doyou.cvc.activity.taperchart.ScrollTaperChartActivity
import com.doyou.cvc.activity.taperchart.TaperChartActivity
import com.doyou.cvc.activity.timeruler.TimeRulerActivity
import com.doyou.cvc.activity.touch.CustomScrollViewActivity
import com.doyou.cvc.activity.touch.RefreshViewActivity
import com.doyou.cvc.manager.DispatchManager
import com.doyou.cvc.utils.AppUtils
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.google.android.material.navigation.NavigationView
import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.content_menu_main.*
class MenuMainActivity : AppCompatActivity(), View.OnClickListener, NavigationView.OnNavigationItemSelectedListener {
/**
* 开源库地址
*/
private val WIDGETCASE_GITHUB_URL = "https://github.com/faith-hb/WidgetCase"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_menu_main)
// 避免通过系统安装器打开app,进入到子页面,点击home键导致的启动页重启的问题
if (!isTaskRoot && intent != null) {
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER)
&& intent.action == Intent.ACTION_MAIN) {
finish()
return
}
}
val toolbar: Toolbar = findViewById(R.id.toolbar)
setSupportActionBar(toolbar)
val fab: FloatingActionButton = findViewById(R.id.fab)
fab.setOnClickListener { view ->
Snackbar.make(view, "您好,有问题可以右滑查看我的联系方式或在GitHub上提issue哦", Snackbar.LENGTH_LONG)
.setAction("Action", null).show()
}
val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
val navView: NavigationView = findViewById(R.id.nav_view)
val toggle = ActionBarDrawerToggle(
this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close)
drawerLayout.addDrawerListener(toggle)
toggle.syncState()
navView.setNavigationItemSelectedListener(this)
initListener()
}
private fun initListener() {
selPtoBarTv.setOnClickListener(this)
imgTxtTv.setOnClickListener(this)
ringvTv.setOnClickListener(this)
tcTv.setOnClickListener(this)
htcTv.setOnClickListener(this)
gradientTv.setOnClickListener(this)
lrvTv.setOnClickListener(this)
cpbvTv.setOnClickListener(this)
spbTv.setOnClickListener(this)
hcpvTv.setOnClickListener(this)
matrixTv.setOnClickListener(this)
gpbTv.setOnClickListener(this)
hssvTv.setOnClickListener(this)
horTv.setOnClickListener(this)
waveTv.setOnClickListener(this)
colorMainTv.setOnClickListener(this)
refreshTv.setOnClickListener(this)
timeRulerTv.setOnClickListener(this)
circleBtnTv.setOnClickListener(this)
ctmSvTv.setOnClickListener(this)
vpTransTv.setOnClickListener(this)
imgOverturnTv.setOnClickListener(this)
}
private fun copyContent(str:String?){
if (EmptyUtils.isNotEmpty(str)){
var cm = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
var clipData = ClipData.newPlainText("Label",str)
cm.primaryClip = clipData
}
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.selPtoBarTv -> {
DispatchManager.showAct(this, SectionProBarActivity::class.java)
}
R.id.imgTxtTv -> {
DispatchManager.showAct(this, ImgTxtMixtureActivity::class.java)
}
R.id.ringvTv -> {
DispatchManager.showAct(this, RingViewActivity::class.java)
}
R.id.tcTv -> {
DispatchManager.showAct(this, TaperChartActivity::class.java)
}
R.id.htcTv -> {
DispatchManager.showAct(this, ScrollTaperChartActivity::class.java)
}
R.id.gradientTv -> {
DispatchManager.showAct(this, GradientLineActivity::class.java)
}
R.id.lrvTv -> {
DispatchManager.showAct(this, LegendRingViewActivity::class.java)
}
R.id.cpbvTv -> {
DispatchManager.showAct(this, CircleProgressBarViewActivity::class.java)
}
R.id.spbTv -> {
DispatchManager.showAct(this, ShadowProBarActivity::class.java)
}
R.id.hcpvTv -> {
DispatchManager.showAct(this, HalfCircleProViewActivity::class.java)
}
R.id.matrixTv -> {
DispatchManager.showAct(this, MatrixViewActivity::class.java)
}
R.id.gpbTv -> {
DispatchManager.showAct(this, GradientProBarActivity::class.java)
}
R.id.hssvTv -> {
DispatchManager.showAct(this, HorScrollSelecteViewActivity::class.java)
}
R.id.horTv -> {
DispatchManager.showAct(this, HorProBarActivity::class.java)
}
R.id.waveTv -> {
DispatchManager.showAct(this, WaveViewActivity::class.java)
}
R.id.colorMainTv -> {
DispatchManager.showAct(this, ColorMainActivity::class.java)
}
R.id.refreshTv -> {
DispatchManager.showAct(this, RefreshViewActivity::class.java)
}
R.id.timeRulerTv -> {
DispatchManager.showAct(this, TimeRulerActivity::class.java)
}
R.id.circleBtnTv -> {
DispatchManager.showAct(this, CircleBtnActivity::class.java)
}
R.id.ctmSvTv -> {
DispatchManager.showAct(this, CustomScrollViewActivity::class.java)
}
R.id.vpTransTv -> {
DispatchManager.showAct(this, ViewPagerTransformerActivity::class.java)
}
R.id.imgOverturnTv ->{
DispatchManager.showAct(this, BmpOverturnActivity::class.java)
}
}
}
override fun onBackPressed() {
val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
if (drawerLayout.isDrawerOpen(GravityCompat.START)) {
drawerLayout.closeDrawer(GravityCompat.START)
} else {
super.onBackPressed()
}
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
// Inflate the menu; this adds items to the action bar if it is present.
menuInflater.inflate(R.menu.menu_main, menu)
return false // fasle隐藏menu
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
return when (item.itemId) {
R.id.action_settings -> true
else -> super.onOptionsItemSelected(item)
}
}
override fun onNavigationItemSelected(item: MenuItem): Boolean {
// Handle navigation view item clicks here.
when (item.itemId) {
R.id.nav_wechat -> {
// Handle the camera action
AppUtils.copyContent(this,"faith-hb")
ToastUtils.showLongToast(this, "老铁,加我微信能拉近我们的距离(^_^)")
}
R.id.nav_qq -> {
AppUtils.copyContent(this,"907167515")
ToastUtils.showLongToast(this, "哥们,不加好友怎么聊ಠ_ಠ")
}
// R.id.nav_slideshow -> {
//
// }
// R.id.nav_tools -> {
//
// }
R.id.nav_share -> {
ToastUtils.showShortToast(this,"敬请期待...")
}
R.id.nav_github -> {
AppUtils.openUrlByBrowser(this,WIDGETCASE_GITHUB_URL)
ToastUtils.showLongToast(this, "亲,给星星的银都是爷凸^-^凸")
}
}
val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
drawerLayout.closeDrawer(GravityCompat.START)
return true
}
}
@@ -0,0 +1,193 @@
package com.doyou.cvc.activity
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.dongni.tools.Common
import com.dongni.tools.ToastUtils
import com.doyou.cv.bean.CircleBean
import com.doyou.cvc.R
import com.doyou.cvc.activity.ringview.DoubleTxtActivity
import com.doyou.cvc.activity.ringview.LegendActivity
import kotlinx.android.synthetic.main.activity_ringview.*
import java.text.DecimalFormat
class RingViewActivity : AppCompatActivity() {
private val percentFormat = DecimalFormat("#.##%")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_ringview)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_ring_view)
syncRingViewData()
refeshBtn.setOnClickListener {
ToastUtils.showShortToast(applicationContext,"刷新下")
ringv3.setCenterTxtColor(Color.rgb(255,124,12))
showRingView3()
}
doubleTxtBtn.setOnClickListener {
startActivity(Intent(this,DoubleTxtActivity::class.java))
}
legendBtn.setOnClickListener {
startActivity(Intent(this,LegendActivity::class.java))
}
}
private fun syncRingViewData() {
ringv.showDebugView(true)
var valueOne = 12
var valueTwo = 24
var progress = (valueOne / (valueOne + valueTwo).toFloat()) * 100
ringv.setData(progress, "第一个".plus(' ').plus(percentFormat.format(progress / 100)),
"第二个".plus(' ').plus(percentFormat.format((100 - progress) / 100)))
ringv1.showDebugView(true)
var progress1 = (12 / 24.toFloat()) * 100
ringv1.setData(progress1, "第三个".plus(' ').plus(percentFormat.format(progress1 / 100)),
"第四个".plus(' ').plus(percentFormat.format((100 - progress1) / 100)))
ringv1.setListener { label ->
ToastUtils.showShortToast(this, label)
}
ringv2.showDebugView(true)
var valueSum = 60
var mList: MutableList<CircleBean> = ArrayList<CircleBean>()
var cb: CircleBean
val rvMax = ringv2.max
var startPro = 0f
val size = 3
for (i in 0 until size) { // 计算数值占圆环的比例
cb = CircleBean()
cb.startPro = startPro
when (i) {
0 -> cb.endPro = (12f / valueSum) * rvMax
1 -> cb.endPro = (32f / valueSum) * rvMax
else -> cb.endPro = (16f / valueSum) * rvMax
}
cb.centerPro = startPro + cb.endPro / 2
cb.desc = "di" + i + "ge"
startPro += cb.endPro
Common.log_d("201811091554", cb.toString())
mList.add(cb)
}
ringv2.setData(mList)
ringv2.setListener { label ->
ToastUtils.showShortToast(this, label)
}
showRingView3()
showRingView4()
}
// private val COLORS = intArrayOf(
// Color.rgb(255, 226, 223),
// Color.rgb(255, 195, 187),
// Color.rgb(255, 164, 155),
// Color.rgb(255, 142, 129),
// Color.rgb(255, 104, 89),
// Color.rgb(220, 240, 253),
// Color.rgb(183, 225, 250),
// Color.rgb(148, 211, 250),
// Color.rgb(108, 196, 248),
// Color.rgb(67, 181, 246)
// )
private val COLORS = intArrayOf(
Color.rgb(88, 181, 250), // a:255
Color.rgb(88, 181, 250), // a:215
Color.rgb(88, 181, 250), // a:175
Color.rgb(88, 181, 250), // a:135
Color.rgb(88, 181, 250), // a:95
// Color.rgb(88, 181, 250), // a:45
// 女
Color.rgb(255, 105, 83), // a:255
Color.rgb(255, 105, 83), // a:215
Color.rgb(255, 105, 83), // a:175
Color.rgb(255, 105, 83), // a:135
Color.rgb(255, 105, 83) // a:95
// Color.rgb(255, 105, 83) // a:45)
)
private val ALPHAS = intArrayOf(
255, 215, 175, 135, 95,
255, 215, 175, 135, 95
)
private fun showRingView3() {
ringv3.showDebugView(false)
var valueSum = 100
var mList: MutableList<CircleBean> = ArrayList<CircleBean>()
var cb: CircleBean
val rvMax = ringv3.max
var startPro = 0f
val size = 10
for (i in 0 until size) { // 计算数值占圆环的比例
cb = CircleBean()
cb.startPro = startPro
cb.endPro = (10f / valueSum) * rvMax
cb.centerPro = startPro + cb.endPro / 2
cb.desc = percentFormat.format(0.10f)
startPro += cb.endPro
mList.add(cb)
}
// ringv3.setColors(
// Color.rgb(255, 226, 223),
// Color.rgb(255, 195, 187),
// Color.rgb(255, 164, 155),
// Color.rgb(255, 142, 129),
// Color.rgb(255, 104, 89),
// Color.rgb(220, 240, 253),
// Color.rgb(183, 225, 250),
// Color.rgb(148, 211, 250),
// Color.rgb(108, 196, 248),
// Color.rgb(67, 181, 246)
// )
// ringv3.setColorsArr(COLORS,ALPHAS)
ringv3.setData(mList)
}
private fun showRingView4(){
ringv4.showDebugView(false)
var valueSum = 60
var mList: MutableList<CircleBean> = ArrayList<CircleBean>()
var cb: CircleBean
val rvMax = ringv4.max
var startPro = 0f
val size = 3
for (i in 0 until size) { // 计算数值占圆环的比例
cb = CircleBean()
cb.startPro = startPro
if (i == 0){
cb.endPro = (12f / valueSum) * rvMax
}else if (i == 1){
cb.endPro = (32f / valueSum) * rvMax
}else{
cb.endPro = (16f / valueSum) * rvMax
}
cb.centerPro = startPro + cb.endPro / 2
startPro += cb.endPro
mList.add(cb)
}
ringv4.setCenterTxt("20~29岁","男性")
ringv4.setData(mList)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,72 @@
package com.doyou.cvc.activity
import android.graphics.Color
import android.os.Bundle
import android.view.MenuItem
import android.widget.SeekBar
import androidx.appcompat.app.AppCompatActivity
import com.dongni.tools.Common
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_section_probar.*
/**
* 水平分段进度条
* @autor hongbing
* @date 2019-05-06
*/
class SectionProBarActivity : AppCompatActivity(),SeekBar.OnSeekBarChangeListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_section_probar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_section_probar)
normalSb.setOnSeekBarChangeListener(this)
gradientSb.setOnSeekBarChangeListener(this)
normalSpb.progress = 0 // 注意:不要忘记设置xml中的style,不然进度没有效果
gradientSpb.setGradientBgColor(Color.rgb(15, 252, 255), Color.rgb(0, 150, 255))
gradientSpb.setGradientProColor(Color.rgb(255, 104, 83), Color.rgb(100, 122, 219))
gradientSpb.progress = 0
animSpb.setGradientBgColor(Color.rgb(15, 252, 255), Color.rgb(0, 150, 255))
animSpb.setGradientProColor(Color.rgb(255, 104, 83), Color.rgb(100, 122, 219))
animSpb.setProgressAnim(80f)
animBtn.setOnClickListener {
animSpb.setProgressAnim(80f)
}
}
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
Common.log_d("onProgressChanged", "progress = $progress->fromUser = $fromUser->seekId = ${seekBar!!.id}")
when(seekBar!!.id){
R.id.normalSb ->{
Common.log_d("onProgressChanged","R.id.normalSpb")
normalSpb.progress = progress
}
R.id.gradientSb ->{
Common.log_d("onProgressChanged","R.id.gradientSb")
gradientSpb.progress = progress
}
}
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {
}
override fun onStopTrackingTouch(seekBar: SeekBar?) {
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,31 @@
package com.doyou.cvc.activity
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_shadow_probar.*
class ShadowProBarActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_shadow_probar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_shadow_probar)
spbIng.setProgressWithAnimation(76f)
endBtn.setOnClickListener {
spbIng.setProgressWithAnimation(100f)
spbIng.setProStatus(true)
}
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,47 @@
package com.doyou.cvc.activity
import android.os.Bundle
import android.view.MenuItem
import android.widget.SeekBar
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_wave_view.*
/**
* 水波纹进度测试类
* @autor hongbing
* @date 2019-07-22
*/
class WaveViewActivity : AppCompatActivity(), SeekBar.OnSeekBarChangeListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_wave_view)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_wave_view)
seekBar.setOnSeekBarChangeListener(this)
seekBar.progress = 50
}
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
circleWv.setPercent(progress)
proTv.text = progress.toString().plus("%")
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {
}
override fun onStopTrackingTouch(seekBar: SeekBar?) {
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,54 @@
package com.doyou.cvc.activity.animator
import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_bmp_overturn.*
class BmpOverturnActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_bmp_overturn)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_animator_bmp_overturn)
bovBtn.setOnClickListener {
bov.propReset()
startAnim(false)
}
startAnim(true)
}
private fun startAnim(isFirst: Boolean) {
val bottomFlipAnimator = ObjectAnimator.ofFloat(bov, bov.propIsBottomFlip, 30f)
bottomFlipAnimator.duration = 1000
val topFlipAnimator = ObjectAnimator.ofFloat(bov, bov.propIsTopFlip, -30f)
topFlipAnimator.startDelay = 200
topFlipAnimator.duration = 1000
val rotationFlipAnimator = ObjectAnimator.ofFloat(bov, bov.propFlipRotation, 270f)
rotationFlipAnimator.startDelay = 200
rotationFlipAnimator.duration = 1000
val animatorSet = AnimatorSet()
animatorSet.playSequentially(bottomFlipAnimator, rotationFlipAnimator, topFlipAnimator)
if (isFirst) {
animatorSet.startDelay = 1000
}
animatorSet.start()
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,82 @@
package com.doyou.cvc.activity.colorfilter
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
import android.os.Bundle
import android.view.MenuItem
import android.widget.SeekBar
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_color_hue.*
/**
* 图片色度、饱和度、亮度
* @autor hongbing
* @date 2019-07-24
*/
class ColorHueActivity : AppCompatActivity(), SeekBar.OnSeekBarChangeListener {
private var colorMatrix: ColorMatrix? = null
private var mHueMatrix: ColorMatrix? = null
private var mSaturationMatrix: ColorMatrix? = null
private var mLightnessMatrix: ColorMatrix? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_color_hue)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_color_hue)
colorMatrix = ColorMatrix()
mHueMatrix = ColorMatrix()
mSaturationMatrix = ColorMatrix()
mLightnessMatrix = ColorMatrix()
bar_Hue.setOnSeekBarChangeListener(this)
bar_Saturation.setOnSeekBarChangeListener(this)
bar_Lightness.setOnSeekBarChangeListener(this)
}
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
var hueValue = (bar_Hue.progress - 128f) * 1.0f / 128f * 180
var saturationValue = bar_Saturation.progress / 128f
var lightnessValue = bar_Lightness.progress / 128f
// 设置色相
mHueMatrix!!.reset()
mHueMatrix!!.setRotate(0, hueValue)
mHueMatrix!!.setRotate(1, hueValue)
mHueMatrix!!.setRotate(2, hueValue)
// 设置饱和度
mSaturationMatrix!!.reset()
mSaturationMatrix!!.setSaturation(saturationValue)
// 亮度
mLightnessMatrix!!.reset()
mLightnessMatrix!!.setScale(lightnessValue, lightnessValue, lightnessValue, 1f)
colorMatrix!!.reset()
// 效果叠加
colorMatrix!!.postConcat(mHueMatrix)
colorMatrix!!.postConcat(mSaturationMatrix)
colorMatrix!!.postConcat(mLightnessMatrix)
jingyHueIv.colorFilter = ColorMatrixColorFilter(colorMatrix)
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {
}
override fun onStopTrackingTouch(seekBar: SeekBar?) {
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,43 @@
package com.doyou.cvc.activity.colorfilter
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.manager.DispatchManager
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_color_main.*
/**
* 图片滤镜分流页
* @autor hongbing
* @date 2019-07-24
*/
class ColorMainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_color_main)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_color_main)
matrixBtn.setOnClickListener {
DispatchManager.showAct(this, ColorMatrixActivity::class.java)
}
hueBtn.setOnClickListener {
DispatchManager.showAct(this, ColorHueActivity::class.java)
}
filterBtn.setOnClickListener {
}
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,60 @@
package com.doyou.cvc.activity.colorfilter
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
import android.os.Bundle
import android.view.MenuItem
import android.widget.SeekBar
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_color_matrix.*
/**
* 图片滤镜
* @desc 通过修改颜色矩阵来改变它的颜色效果
* @autor hongbing
* @date 2019-07-24
*/
class ColorMatrixActivity : AppCompatActivity(), SeekBar.OnSeekBarChangeListener {
private var colorMatrix: ColorMatrix? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_color_matrix)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_color_matrix)
colorMatrix = ColorMatrix()
colorMatrix!!.setScale(calculate(128), calculate(128), calculate(128), calculate(128))
jingyIv.colorFilter = ColorMatrixColorFilter(colorMatrix)
bar_R.setOnSeekBarChangeListener(this)
bar_G.setOnSeekBarChangeListener(this)
bar_B.setOnSeekBarChangeListener(this)
bar_A.setOnSeekBarChangeListener(this)
}
private fun calculate(progress: Int): Float {
return progress / 128f
}
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
colorMatrix?.setScale(calculate(bar_R.progress), calculate(bar_G.progress), calculate(bar_B.progress), calculate(bar_A.progress))
jingyIv.colorFilter = ColorMatrixColorFilter(colorMatrix)
}
override fun onStartTrackingTouch(seekBar: SeekBar?) {
}
override fun onStopTrackingTouch(seekBar: SeekBar?) {
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,163 @@
package com.doyou.cvc.activity.listener;
import android.content.ContentResolver;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.view.OrientationEventListener;
import android.view.Surface;
import android.view.WindowManager;
import com.doyou.cv.utils.LogUtil;
import java.lang.ref.WeakReference;
/**
* 屏幕旋转监听
*
* @autor hongbing
* @date 2019-10-08
*/
public class OrientationListener extends OrientationEventListener implements SettingsSystemObserver.Callback {
private Context mContext;
private WeakReference<Callback> mCallback;
public int mOrientation;
private boolean mOrientationChanging = false;
private int mAccelerometerRotation;
private int mOrientationToChange;
private SettingsSystemObserver mAccelerometerRotationObserver;
private static final int ORIENTATION_CHANG = 1;
private static final int ORIENTATION_CHANGED = 2;
@Override
public void mtcSettingsSystemChanged(SettingsSystemObserver observer) {
try {
mAccelerometerRotation = Settings.System.getInt(
mContext.getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION);
LogUtil.logD("旋转", "mtcSettingsSystemChanged...");
} catch (Settings.SettingNotFoundException e) {
mAccelerometerRotation = 1;
e.printStackTrace();
}
}
public interface Callback {
void orientationChanged(int orientation, int previousOrientation);
}
public OrientationListener(Context context) {
super(context);
mContext = context;
mAccelerometerRotationObserver = new SettingsSystemObserver(null);
mAccelerometerRotationObserver.setCallback(this);
}
@Override
public void onOrientationChanged(int orientation) {
LogUtil.logD("旋转", "orientation = " + orientation + "->mOrientationChanging = " + mOrientationChanging);
// if (mAccelerometerRotation == 0) return;
Callback callback = getCallback();
if (callback == null) {
return;
}
int newOrientation = Surface.ROTATION_0;
if (orientation >= 45 && orientation < 135) {
newOrientation = Surface.ROTATION_90;
} else if (orientation >= 135 && orientation < 225) {
newOrientation = Surface.ROTATION_180;
} else if (orientation >= 225 && orientation < 315) {
newOrientation = Surface.ROTATION_270;
}
if (mOrientationChanging) { // 旋转中
if (newOrientation != mOrientationToChange) {
sHandler.removeMessages(ORIENTATION_CHANGED);
sHandler.removeMessages(ORIENTATION_CHANG);
mOrientationToChange = newOrientation;
Message msg = Message.obtain(sHandler);
msg.what = ORIENTATION_CHANG;
msg.obj = this;
msg.arg1 = newOrientation;
sHandler.sendMessageDelayed(msg,500);
}
} else {
setOrientation(newOrientation);
}
}
public void setCallback(Callback callback) {
mCallback = (callback == null) ? null : new WeakReference<>(callback);
}
public Callback getCallback() {
return (mCallback == null) ? null : mCallback.get();
}
@Override
public void enable() {
mOrientation = ((WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
ContentResolver contentResolver = mContext.getContentResolver();
try {
mAccelerometerRotation = Settings.System.getInt(contentResolver,
Settings.System.ACCELEROMETER_ROTATION);
} catch (Exception e) {
mAccelerometerRotation = 1;
e.printStackTrace();
}
mAccelerometerRotationObserver.register(contentResolver, Settings.System.ACCELEROMETER_ROTATION);
super.enable();
}
@Override
public void disable() {
super.disable();
mAccelerometerRotationObserver.unregister(mContext.getContentResolver());
}
private void setOrientation(int orientation) {
if (mOrientation != orientation) {
int previousOrientation = mOrientation;
mOrientation = orientation;
Callback callback = getCallback();
if (callback != null) {
callback.orientationChanged(orientation, previousOrientation);
}
mOrientationChanging = true;
mOrientationToChange = orientation;
Message msg = Message.obtain(sHandler);
msg.what = ORIENTATION_CHANGED;
msg.obj = this;
sHandler.sendMessageDelayed(msg,500);
} else {
mOrientationChanging = false;
}
}
private void orientationChanged() {
mOrientationChanging = false;
}
private static Handler sHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case ORIENTATION_CHANG: {
OrientationListener listener = (OrientationListener) msg.obj;
listener.setOrientation(msg.arg1);
break;
}
case ORIENTATION_CHANGED: {
OrientationListener listener = (OrientationListener) msg.obj;
listener.orientationChanged();
break;
}
}
}
};
}
@@ -0,0 +1,52 @@
package com.doyou.cvc.activity.listener;
import android.content.ContentResolver;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
import android.provider.Settings;
import java.lang.ref.WeakReference;
/**
* @autor hongbing
* @date 2019-10-08
*/
public class SettingsSystemObserver extends ContentObserver {
public String mName;
private WeakReference<Callback> mCallback;
public interface Callback {
void mtcSettingsSystemChanged(SettingsSystemObserver observer);
}
public SettingsSystemObserver(Handler handler) {
super(handler);
}
public void setCallback(Callback callback) {
mCallback = (callback == null) ? null : new WeakReference<Callback>(callback);
}
public Callback getCallback() {
return (mCallback == null) ? null : mCallback.get();
}
public void register(ContentResolver contentResolver, String name) {
Uri uri = Settings.System.getUriFor(name);
contentResolver.registerContentObserver(uri, false, this);
mName = name;
}
public void unregister(ContentResolver contentResolver) {
contentResolver.unregisterContentObserver(this);
}
public void onChange(boolean selfChange) {
Callback callback = getCallback();
if (callback != null) {
callback.mtcSettingsSystemChanged(this);
}
}
}
@@ -0,0 +1,63 @@
package com.doyou.cvc.activity.ringview
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cv.bean.CircleBean
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_ringview_doubletxt.*
/**
* 中间显示两行文字
* @autor hongbing
* @date 2019/3/21
*/
class DoubleTxtActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_ringview_doubletxt)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_ring_view_double)
showRingView()
updateDoubleBtn.setOnClickListener {
showRingView()
}
}
private fun showRingView() {
doubleTxtRv.showDebugView(false)
var valueSum = 60
var mList: MutableList<CircleBean> = ArrayList()
var cb: CircleBean
val rvMax = doubleTxtRv.max
var startPro = 0f
val size = 3
for (i in 0 until size) { // 计算数值占圆环的比例
cb = CircleBean()
cb.startPro = startPro
when (i) {
0 -> cb.endPro = (12f / valueSum) * rvMax
1 -> cb.endPro = (32f / valueSum) * rvMax
else -> cb.endPro = (16f / valueSum) * rvMax
}
cb.centerPro = startPro + cb.endPro / 2
startPro += cb.endPro
mList.add(cb)
}
doubleTxtRv.setData(mList)
doubleTxtRv.setCenterTxt("20~29岁", "女性")
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,89 @@
package com.doyou.cvc.activity.ringview
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.dongni.tools.ToastUtils
import com.doyou.cv.bean.CircleBean
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_ringview_legend.*
import java.text.DecimalFormat
/**
* 中间显示两行文字 & 显示图例
* @autor hongbing
* @date 2019/3/21
*/
class LegendActivity : AppCompatActivity() {
private val percentFormat = DecimalFormat("#.##%")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_ringview_legend)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_ring_view_legend)
showRingView()
setLegendData()
legendRefBtn.setOnClickListener {
showRingView()
var labels: MutableList<String> = ArrayList()
labels.add("手镯")
labels.add("胸针")
labels.add("其他")
legendLv.setData(labels, legendRv.colors)
}
legendLv.setLegendListener {
ToastUtils.showShortToast(this, "点击了$it")
}
}
private fun showRingView() {
legendRv.showDebugView(false)
var valueSum = 60
var mList: MutableList<CircleBean> = ArrayList()
var cb: CircleBean
val rvMax = legendRv.max
var startPro = 0f
val size = 3
for (i in 0 until size) { // 计算数值占圆环的比例
cb = CircleBean()
cb.startPro = startPro
when (i) {
0 -> cb.endPro = (12f / valueSum) * rvMax
1 -> cb.endPro = (32f / valueSum) * rvMax
else -> cb.endPro = (16f / valueSum) * rvMax
}
cb.centerPro = startPro + cb.endPro / 2
cb.desc = percentFormat.format(cb.endPro / rvMax)
startPro += cb.endPro
mList.add(cb)
}
legendRv.setData(mList)
legendRv.setCenterTxt("20~29岁", "女性")
legendRv.setListener { label ->
ToastUtils.showShortToast(this, label)
}
}
private fun setLegendData() {
var labels: MutableList<String> = ArrayList()
labels.add("项链")
labels.add("戒指")
labels.add("男你拿")
legendLv.setData(labels, legendRv.colors)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,61 @@
package com.doyou.cvc.activity.sys.viewpager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.collection.LruCache
import androidx.viewpager.widget.PagerAdapter
import com.doyou.cvc.R
/**
*
* @autor hongbing
* @date 2019-11-14
*/
class ViewPagerAdapter : PagerAdapter {
private var images: List<Int>? = null
private var mCachePagerItem = LruCache<Int, ImageView>(5)
constructor(images: List<Int>?) : super() {
this.images = images
}
fun getImages(): List<Int>? {
return images
}
override fun getCount(): Int {
return images!!.size
}
override fun isViewFromObject(view: View, `object`: Any): Boolean {
return view == `object`
}
override fun getItemPosition(`object`: Any): Int {
return POSITION_UNCHANGED
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
container.removeView(`object` as ImageView)
}
override fun instantiateItem(container: ViewGroup, position: Int): Any {
var imgV = mCachePagerItem.get(position)
if (imgV == null) {
imgV = LayoutInflater.from(container.context).inflate(R.layout.viewpager_itemview, null) as ImageView
imgV.tag = position
mCachePagerItem.put(position, imgV)
}
if (images!![position] == 0) {
imgV.setImageResource(R.mipmap.ic_launcher)
} else {
imgV.setImageResource(images!![position])
}
container.addView(imgV)
return imgV
}
}
@@ -0,0 +1,57 @@
package com.doyou.cvc.activity.sys.viewpager
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.dongni.tools.DensityUtil
import com.doyou.cv.widget.sys.viewpager.transformer.ScaleAlphaTransformer
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_viewpage_transformer.*
/**
* viewpager页面过度转换器功能测试类
* @autor hongbing
* @date 2019-11-14
*/
class ViewPagerTransformerActivity : AppCompatActivity() {
private var mAdapter: ViewPagerAdapter? = null
private val images = intArrayOf(
R.drawable.fighting,
R.drawable.fighting,
R.drawable.fighting,
R.drawable.fighting,
R.drawable.fighting
)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_viewpage_transformer)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_viewpager_transformer)
initViewPager()
}
private fun initViewPager() {
// 小提示:将viewpager父类的touch事件交到viewpager本身上去,可以达到一屏多显的效果
transformerContainer.setOnTouchListener { _, event ->
return@setOnTouchListener transformerVp.onTouchEvent(event)
}
transformerVp.offscreenPageLimit = 3
transformerVp.pageMargin = DensityUtil.dp2px(45f)
// 自定义转换器
transformerVp.setPageTransformer(true, ScaleAlphaTransformer())
mAdapter = ViewPagerAdapter(images.asList())
transformerVp.adapter = mAdapter
transformerVp.currentItem = 0
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,56 @@
package com.doyou.cvc.activity.taperchart
import android.graphics.Color
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_taperchart_contrast.*
import java.util.*
class ContrastActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_taperchart_contrast)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_taper_chart_campair)
syncTaperChartData()
}
private fun syncTaperChartData() {
cont_tchart.offSetXy(48f)
cont_tchart.isShowDebugView(true)
cont_tchart.setTaperColors(Color.GREEN, Color.DKGRAY)
var keys: MutableList<String> = ArrayList()
for (i in 0 until 6) {
if (i % 2 == 0) {
keys.add("asdasd")
} else {
keys.add("".plus(i + 1).plus(""))
}
}
var values: MutableList<Float> = ArrayList()
for (i in 0 until 6) {
if (i % 2 == 0) {
values.add(0f)
} else {
values.add(Random().nextInt(100).toFloat())
}
}
val labels = arrayOf("30min以内", "30-45min", "45min以上")
cont_tchart.setData(keys, values, labels)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,49 @@
package com.doyou.cvc.activity.taperchart
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_taperchart_scroll.*
import java.util.*
/**
* 带有水平滑动的峰值图
* @autor hongbing
* @date 2019/3/25
*/
class ScrollTaperChartActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_taperchart_scroll)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_hor_taper_chart)
syncTaperChartData()
}
private fun syncTaperChartData() {
hor_tchart.offSetXy(48f)
var keys: MutableList<String> = ArrayList()
for (i in 0 until 12) {
keys.add("".plus(i + 1).plus(""))
}
var values: MutableList<Float> = ArrayList()
for (i in 0 until 12) {
values.add(Random().nextInt(100).toFloat())
}
hor_tchart.setData(keys, values)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,193 @@
package com.doyou.cvc.activity.taperchart
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cv.widget.taperchart.TaperChart
import com.doyou.cvc.R
import kotlinx.android.synthetic.main.activity_taperchart.*
import java.util.*
class TaperChartActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_taperchart)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_taper_chart)
syncTaperChartData(1)
syncTaperChartData(2)
syncTaperChartData(3)
syncTaperChartData(4)
syncTaperChartLayoutData()
syncTaperChartLayoutDataDwColor()
syncTaperChartLayoutDataDwColorCompar()
var isTrue = true
label5.setOnClickListener {
if (isTrue) {
isTrue = false
tchartLayout.setEmpty()
} else {
isTrue = true
syncTaperChartLayoutData()
}
}
contrastBtn.setOnClickListener {
startActivity(Intent(this, ContrastActivity::class.java))
}
}
private fun syncTaperChartData(type: Int) {
when (type) {
1 -> {
tchartV.isShowDebugView(false)
tchartV.setTaperColors(Color.GREEN,Color.GRAY,Color.RED)
var keys: MutableList<String> = ArrayList()
for (i in 0 until 3) {
keys.add("".plus(i + 1).plus(""))
}
var values: MutableList<Float> = ArrayList()
for (i in 0 until 3) {
values.add((i + 1) * Random().nextInt(100).toFloat())
}
tchartV.setData(keys, values)
}
2 -> {
tchartV1.offSetXy(96f)
tchartV1.isShowDebugView(true)
tchartV1.setHintIsRatio(true)
var keys: MutableList<String> = ArrayList()
for (i in 0 until 4) {
keys.add("".plus(i + 1).plus(""))
}
var values: MutableList<Float> = ArrayList()
for (i in 0 until 4) {
values.add((i + 1) * Random().nextInt(100).toFloat())
}
val labels = arrayOf("男性", "女性")
tchartV1.setData(keys, values,labels)
}
3 ->{
tchartV2.offSetXy(48f)
tchartV2.isShowDebugView(true)
var keys: MutableList<String> = ArrayList()
for (i in 0 until 4) {
keys.add("".plus(i + 1).plus(""))
}
var values: MutableList<Float> = ArrayList()
for (i in 0 until 4) {
// values.add(Random().nextInt(80).toFloat())
values.add(Random().nextFloat())
// values.add(0.2f * (i + 1))
}
val labels = arrayOf("男性", "女性")
tchartV2.setData(keys, values,labels)
}
4 ->{
tchartV3.offSetXy(48f)
tchartV3.isShowDebugView(true)
tchartV3.setTaperColors(Color.GREEN, Color.CYAN)
var keys: MutableList<String> = ArrayList()
for (i in 0 until 6) {
keys.add("".plus(i + 1).plus(""))
}
var values: MutableList<Float> = ArrayList()
for (i in 0 until 6) {
values.add(Random().nextInt(100).toFloat())
}
val labels = arrayOf("30min以内", "30-45min","45min以上")
tchartV3.setData(keys, values,labels)
}
}
}
private fun syncTaperChartLayoutData() {
tchartLayout.chart.isDrawTopValue = true
var keys: MutableList<String> = ArrayList()
var labels: MutableList<String> = ArrayList()
for (i in 0 until 3) {
keys.add("".plus(i + 1).plus(""))
}
labels.add("( <30分 )")
labels.add("( 30分-45分 )")
labels.add("( >45分 )")
var values: MutableList<Float> = ArrayList()
for (i in 0 until 3) {
values.add((i + 1) * Random().nextInt(100).toFloat())
}
tchartLayout.setData(keys, values, labels)
}
private fun syncTaperChartLayoutDataDwColor(){
tchartLayout1.setColors(Color.GREEN,Color.LTGRAY,Color.RED)
var keys: MutableList<String> = ArrayList()
var labels: MutableList<String> = ArrayList()
for (i in 0 until 3) {
keys.add("".plus(i + 1).plus(""))
}
labels.add("( <30分 )")
labels.add("( 30分-45分 )")
labels.add("( >45分 )")
var values: MutableList<Float> = ArrayList()
for (i in 0 until 3) {
values.add((i + 1) * Random().nextInt(100).toFloat())
}
var btmLabels = arrayOf("第一次","第二次","第三次")
tchartLayout1.setData(keys, values, btmLabels,"",labels,false)
}
/**
* 峰值图对比
*/
private fun syncTaperChartLayoutDataDwColorCompar() {
tchartLayout2.chart.setTcMode(TaperChart.Mode.Fifth.ordinal)
tchartLayout2.chart.offSetXy(48f)
tchartLayout2.chart.isShowDebugView(false)
tchartLayout2.chart.isDrawTopValue = true
tchartLayout2.setColors(Color.GREEN, Color.BLUE)
var keys: MutableList<String> = ArrayList()
for (i in 0 until 6) {
keys.add("".plus(i + 1).plus(""))
}
var values: MutableList<Float> = ArrayList()
for (i in 0 until 6) {
values.add(Random().nextInt(100).toFloat())
}
val labels = arrayOf("30min以内", "30-45min", "45min以上")
var btmLabels: MutableList<String> = ArrayList()
btmLabels.add("( <30分 )")
btmLabels.add("( 30分-45分 )")
btmLabels.add("( >45分 )")
tchartLayout2.setData(keys, values, labels, "", btmLabels,true)
// tchartLayout2.setData(keys, values)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,113 @@
package com.doyou.cvc.activity.timeruler;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.doyou.cv.widget.timeruler.TimeRulerView;
import com.doyou.cvc.R;
import java.util.ArrayList;
import java.util.Calendar;
public class TimeRulerActivity extends AppCompatActivity {
private TimeRulerView mTimeRulerView;
private TimeRulerPickScaleView mTimeRulerPickScaleView;
private TextView mShowTimeTv;
private Button mResetBtn;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_time_ruler);
initView();
initListener();
}
private void initView() {
mTimeRulerView = findViewById(R.id.ruler_id_timeRulerView);
mTimeRulerPickScaleView = findViewById(R.id.ruler_id_timeRulerPickView);
mShowTimeTv = findViewById(R.id.time_tv);
mResetBtn = findViewById(R.id.btn_reset);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.title_timeruler_view);
initTime();
}
private void initTime() {
// 包括连续片段和不连续片段,开发者自己设置
Calendar startCalendar1 = Calendar.getInstance();
startCalendar1.set(Calendar.HOUR_OF_DAY, 0);
startCalendar1.set(Calendar.MINUTE, 0);
startCalendar1.set(Calendar.SECOND, 0);
startCalendar1.set(Calendar.MILLISECOND, 0);
Calendar stopCalendar1 = Calendar.getInstance();
stopCalendar1.set(Calendar.HOUR_OF_DAY, 2);
stopCalendar1.set(Calendar.MINUTE, 0);
stopCalendar1.set(Calendar.SECOND, 0);
stopCalendar1.set(Calendar.MILLISECOND, 0);
Calendar startCalendar2 = Calendar.getInstance();
startCalendar2.set(Calendar.HOUR_OF_DAY, 3);
startCalendar2.set(Calendar.MINUTE, 0);
startCalendar2.set(Calendar.SECOND, 0);
startCalendar2.set(Calendar.MILLISECOND, 0);
Calendar stopCalendar2 = Calendar.getInstance();
stopCalendar2.set(Calendar.HOUR_OF_DAY, 23);
stopCalendar2.set(Calendar.MINUTE, 59);
stopCalendar2.set(Calendar.SECOND, 59);
stopCalendar2.set(Calendar.MILLISECOND, 999);
TimeRulerView.TimeInfo timeInfo1 = new TimeRulerView.TimeInfo(startCalendar1, stopCalendar1);
TimeRulerView.TimeInfo timeInfo2 = new TimeRulerView.TimeInfo(startCalendar2, stopCalendar2);
ArrayList<TimeRulerView.TimeInfo> timeInfos = new ArrayList<>();
timeInfos.add(timeInfo1);
timeInfos.add(timeInfo2);
mTimeRulerView.setTimeInfos(timeInfos);
mTimeRulerView.invalidate();
}
private void initListener() {
mTimeRulerPickScaleView.setTimeRulerPickViewListener(totalTimePerCell -> {
//刻度选择回调
mTimeRulerView.setTotalCellNum(totalTimePerCell);
});
mTimeRulerView.setOnChooseTimeListener(calendar -> mShowTimeTv.setText(String.format("你选中的时间:%02d:%02d:%02d", calendar.get(Calendar.HOUR_OF_DAY),
calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND))));
mResetBtn.setOnClickListener(v -> {
mTimeRulerView.reset();
initTime();
});
}
/**
* 设置时间
*
* @param calendar
*/
public void setRulerTime(Calendar calendar) {
if (!mTimeRulerView.isMoving()) {
mTimeRulerView.setTime(calendar);
mTimeRulerView.invalidate();
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home){
finish();
}
return super.onOptionsItemSelected(item);
}
}
@@ -0,0 +1,139 @@
package com.doyou.cvc.activity.timeruler;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.doyou.cvc.R;
/**
* @author Amosnail
* @date 2017/4/11
* @desc 时间刻度缩放选择
*/
public class TimeRulerPickScaleView extends View {
private Bitmap mBitmap;
private boolean isDownRight = false;
private Paint mBitmapPaint;
private float mMaxTotalTimePerCell;
private float mMinTotalTimePerCell;
private float mDegree;
private float mCurrentTotalTimePerCell;
private float mDownY;
private float mTouchY;
private float mBitmapPosition;//图片top位置
private RectF mClickRecF;
private float mWidth;
private float mHeight;
public TimeRulerPickScaleView(Context context) {
this(context, null);
}
public TimeRulerPickScaleView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public TimeRulerPickScaleView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.TimeRulerPickScaleView);
initDefaultValue(typedArray);
init(context);
}
private void initDefaultValue(@NonNull TypedArray typedArray) {
mMaxTotalTimePerCell = typedArray.getFloat(R.styleable.TimeRulerPickScaleView_maxTotalTimePerCell, 288);
mMinTotalTimePerCell = typedArray.getFloat(R.styleable.TimeRulerPickScaleView_minTotalTimePerCell, 24);
}
private void init(Context context) {
mBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.timerulerview_move);
mWidth = getResources().getDimension(R.dimen.timerulerpick_width);
mHeight = getResources().getDimension(R.dimen.timerulerpick_height);
mBitmapPaint = new Paint();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (mClickRecF == null) {
mClickRecF = new RectF();
mBitmapPosition = mHeight / 2.0f - mBitmap.getHeight() / 2.0f;
mClickRecF.left = 0;
mClickRecF.right = mBitmap.getWidth();
mClickRecF.top = mBitmapPosition;
mClickRecF.bottom = mBitmapPosition + mBitmap.getHeight();
mDegree = (mMaxTotalTimePerCell - mMinTotalTimePerCell) / (mHeight - mBitmap.getHeight());
mCurrentTotalTimePerCell = mMaxTotalTimePerCell - mDegree * mBitmapPosition;
}
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mClickRecF.top = mBitmapPosition;
mClickRecF.bottom = mBitmapPosition + mBitmap.getHeight();
if (mClickRecF.contains(event.getX(), event.getY())) {
isDownRight = true;
}
mDownY = event.getY();
return true;
case MotionEvent.ACTION_MOVE:
if (isDownRight) {
mTouchY = event.getY();
float diff = mTouchY - mDownY;
mBitmapPosition += diff;
if (mBitmapPosition < 0) {
mBitmapPosition = 0;
} else if (mBitmapPosition > (mHeight - mBitmap.getHeight())) {
mBitmapPosition = mHeight - mBitmap.getHeight();
}
mCurrentTotalTimePerCell = mMaxTotalTimePerCell - mDegree * mBitmapPosition;
if (timeRulerPickViewListener != null) {
timeRulerPickViewListener.onTotalTimePerCellChanged((int) mCurrentTotalTimePerCell);
}
invalidate();
mDownY = mTouchY;
}
return true;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
isDownRight = false;
//传递最后的值
return true;
default:
return super.onTouchEvent(event);
}
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawBitmap(mBitmap, mWidth / 2.0f - mBitmap.getWidth() / 2.0f, mBitmapPosition, mBitmapPaint);
}
private TimeRulerPickViewListener timeRulerPickViewListener;
public void setTimeRulerPickViewListener(TimeRulerPickViewListener timeRulerPickViewListener) {
this.timeRulerPickViewListener = timeRulerPickViewListener;
}
public interface TimeRulerPickViewListener {
void onTotalTimePerCellChanged(int totalTimePerCell);
}
}
@@ -0,0 +1,30 @@
package com.doyou.cvc.activity.touch
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
/**
* 自定义滑动控件(支持多指,支持惯性滑动)
* @autor hongbing
* @date 2019-08-22
*/
class CustomScrollViewActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.touch_custom_scrollview_activity)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_customscrollview_view)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,30 @@
package com.doyou.cvc.activity.touch
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import com.doyou.cvc.R
/**
* 仿网易一元夺宝下拉刷新效果
* @autor hongbing
* @date 2019-08-22
*/
class RefreshViewActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.touch_refreshview_activity)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setTitle(R.string.title_refresh_view)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
android.R.id.home -> {
finish()
}
}
return super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,12 @@
package com.doyou.cvc.manager
import android.app.Activity
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
object DispatchManager{
fun showAct(act: Activity, cls: Class<out AppCompatActivity>) {
act.startActivity(Intent(act, cls))
}
}
@@ -0,0 +1,44 @@
package com.doyou.cvc.utils;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.dongni.tools.EmptyUtils;
/**
* 工具类
*
* @autor hongbing
* @date 2019-11-27
*/
public final class AppUtils {
/**
* 复制文本
*
* @param context
* @param content
*/
public static void copyContent(Context context, String content) {
if (EmptyUtils.isNotEmpty(content)) {
ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clipData = ClipData.newPlainText("Label", content);
cm.setPrimaryClip(clipData);
}
}
/**
* 调用系统浏览器打开指定网址
*
* @param context
* @param url
*/
public static void openUrlByBrowser(Context context, String url) {
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
context.startActivity(intent);
}
}
+21
View File
@@ -0,0 +1,21 @@
kotlin
项目中的log打印选择:
appCommon.log_*
library:LogUtil.log*
集合转数组:
数组转集合:array.toList() as List<T> | array.toList() as ArrayList<String> | Arrays.asList(names) | Arrays.asList("a", "b", "c")
项目支持androidxhttps://developer.android.com/jetpack/androidx/migrate#blog_posts
Android x 原始支持库 API 软件包映射到 androidx 命名空间:
* https://developer.android.com/jetpack/androidx/migrate?hl=zh-cn
视频转GIF
保存配置:
1、图片大小:360*782
2、播放速度:16帧/每秒 符合android的视觉设计
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M15,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM6,10L6,7L4,7v3L1,10v2h3v3h2v-3h3v-2L6,10zM15,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF000000"
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z"/>
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z"/>
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
</vector>
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z"/>
</vector>
@@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0"/>
<item
android:color="#00000000"
android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1"/>
</vector>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#fff"/>
<stroke
android:width="1dp"
android:color="#008FC9"/>
<corners android:radius="8dp"/>
</shape>
@@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z"/>
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8"/>
</vector>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CCFF6464" />
<corners android:radius="2dp" />
</shape>
@@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="#009688"
android:endColor="#00695C"
android:startColor="#4DB6AC"
android:type="linear"/>
</shape>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="20dp" />
<stroke
android:width="2dp"
android:color="#CCCCCC" />
<solid android:color="#FFFFFF" />
</shape>
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:background="@color/testBg"
tools:context=".activity.animator.BmpOverturnActivity">
<com.doyou.cv.widget.animator.BmpOverturnView
android:id="@+id/bov"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/bovBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="once again"
android:textAllCaps="false"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/bov" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.CircleProgressBarViewActivity">
<com.doyou.cv.widget.progress.circle.CircleProgressBarView
android:id="@+id/oneCpbv"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_marginTop="30dp"
app:centerProgressTextColor="#FF6953"
app:centerProgressTextSize="20sp"
app:circleBgStrokeWidth="5dp"
app:isDrawCenterProgressText="true"
app:progressStrokeWidth="8dp"
app:targetNumSize="15sp"
app:targetTextColor="#999999"
app:target_text="测试一下"/>
<com.doyou.cv.widget.progress.circle.CircleProgressBarView
android:id="@+id/twoCpbv"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_marginTop="30dp"
app:centerProgressTextColor="#FF6953"
app:centerProgressTextSize="20sp"
app:circleBgStrokeWidth="5dp"
app:isDrawCenterProgressText="true"
app:layout_constraintTop_toBottomOf="@id/oneCpbv"
app:progressStrokeWidth="8dp"
app:targetNumSize="15sp"
app:targetTextColor="#999999"
app:target_text="测试一下"/>
<LinearLayout
android:id="@+id/mockCpbvLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@id/twoCpbv">
<com.doyou.cv.widget.progress.circle.CircleProgressBarView
android:id="@+id/threeCpbv"
android:layout_width="match_parent"
android:layout_height="160dp"
app:centerProgressTextColor="#FF6953"
app:centerProgressTextSize="20sp"
app:circleBgStrokeWidth="5dp"
app:isDrawCenterProgressText="true"
app:progressStrokeWidth="8dp"
app:targetNumSize="15sp"
app:targetTextColor="#999999"
app:target_text="测试一下"/>
<Button
android:id="@+id/setFinishBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="24dp"
android:text="设置完成"/>
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintTop_toBottomOf="@+id/mockCpbvLayout"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:background="@color/testBg"
tools:context=".activity.CircleBtnActivity">
<com.doyou.cv.widget.view.CircleButton
android:id="@+id/videoCb"
android:layout_width="70dp"
android:layout_height="70dp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/audioCb"
app:layout_constraintTop_toTopOf="@id/audioCb"
tools:src="@mipmap/call_answer_video" />
<com.doyou.cv.widget.view.CircleButton
android:id="@+id/audioCb"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/videoCb"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/videoCb"
app:layout_constraintRight_toLeftOf="@id/cameraCb"
app:layout_constraintTop_toTopOf="parent"
tools:src="@mipmap/call_answer_audio" />
<com.doyou.cv.widget.view.CircleButton
android:id="@+id/cameraCb"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/audioCb"
app:layout_constraintLeft_toRightOf="@id/audioCb"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/audioCb"
tools:src="@mipmap/call_camera_on_normal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="(小提示:试着旋转手机看看)"
android:textColor="@color/page_font"
android:textSize="@dimen/page_font_size"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/audioCb" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/jingyHueIv"
android:layout_width="match_parent"
android:layout_height="230dp"
android:scaleType="centerCrop"
android:src="@drawable/fighting"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="32dp"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:paddingTop="8dp"
android:paddingRight="24dp"
android:paddingBottom="8dp">
<TextView
android:layout_width="90dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:text="色相:"
android:textColor="@color/txt_black"
android:textSize="16dp"/>
<SeekBar
android:id="@+id/bar_Hue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:max="255"
android:progress="128"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:paddingTop="8dp"
android:paddingRight="24dp"
android:paddingBottom="8dp">
<TextView
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="彩度(饱和):"
android:textColor="@color/txt_black"
android:textSize="16dp"/>
<SeekBar
android:id="@+id/bar_Saturation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:max="255"
android:progress="128"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:paddingTop="8dp"
android:paddingRight="24dp"
android:paddingBottom="8dp">
<TextView
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="明度(亮度):"
android:textColor="@color/txt_black"
android:textSize="16dp"/>
<SeekBar
android:id="@+id/bar_Lightness"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:max="255"
android:progress="128"/>
</LinearLayout>
</LinearLayout>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="24dp">
<Button
android:id="@+id/matrixBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ColorMatrix"
android:textAllCaps="false"/>
<Button
android:id="@+id/hueBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="ColorHue"
android:textAllCaps="false"/>
<Button
android:id="@+id/filterBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="ColorFilter"
android:textAllCaps="false"/>
</LinearLayout>
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/jingyIv"
android:layout_width="match_parent"
android:layout_height="230dp"
android:scaleType="centerCrop"
android:src="@drawable/fighting"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="32dp"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:paddingTop="8dp"
android:paddingRight="24dp"
android:paddingBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginTop="-5dp"
android:text="R:"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<SeekBar
android:id="@+id/bar_R"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:max="255"
android:progress="128"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:paddingTop="8dp"
android:paddingRight="24dp"
android:paddingBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="-5dp"
android:text="G:"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<SeekBar
android:id="@+id/bar_G"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:max="255"
android:progress="128"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:paddingTop="8dp"
android:paddingRight="24dp"
android:paddingBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="-5dp"
android:text="B:"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<SeekBar
android:id="@+id/bar_B"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:max="255"
android:progress="128"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:paddingTop="8dp"
android:paddingRight="24dp"
android:paddingBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="-5dp"
android:text="A:"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<SeekBar
android:id="@+id/bar_A"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:max="255"
android:progress="128"/>
</LinearLayout>
</LinearLayout>
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="24dp"
tools:context=".activity.GradientProBarActivity">
<com.doyou.cv.widget.progress.circle.CircleProgress
android:id="@+id/circlePro"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_marginTop="24dp"
app:antiAlias="true"
app:arcWidth="15dp"
app:bgArcColor="@android:color/darker_gray"
app:bgArcWidth="2dp"
app:dottedLineWidth="12dp"
app:foreEndColor="#F4F200"
app:foreStartColor="#FE6615"
app:hintSize="15sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:maxValue="100"
app:startAngle="135"
app:sweepAngle="270"
app:textOffsetPercentInRadius="0.5"
app:unit="目标100KM"
app:unitColor="@android:color/darker_gray"
app:unitSize="15sp"
app:value="75"
app:valueColor="#FFCC1E"
app:valueSize="80sp"/>
<Button
android:id="@+id/refeshPro"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="点我刷新进度"
app:layout_constraintTop_toBottomOf="@id/circlePro"/>
<Button
android:id="@+id/showScalebtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="点我刷新进度"
app:layout_constraintTop_toBottomOf="@id/refeshPro"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="24dp"
tools:context=".release.GradientProBarActivity">
<com.doyou.cv.widget.progress.circle.GradientProBar
android:id="@+id/gpb"
android:layout_width="340dp"
android:layout_height="340dp"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<Button
android:id="@+id/refeshtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="点我刷新进度"
app:layout_constraintTop_toBottomOf="@id/gpb"/>
</androidx.constraintlayout.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="24dp"
tools:context=".activity.GradientLineActivity">
<com.doyou.cv.widget.GradientLine
android:id="@+id/gLineUp"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:gl_mode="down"/>
<com.doyou.cv.widget.GradientLine
android:id="@+id/gLineFlat"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:gl_mode="flat"/>
<com.doyou.cv.widget.GradientLine
android:id="@+id/gLineDown"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_marginTop="24dp"
android:layout_marginRight="16dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:gl_mode="up"/>
<Button
android:id="@+id/gLineBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="32dp"
android:layout_marginRight="16dp"
android:text="动画再来一次"
app:layout_constraintTop_toBottomOf="@id/gLineDown"/>
<com.doyou.cv.widget.GradientLine
android:id="@+id/gLineAgain"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/gLineBtn"
tools:gl_mode="up"/>
<Button
android:id="@+id/gLineBtn2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="32dp"
android:layout_marginRight="16dp"
android:text="快速点击切换图形模式"
app:layout_constraintTop_toBottomOf="@id/gLineAgain"/>
<Space
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintTop_toBottomOf="@+id/gLineBtn2"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".activity.HalfCircleProViewActivity">
<com.doyou.cv.widget.HalfCircleProView
android:id="@+id/hcpv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activity.ShadowProBarActivity">
<com.doyou.cv.widget.progress.horbar.HorProBar
android:id="@+id/hbBar1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="24dp" />
<com.doyou.cv.widget.progress.horbar.HorProBar
android:id="@+id/hbBar2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:pro_height="5dp"
android:layout_marginTop="24dp" />
<com.doyou.cv.widget.progress.horbar.HorProBar
android:id="@+id/hbBar3"
android:layout_width="130dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="24dp"
app:pro_width="80dp"/>
<Button
android:id="@+id/refeshBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginTop="24dp"
android:layout_marginRight="24dp"
android:text="刷新"
app:layout_constraintTop_toBottomOf="@id/spbIng" />
</LinearLayout>
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/topTv"
android:layout_width="match_parent"
android:layout_height="20dp"
android:gravity="center"
android:text="V"/>
<TextView
android:id="@+id/lftTv"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_marginLeft="2dp"
android:gravity="center"
android:text=""
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/topTv"/>
<TextView
android:id="@+id/rgtTv"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_marginRight="2dp"
android:gravity="center"
android:text=""
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/topTv"/>
<com.doyou.cv.widget.HorScrollSelectedView
android:id="@+id/hssv"
android:layout_width="0dp"
android:layout_height="60dp"
app:layout_constraintLeft_toRightOf="@id/lftTv"
app:layout_constraintRight_toLeftOf="@id/rgtTv"
app:layout_constraintTop_toBottomOf="@id/topTv"
app:seeSize="5"/>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.doyou.cv.widget.view.ImgTxtMixtureView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</FrameLayout>
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activity.LegendRingViewActivity">
<!--android:background="@color/colorAccent"-->
<com.doyou.cv.widget.progress.circle.CircleView
android:id="@+id/lrv_one"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="168dp"
android:max="360"
android:paddingBottom="@dimen/ringv_pading"
android:paddingTop="@dimen/ringv_pading"
app:cv_boderW="7dp"
app:cv_center_style="txt"
app:cv_center_txt="风格"
app:cv_center_txt_color="#2a2a2a"
app:cv_center_txt_size="14sp"/>
<com.doyou.cv.widget.progress.circle.CircleView
android:id="@+id/lrv_two"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="168dp"
android:layout_marginTop="24dp"
android:max="360"
android:paddingBottom="@dimen/ringv_pading"
android:paddingTop="@dimen/ringv_pading"
app:cv_boderW="7dp"
app:cv_cengter_txt_margin="2dp"
app:cv_center_style="double_txt"
app:cv_center_txt="风格 样式"
app:cv_center_txt_color="#2a2a2a"
app:cv_center_txt_size="14sp"/>
<com.doyou.cv.widget.progress.ring.LegendRingView
android:id="@+id/lrv_three"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:lrv_circle_center_txt="哈哈"
app:lrv_circle_center_txt_color="@color/colorAccent"
app:lrv_circle_center_txt_size="15sp"
app:lrv_circle_height="168dp"
app:lrv_circle_paddingBottom="@dimen/ringv_pading"
app:lrv_circle_paddingTop="@dimen/ringv_pading"
app:lrv_legend_font_color="#2a2a2a"
app:lrv_legend_font_size="12sp"
app:lrv_legend_labelAndPoint_margin="4dp"/>
<Button
android:id="@+id/btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="再来一次"/>
<LinearLayout
android:id="@+id/lrv_wgtLl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_marginTop="24dp">
<com.doyou.cv.widget.progress.ring.LegendRingView
android:id="@+id/lrv_left"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:lrv_circle_boderW="5dp"
app:lrv_circle_center_style="double_txt"
app:lrv_circle_center_txt="看货 材质"
app:lrv_circle_center_txt_size="10sp"
app:lrv_circle_height="128dp"
app:lrv_circle_paddingBottom="12dp"
app:lrv_circle_paddingTop="12dp"
app:lrv_legend_circle_margin="4dp"
app:lrv_legend_columnW="36dp"
app:lrv_legend_font_size="10sp"
app:lrv_legend_vertical_margin="6dp"
app:lrv_offset_left="6dp"/>
<com.doyou.cv.widget.progress.ring.LegendRingView
android:id="@+id/lrv_right"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:lrv_circle_boderW="5dp"
app:lrv_circle_center_style="txt"
app:lrv_circle_center_txt="材质"
app:lrv_circle_center_txt_size="10sp"
app:lrv_circle_height="128dp"
app:lrv_circle_paddingBottom="12dp"
app:lrv_circle_paddingTop="12dp"
app:lrv_legend_circle_margin="4dp"
app:lrv_legend_columnW="36dp"
app:lrv_legend_font_size="10sp"
app:lrv_legend_vertical_margin="6dp"
app:lrv_offset_left="6dp"/>
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="32dp"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.MatrixViewActivity">
<com.doyou.cv.widget.touch.MatrixView
android:id="@+id/miv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_menu_main"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_menu_main"
app:menu="@menu/activity_menu_main_drawer"/>
</androidx.drawerlayout.widget.DrawerLayout>
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.RingViewActivity">
<com.doyou.cv.widget.progress.ring.RingView
android:id="@+id/ringv"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="168dp"
android:max="360"
android:paddingBottom="@dimen/ringv_pading"
android:paddingTop="@dimen/ringv_pading"
android:progress="32"
app:rv_center_bmp="@drawable/widget_icon_buy"
app:rv_mode="circle"
app:rv_reachedColor="@color/colorAccent"
app:rv_reachedHeight="6dp"
app:rv_textColor="#2a2a2a"
app:rv_textSize="10sp"
app:rv_unReachedColor="@color/colorPrimary"
app:rv_unReachedHeight="6dp"/>
<com.doyou.cv.widget.progress.ring.RingView
android:id="@+id/ringv1"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="168dp"
android:max="360"
android:paddingBottom="@dimen/ringv_pading"
android:paddingTop="@dimen/ringv_pading"
android:progress="32"
app:layout_constraintTop_toBottomOf="@id/ringv"
app:rv_center_bmp="@drawable/widget_icon_buy"
app:rv_mode="circle"
app:rv_outer_enable="true"
app:rv_reachedColor="@color/colorAccent"
app:rv_reachedHeight="6dp"
app:rv_textColor="#2a2a2a"
app:rv_textSize="10sp"
app:rv_unReachedColor="@color/colorPrimary"
app:rv_unReachedHeight="6dp"/>
<com.doyou.cv.widget.progress.ring.RingView
android:id="@+id/ringv2"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="168dp"
android:layout_marginTop="@dimen/ringv_pading"
android:max="360"
android:paddingBottom="@dimen/ringv_pading"
android:progress="32"
app:layout_constraintTop_toBottomOf="@id/ringv1"
app:rv_center_bmp="@drawable/widget_icon_person"
app:rv_center_style="txt"
app:rv_center_txt="这是啥"
app:rv_center_txt_color="@color/colorPrimary"
app:rv_center_txt_size="14sp"
app:rv_mode="more"
app:rv_outer_enable="true"
app:rv_reachedColor="@color/colorAccent"
app:rv_reachedHeight="6dp"
app:rv_textColor="#2a2a2a"
app:rv_textSize="10sp"
app:rv_unReachedColor="@color/colorPrimary"
app:rv_unReachedHeight="6dp"/>
<com.doyou.cv.widget.progress.ring.RingView
android:id="@+id/ringv3"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="176dp"
android:layout_marginTop="@dimen/ringv_pading"
android:max="360"
android:paddingBottom="@dimen/ringv_pading"
android:progress="32"
app:layout_constraintTop_toBottomOf="@id/ringv2"
app:rv_center_bmp="@drawable/widget_icon_group"
app:rv_center_imgtxt_margin="6dp"
app:rv_center_style="all"
app:rv_center_txt="客群分布"
app:rv_center_txt_color="#2a2a2a"
app:rv_center_txt_size="14sp"
app:rv_mode="group"
app:rv_need_cut="true"
app:rv_outer_enable="true"
app:rv_reachedColor="@color/colorAccent"
app:rv_reachedHeight="6dp"
app:rv_textColor="#2a2a2a"
app:rv_textSize="10sp"
app:rv_unReachedColor="@android:color/white"
app:rv_unReachedHeight="6dp"/>
<com.doyou.cv.widget.progress.ring.RingView
android:id="@+id/ringv4"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="168dp"
android:layout_marginTop="@dimen/ringv_pading"
android:max="360"
android:paddingBottom="@dimen/ringv_pading"
android:progress="32"
app:layout_constraintTop_toBottomOf="@id/ringv3"
app:rv_center_style="double_txt"
app:rv_center_txt_color="@color/colorPrimary"
app:rv_center_txt_size="14sp"
app:rv_mode="more"
app:rv_outer_enable="true"
app:rv_reachedColor="@color/colorAccent"
app:rv_reachedHeight="6dp"
app:rv_textColor="#2a2a2a"
app:rv_textSize="10sp"
app:rv_unReachedColor="@color/colorPrimary"
app:rv_unReachedHeight="6dp"/>
<Button
android:id="@+id/refeshBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/ringv_pading"
android:text="刷新下"
app:layout_constraintTop_toBottomOf="@id/ringv4"/>
<Button
android:id="@+id/doubleTxtBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/ringv_pading"
android:text="圆环中间显示两行文字"
app:layout_constraintTop_toBottomOf="@id/refeshBtn"/>
<Button
android:id="@+id/legendBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/ringv_pading"
android:text="携带图例的圆环"
app:layout_constraintTop_toBottomOf="@id/doubleTxtBtn"/>
<Space
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintTop_toBottomOf="@+id/legendBtn"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.RingViewActivity">
<com.doyou.cv.widget.progress.ring.RingView
android:id="@+id/doubleTxtRv"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="168dp"
android:layout_marginTop="@dimen/ringv_pading"
android:max="360"
android:paddingBottom="@dimen/ringv_pading"
android:progress="32"
app:layout_constraintTop_toTopOf="parent"
app:rv_center_style="double_txt"
app:rv_center_txt_color="@color/colorPrimary"
app:rv_center_txt_size="14sp"
app:rv_mode="more"
app:rv_outer_enable="true"
app:rv_reachedColor="@color/colorAccent"
app:rv_reachedHeight="6dp"
app:rv_textColor="#2a2a2a"
app:rv_textSize="10sp"
app:rv_unReachedColor="@color/colorPrimary"
app:rv_unReachedHeight="6dp"/>
<Button
android:id="@+id/updateDoubleBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/ringv_pading"
android:text="刷新下"
app:layout_constraintTop_toBottomOf="@id/doubleTxtRv"/>
<Space
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintTop_toBottomOf="@+id/updateDoubleBtn"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.ringview.LegendActivity">
<!--android:background="#ccc"-->
<com.doyou.cv.widget.progress.ring.RingView
android:id="@+id/legendRv"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="168dp"
android:layout_marginTop="@dimen/ringv_pading"
android:max="360"
android:paddingBottom="12dp"
android:progress="32"
app:layout_constraintTop_toTopOf="parent"
app:rv_center_style="double_txt"
app:rv_center_txt_color="@color/colorPrimary"
app:rv_center_txt_size="14sp"
app:rv_mode="more"
app:rv_outer_enable="true"
app:rv_reachedColor="@color/colorAccent"
app:rv_reachedHeight="6dp"
app:rv_textColor="#2a2a2a"
app:rv_textSize="10sp"
app:rv_unReachedColor="@color/colorPrimary"
app:rv_unReachedHeight="6dp"/>
<!--android:background="#cfcfcf"-->
<com.doyou.cv.widget.legend.LegendView
android:id="@+id/legendLv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/legendRv"
app:lv_legend_circle_margin="4dp"
app:lv_legend_columnW="36dp"
app:lv_legend_font_size="10sp"
app:lv_legend_offset_left="6dp"
app:lv_legend_vertical_margin="6dp"/>
<Button
android:id="@+id/legendRefBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/ringv_pading"
android:text="刷新下"
app:layout_constraintTop_toBottomOf="@id/legendLv"/>
<Space
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintTop_toBottomOf="@+id/legendRefBtn"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.SectionProBarActivity">
<!-- 普通分段进度条-->
<LinearLayout
android:id="@+id/normalLl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@id/line1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="普通分段进度条"
android:textColor="@color/page_font"
android:textSize="@dimen/page_font_size" />
<com.doyou.cv.widget.progress.horbar.SectionProBar
android:id="@+id/normalSpb"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="100"
android:paddingLeft="24dp"
android:paddingTop="32dp"
android:paddingRight="24dp"
app:hbv_reachedColor="#FF6853"
app:hbv_reachedHeight="5dp"
app:hbv_unReachedColor="#58b5fa"
app:hbv_unReachedHeight="5dp" />
<SeekBar
android:id="@+id/normalSb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="36dp"
android:layout_marginTop="24dp"
android:layout_marginRight="36dp" />
</LinearLayout>
<View
android:id="@+id/line1"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"
android:background="#E6E6FA"
app:layout_constraintBottom_toTopOf="@id/gradientLl"
app:layout_constraintTop_toBottomOf="@id/normalLl" />
<!-- 渐变分段进度条-->
<LinearLayout
android:id="@+id/gradientLl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@id/line2"
app:layout_constraintTop_toBottomOf="@id/line1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="渐变分段进度条"
android:textColor="@color/page_font"
android:textSize="@dimen/page_font_size" />
<com.doyou.cv.widget.progress.horbar.SectionProBar
android:id="@+id/gradientSpb"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="100"
android:paddingLeft="24dp"
android:paddingTop="32dp"
android:paddingRight="24dp"
app:hbv_reachedHeight="5dp"
app:hbv_unReachedHeight="5dp" />
<SeekBar
android:id="@+id/gradientSb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="36dp"
android:layout_marginTop="24dp"
android:layout_marginRight="36dp" />
</LinearLayout>
<View
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"
android:background="#E6E6FA"
app:layout_constraintBottom_toTopOf="@id/animLl"
app:layout_constraintTop_toBottomOf="@id/gradientLl" />
<!-- 渐变分段进度条-->
<LinearLayout
android:id="@+id/animLl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/line2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="分段进度条效果"
android:textColor="@color/page_font"
android:textSize="@dimen/page_font_size" />
<com.doyou.cv.widget.progress.horbar.SectionProBar
android:id="@+id/animSpb"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="100"
android:paddingLeft="24dp"
android:paddingTop="32dp"
android:paddingRight="24dp"
app:hbv_reachedHeight="5dp"
app:hbv_unReachedHeight="5dp" />
<Button
android:id="@+id/animBtn"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="Again"
android:textAllCaps="false" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activity.ShadowProBarActivity">
<com.doyou.cv.widget.progress.horbar.ShadowProBar
android:id="@+id/spbIng"
android:layout_width="match_parent"
android:layout_height="7dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:layout_marginTop="24dp"/>
<Button
android:id="@+id/endBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:layout_marginTop="24dp"
android:text="完成"
app:layout_constraintTop_toBottomOf="@id/spbIng"/>
</LinearLayout>
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.taperchart.TaperChartActivity">
<TextView
android:id="@+id/label1"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:text="3张图,3个label"
android:textColor="#2a2a2a"
app:layout_constraintTop_toTopOf="parent"/>
<com.doyou.cv.widget.taperchart.TaperChart
android:id="@+id/tchartV"
android:layout_width="match_parent"
android:layout_height="@dimen/taper_chart_h"
android:layout_marginLeft="12dp"
android:layout_marginTop="12dp"
android:layout_marginRight="12dp"
app:is_draw_topvalue="true"
app:layout_constraintTop_toBottomOf="@id/label1"
app:tc_axis_txtsize="@dimen/taper_text_size"
app:tc_inner_space="28dp"
app:tc_quad_x_offset="42dp"/>
<TextView
android:id="@+id/label2"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:text="4张图,2个label(显示水平测试线)"
android:textColor="#2a2a2a"
app:layout_constraintTop_toBottomOf="@id/tchartV"/>
<com.doyou.cv.widget.taperchart.TaperChart
android:id="@+id/tchartV1"
android:layout_width="match_parent"
android:layout_height="@dimen/taper_chart_h"
android:layout_marginLeft="12dp"
android:layout_marginTop="12dp"
android:layout_marginRight="12dp"
app:is_draw_topvalue="true"
app:layout_constraintTop_toBottomOf="@id/label2"
app:tc_inner_space="28dp"
app:tc_mode="fourth"
app:tc_quad_x_offset="42dp"/>
<TextView
android:id="@+id/label3"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:text="4张图,2个label(y轴百分比)"
android:textColor="#2a2a2a"
app:layout_constraintTop_toBottomOf="@id/tchartV1"/>
<com.doyou.cv.widget.taperchart.TaperChart
android:id="@+id/tchartV2"
android:layout_width="match_parent"
android:layout_height="@dimen/taper_chart_h"
android:layout_marginLeft="12dp"
android:layout_marginTop="12dp"
android:layout_marginRight="12dp"
app:layout_constraintTop_toBottomOf="@id/label3"
app:tc_inner_space="28dp"
app:tc_mode="fourth"
app:tc_quad_x_offset="42dp"
app:tc_yaxis_percent="true"/>
<TextView
android:id="@+id/label4"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:text="6张图,3个label"
android:textColor="#2a2a2a"
app:layout_constraintTop_toBottomOf="@id/tchartV2"/>
<com.doyou.cv.widget.taperchart.TaperChart
android:id="@+id/tchartV3"
android:layout_width="match_parent"
android:layout_height="@dimen/taper_chart_h"
android:layout_marginLeft="12dp"
android:layout_marginTop="12dp"
android:layout_marginRight="12dp"
app:layout_constraintTop_toBottomOf="@id/label4"
app:tc_inner_space="28dp"
app:tc_mode="fifth"
app:tc_quad_x_offset="42dp"/>
<TextView
android:id="@+id/label5"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:text="3张图,3个label(两行)"
android:textColor="#2a2a2a"
app:layout_constraintTop_toBottomOf="@id/tchartV3"/>
<com.doyou.cv.widget.taperchart.TaperChartLayout
android:id="@+id/tchartLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintTop_toBottomOf="@id/label5"/>
<TextView
android:id="@+id/label6"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:text="3张图,3个label(两行 + 自定义颜色 + 单位显示)"
android:textColor="#2a2a2a"
app:layout_constraintTop_toBottomOf="@id/tchartLayout"/>
<com.doyou.cv.widget.taperchart.TaperChartLayout
android:id="@+id/tchartLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintTop_toBottomOf="@id/label6"/>
<TextView
android:id="@+id/label7"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:text="3张图,6个label(两行 + 自定义颜色 + 单位显示)"
android:textColor="#2a2a2a"
app:layout_constraintTop_toBottomOf="@id/tchartLayout1"/>
<com.doyou.cv.widget.taperchart.TaperChartLayout
android:id="@+id/tchartLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintTop_toBottomOf="@id/label7"/>
<Button
android:id="@+id/contrastBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="对比峰值图"
app:layout_constraintTop_toBottomOf="@id/tchartLayout2"/>
<Space
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintTop_toBottomOf="@+id/contrastBtn"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.taperchart.ContrastActivity">
<TextView
android:id="@+id/cont_label"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:text="6张图,3个label"
android:textColor="#2a2a2a"
app:layout_constraintTop_toTopOf="parent"/>
<com.doyou.cv.widget.taperchart.TaperChart
android:id="@+id/cont_tchart"
android:layout_width="match_parent"
android:layout_height="@dimen/taper_chart_h"
android:layout_marginLeft="12dp"
android:layout_marginTop="12dp"
android:layout_marginRight="12dp"
app:is_draw_topvalue="true"
app:layout_constraintTop_toBottomOf="@id/cont_label"
app:tc_inner_space="28dp"
app:tc_mode="fifth"
app:tc_quad_x_offset="42dp"/>
<Button
android:id="@+id/cont_RefeshBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="刷新"
app:layout_constraintTop_toBottomOf="@id/cont_tchart"/>
<Space
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintTop_toBottomOf="@+id/cont_RefeshBtn"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.taperchart.ScrollTaperChartActivity">
<TextView
android:id="@+id/hor_label"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#cfcfcf"
android:gravity="center"
android:paddingLeft="24dp"
android:text="支持水平滑动的峰值图"
android:textColor="#2a2a2a"
app:layout_constraintTop_toTopOf="parent"/>
<com.doyou.cv.widget.taperchart.HorTaperChart
android:id="@+id/hor_tchart"
android:layout_width="match_parent"
android:layout_height="@dimen/taper_chart_h"
android:layout_marginLeft="12dp"
android:layout_marginTop="12dp"
android:layout_marginRight="12dp"
app:htc_is_draw_topValue="true"
app:layout_constraintTop_toBottomOf="@id/hor_label"
app:htc_inner_space="28dp"
app:htc_quad_x_offset="42dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.timeruler.TimeRulerActivity">
<com.doyou.cv.widget.timeruler.TimeRulerView
android:id="@+id/ruler_id_timeRulerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
app:bottomLineColor="#D7D7D7"
app:bottomLineStrokeWidth="1dp"
app:contentHeight="@dimen/timerulerview_contentheight"
app:middleLineColor="#50AC37"
app:scaleColor="#D7D7D7"
app:scaleLineStrokeWidth="1dp"
app:selectBackgroundColor="#E2FCD9"
app:showtimeHeight="@dimen/timerulerview_showtimeheight"
app:textColors="#626262"
app:textFontSize="10sp"
app:topLineColor="#D7D7D7"
app:topLineStrokeWidth="1dp"
app:widthPerScale="35dp" /><!--app:totalTimePerCell="halfHour"-->
<FrameLayout
android:id="@+id/ruler_id_timerulerpick"
android:layout_width="24dp"
android:layout_height="144dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="14dp">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/timerulerpick_bg" />
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@mipmap/timerulerview_plus" />
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="bottom"
android:src="@mipmap/timerulerview_minus" />
<com.doyou.cvc.activity.timeruler.TimeRulerPickScaleView
android:id="@+id/ruler_id_timeRulerPickView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<TextView
android:id="@+id/time_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:layout_centerHorizontal="true"
android:layout_below="@+id/ruler_id_timeRulerView"/>
<Button
android:id="@+id/btn_reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/time_tv"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:text="重置"/>
</RelativeLayout>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/transformerContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
tools:context=".activity.sys.viewpager.ViewPagerTransformerActivity">
<androidx.viewpager.widget.ViewPager
android:id="@+id/transformerVp"
android:layout_width="200dp"
android:layout_height="280dp"
android:clipChildren="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<com.doyou.cv.widget.wave.CircleWaveView
android:id="@+id/circleWv"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_marginTop="32dp"/>
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"/>
<TextView
android:id="@+id/proTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:gravity="center"
android:textColor="@color/txt_black"
android:textSize="32dp"
tools:text="50%"/>
</LinearLayout>
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.MenuMainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_menu_main"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".activity.MenuMainActivity"
tools:showIn="@layout/app_bar_menu_main">
<TextView
android:id="@+id/titleTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="74dp"
android:gravity="center"
android:text="功能分布如下"
android:textColor="@color/page_font"
android:textSize="@dimen/page_font_size"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexDirection="row"
app:flexWrap="wrap"
app:layout_constraintTop_toBottomOf="@id/titleTv">
<TextView
android:id="@+id/selPtoBarTv"
style="@style/TextViewStyle"
android:text="SectionProBar" />
<TextView
android:id="@+id/imgTxtTv"
style="@style/TextViewStyle"
android:text="图文混排" />
<TextView
android:id="@+id/ringvTv"
style="@style/TextViewStyle"
android:text="RingView" />
<TextView
android:id="@+id/tcTv"
style="@style/TextViewStyle"
android:text="TaperChart" />
<TextView
android:id="@+id/htcTv"
style="@style/TextViewStyle"
android:text="HorTaperChart" />
<TextView
android:id="@+id/gradientTv"
style="@style/TextViewStyle"
android:text="GradientLine" />
<TextView
android:id="@+id/lrvTv"
style="@style/TextViewStyle"
android:text="LegendRingView" />
<TextView
android:id="@+id/cpbvTv"
style="@style/TextViewStyle"
android:text="CircleProgressBarView" />
<TextView
android:id="@+id/spbTv"
style="@style/TextViewStyle"
android:text="ShadowProBar" />
<TextView
android:id="@+id/hcpvTv"
style="@style/TextViewStyle"
android:text="HalfCircleProView" />
<TextView
android:id="@+id/matrixTv"
style="@style/TextViewStyle"
android:text="MatrixView" />
<TextView
android:id="@+id/gpbTv"
style="@style/TextViewStyle"
android:text="GradientProBar" />
<TextView
android:id="@+id/hssvTv"
style="@style/TextViewStyle"
android:text="HorScrollSelectedView" />
<TextView
android:id="@+id/horTv"
style="@style/TextViewStyle"
android:text="HorProBar" />
<TextView
android:id="@+id/waveTv"
style="@style/TextViewStyle"
android:text="WaveView" />
<TextView
android:id="@+id/colorMainTv"
style="@style/TextViewStyle"
android:text="图片滤镜" />
<TextView
android:id="@+id/refreshTv"
style="@style/TextViewStyle"
android:text="RefreshView" />
<TextView
android:id="@+id/timeRulerTv"
style="@style/TextViewStyle"
android:text="TimeRulerView" />
<TextView
android:id="@+id/circleBtnTv"
style="@style/TextViewStyle"
android:text="CircleButton" />
<TextView
android:id="@+id/ctmSvTv"
style="@style/TextViewStyle"
android:text="CustomScrollView" />
<TextView
android:id="@+id/vpTransTv"
style="@style/TextViewStyle"
android:text="ViewPagerTransformer" />
<TextView
android:id="@+id/imgOverturnTv"
style="@style/TextViewStyle"
android:text="@string/title_animator_bmp_overturn" />
</com.google.android.flexbox.FlexboxLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="80dp"
android:layout_height="80dp"
android:contentDescription="@string/nav_header_desc"
android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@drawable/fighting"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/nav_header_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nav_header_subtitle"/>
</LinearLayout>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<com.doyou.cv.widget.touch.CustomScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadeScrollbars="true"
android:scrollbars="vertical"
android:scrollbarThumbVertical="@drawable/scrollbar_shape"
tools:context=".activity.touch.CustomScrollViewActivity" />
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<com.doyou.cv.widget.touch.RefreshView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.touch.RefreshViewActivity"/>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY">
</ImageView>
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_wechat"
android:icon="@drawable/ic_menu_add_friend"
android:title="@string/menu_wechat"/>
<item
android:id="@+id/nav_qq"
android:icon="@drawable/ic_menu_add_friend"
android:title="@string/menu_qq"/>
<!--<item-->
<!--android:id="@+id/nav_slideshow"-->
<!--android:icon="@drawable/ic_menu_slideshow"-->
<!--android:title="@string/menu_slideshow"/>-->
<!--<item-->
<!--android:id="@+id/nav_tools"-->
<!--android:icon="@drawable/ic_menu_manage"-->
<!--android:title="@string/menu_tools"/>-->
</group>
<item android:title="Communicate">
<menu>
<item
android:id="@+id/nav_share"
android:icon="@drawable/ic_menu_share"
android:title="@string/menu_share"/>
<item
android:id="@+id/nav_github"
android:icon="@drawable/ic_menu_send"
android:title="@string/menu_github"/>
</menu>
</item>
</menu>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never"/>
</menu>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Some files were not shown because too many files have changed in this diff Show More