该三方开源库从github fork过来,主要将底层接口调用的实现修改成鸿蒙接口的实现,将三方库鸿蒙化,供开发鸿蒙应用的开发者使用
fork版本号/日期:1.4.0 / 2018/4/25
# Circular Music ProgressBar
## Description
[demo演示]()
原项目Readme地址:https://github.com/aliab/circular-music-progressbar/blob/master/README.md
项目移植状态:支持组件所有基本功能
完成度:100%
调用差异:由于鸿蒙的Path接口没有提供approximate方法,导致动画差值器中Path差值器无法使用
This Circular Progress bar is a designed and made for music players that need beautiful music progress bar.
## Usage
To use Circular Music ProgressBar you must add it as a dependency in your Gradle build:
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
Step 2. Add the dependency or har
```groovy
dependencies {
compile project(path: ':library')
}
```
or
```
allprojects{
repositories{
mavenCentral()
}
}
implementation 'io.openharmony.tpc.thirdlib:circular-music-progressbar:1.0.1'
```
Then add the view to your layout:
```xml
<info.abdolahi.CircularMusicProgressBar
ohos:id="$+id:album_art"
ohos:height="300vp"
ohos:width="match_parent"
ohos:image_src="$media:maron5"
ohos:layout_alignment="center"
ohos:top_margin="40vp"
ohos:border_color="#00796B"
ohos:border_width="2vp"
ohos:centercircle_diammterer=".97"
ohos:draw_anticlockwise="false"
ohos:enable_touch="true"
ohos:progress_music_color="#80CBC4"
ohos:progress_startAngle="-90"
/>
```
| Name | Type | Default | Description |
|:----:|:----:|:-------:|:-----------:|
|border_color|Color|Color.BLACK| ProgressBar background color |
|border_width|dimen|2| Thicknes of progress bar |
|centercircle_diammterer|Float|0.805f| Number between 0 and 1, that change diammeter of album art image|
|progress_music_color|Color|Color.BLUE| ProgressBar active state color |
|progress_startAngle|Float| 0 | Number between 0 and 360 that describe Start angle of progress bar active state |
|draw_anticlockwise|Boolean| false | If set to true, progress will be Anti-Clockwise |
|enable_touch|Boolean| false | If set to true, progress will track along the touch |
## Public Methods
| Name | Description |
|:----:|:----:|
|setValue(float)| Change value of progress with animation|
|setValueWithNoAnimation(float)| Change value of progress with animation|
|setBorderProgressColor(Color)| Set progressbar active state color |
|setBorderColor(Color)| Set progressbar non-active state color |
|setProgressAnimationState(boolean)| Change state of progress value animation. set it to 'false' if you don't want any animation|
|setProgressAnimatorInterpolator(TimeInterpolator)| Change interpolator of animation to get more effect on animation|
|setOnCircularBarChangeListener(OnCircularSeekBarChangeListener listener)|Get an update if user want to seek to position or click on image|
Note: Because I extended ImageView you can use all ImageView public methods too.
Limitations
-----------
* The ScaleType is always ScaleMode.CLIP_CENTER and you'll get an exception if you try to change it. This is (currently) by design as it's perfectly fine for music album art.
* If you use an image loading library like Picasso or Glide, you need to disable their fade animations to avoid messed up images. For Picasso use the `noFade()` option, for Glide use `dontAnimate()`. If you want to keep the fadeIn animation, you have to fetch the image into a `Target` and apply a custom animation yourself when receiving the `Bitmap`.
* Using a `TransitionDrawable` with `CircleImageView` doesn't work properly and leads to messed up images.
License
--
```
The MIT License (MIT)
Copyright (c) 2017 Ali Abdolahi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.```