Skip to content

Commit

Permalink
发布v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenly1314 committed Feb 7, 2025
1 parent 1291d19 commit 8335476
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 107 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## 版本日志

#### v1.2.0 2025-2-7
* 新增属性:`arcNormalStrokeWidth``arcProgressStrokeWidth`(废弃属性:`arcStrokeWidth`
* 修复BUG:最大值多次动态变化后,会影响到进度拖动问题。([#14](https://github.com/jenly1314/ArcSeekBar/issues/14)
* 优化细节

#### v1.1.1:2024-7-17
* 优化细节

Expand Down
90 changes: 51 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,48 @@ ArcSeekBar for Android 是一个弧形的拖动条进度控件,配置参数完
2. 在Module的 **build.gradle** 里面添加引入依赖项
```gradle
implementation 'com.github.jenly1314:arcseekbar:1.1.1'
implementation 'com.github.jenly1314:arcseekbar:1.2.0'
```

## 使用

### ArcSeekBar自定义属性说明(进度默认为渐变色)
| 属性 | 值类型 | 默认值 | 说明 |
| :------| :------ |:-------------------------------------|:--------------------------------------------|
| arcStrokeWidth | dimension | 12dp | 画笔描边的宽度 |
| arcStrokeCap | enum | ROUND | 画笔的线冒样式 |
| arcNormalColor | color | <font color=#C8C8C8>#FFC8C8C8</font> | 弧形正常颜色 |
| arcProgressColor | color | <font color=#4FEAAC>#FF4FEAAC</font> | 弧形进度颜色 |
| arcStartAngle | integer | 270 | 开始角度,默认十二点钟方向 |
| arcSweepAngle | integer | 360 | 扫描角度范围 |
| arcMax | integer | 100 | 进度最大值 |
| arcProgress | integer | 0 | 当前进度 |
| arcDuration | integer | 500 | 动画时长 |
| arcLabelText | string | | 中间的标签文本,默认自动显示百分比 |
| arcLabelTextColor | color | <font color=#333333>#FF333333</font> | 文本字体颜色 |
| arcLabelTextSize | dimension | 30sp | 文本字体大小 |
| arcLabelPaddingTop | dimension | 0dp | 文本居顶边内间距 |
| arcLabelPaddingBottom | dimension | 0dp | 文本居底边内间距 |
| arcLabelPaddingLeft | dimension | 0dp | 文本居左边内间距 |
| arcLabelPaddingRight | dimension | 0dp | 文本居右边内间距 |
| arcShowLabel | boolean | true | 是否显示文本 |
| arcShowTick | boolean | true | 是否显示环刻度 |
| arcTickStrokeWidth | dimension | 10dp | 刻度画笔宽度 |
| arcTickPadding | dimension | 2dp | 环刻度与环间距 |
| arcTickSplitAngle | integer | 5 | 刻度间隔的角度大小 |
| arcBlockAngle | integer | 1 | 刻度的角度大小 |
| arcTickOffsetAngle | integer | 0 | 刻度偏移的角度大小 |
| arcThumbStrokeWidth | dimension | 10dp | 拖动按钮画笔宽度 |
| arcThumbColor | color | <font color=#E8D30F>#FFE8D30F</font> | 拖动按钮颜色 |
| arcThumbRadius | dimension | 8dp | 拖动按钮半径 |
| arcThumbRadiusEnlarges | dimension | 2dp | 触摸时按钮半径放大量 |
| arcShowThumb | boolean | true | 是否显示拖动按钮 |
| arcThumbDrawable | reference | | 拖动按钮图片(arcThumbDrawable的优先级高于arcThumbColor) |
| arcAllowableOffsets | dimension | 10dp | 触摸时可偏移距离:偏移量越大,触摸精度越小 |
| arcEnabledDrag | boolean | true | 是否启用通过拖动改变进度 |
| arcEnabledSingle | boolean | true | 是否启用通过点击改变进度 |
| 属性 | 值类型 | 默认值 | 说明 |
|:-----------------------| :------ |:-------------------------------------|:---------------------------------------------------------------|
| ~~arcStrokeWidth~~ | dimension | 12dp | 画笔描边的宽度(已废弃,改用`arcNormalStrokeWidth``arcProgressStrokeWidth`|
| arcNormalStrokeWidth | dimension | 12dp | 弧形正常画笔描边的宽度(v1.2.0新增) |
| arcProgressStrokeWidth | dimension | 12dp | 弧形进度条画笔描边的宽度(v1.2.0新增) |
| arcStrokeCap | enum | ROUND | 画笔的线冒样式 |
| arcNormalColor | color | <font color=#C8C8C8>#FFC8C8C8</font> | 弧形正常颜色 |
| arcProgressColor | color | <font color=#4FEAAC>#FF4FEAAC</font> | 弧形进度颜色 |
| arcStartAngle | integer | 270 | 开始角度,默认十二点钟方向 |
| arcSweepAngle | integer | 360 | 扫描角度范围 |
| arcMax | integer | 100 | 进度最大值 |
| arcProgress | integer | 0 | 当前进度 |
| arcDuration | integer | 500 | 动画时长 |
| arcLabelText | string | | 中间的标签文本,默认自动显示百分比 |
| arcLabelTextColor | color | <font color=#333333>#FF333333</font> | 文本字体颜色 |
| arcLabelTextSize | dimension | 30sp | 文本字体大小 |
| arcLabelPaddingTop | dimension | 0dp | 文本居顶边内间距 |
| arcLabelPaddingBottom | dimension | 0dp | 文本居底边内间距 |
| arcLabelPaddingLeft | dimension | 0dp | 文本居左边内间距 |
| arcLabelPaddingRight | dimension | 0dp | 文本居右边内间距 |
| arcShowLabel | boolean | true | 是否显示文本 |
| arcShowTick | boolean | true | 是否显示环刻度 |
| arcTickStrokeWidth | dimension | 10dp | 刻度画笔宽度 |
| arcTickPadding | dimension | 2dp | 环刻度与环间距 |
| arcTickSplitAngle | integer | 5 | 刻度间隔的角度大小 |
| arcBlockAngle | integer | 1 | 刻度的角度大小 |
| arcTickOffsetAngle | integer | 0 | 刻度偏移的角度大小 |
| arcThumbStrokeWidth | dimension | 10dp | 拖动按钮画笔宽度 |
| arcThumbColor | color | <font color=#E8D30F>#FFE8D30F</font> | 拖动按钮颜色 |
| arcThumbRadius | dimension | 8dp | 拖动按钮半径 |
| arcThumbRadiusEnlarges | dimension | 2dp | 触摸时按钮半径放大量 |
| arcShowThumb | boolean | true | 是否显示拖动按钮 |
| arcThumbDrawable | reference | | 拖动按钮图片(arcThumbDrawable的优先级高于arcThumbColor) |
| arcAllowableOffsets | dimension | 10dp | 触摸时可偏移距离:偏移量越大,触摸精度越小 |
| arcEnabledDrag | boolean | true | 是否启用通过拖动改变进度 |
| arcEnabledSingle | boolean | true | 是否启用通过点击改变进度 |


### 示例
Expand All @@ -89,26 +91,36 @@ ArcSeekBar for Android 是一个弧形的拖动条进度控件,配置参数完

代码示例
```Java
//进度改变监听
// 进度改变监听
arcSeekBar.setOnChangeListener(listener);
//设置进度

// 设置进度颜色;传多个颜色时则表示为渐变色(设置渐变色时尽量保证首尾同色)
arcSeekBar.setProgressColor(color);

// 设置进度
arcSeekBar.setProgress(progress);
//显示进度动画(进度,动画时长)

// 显示进度动画(进度,动画时长)
arcSeekBar.showAnimation(80,3000);


```
更多使用详情,请查看[app](app)中的源码使用示例或直接查看 [API帮助文档](https://jenly1314.github.io/ArcSeekBar/api/)

## 相关推荐

- [CircleProgressView](https://github.com/jenly1314/CircleProgressView) 一个圆形的进度动画控件,动画效果纵享丝滑。
- [SpinCounterView](https://github.com/jenly1314/SpinCounterView) 一个类似码表变化的旋转计数器动画控件。
- [RadarView](https://github.com/jenly1314/RadarView) 一个雷达扫描动画后,然后展示得分效果的控件。

<!-- end -->

## 版本日志

#### 待发布版本([提前体验](test.md)
#### v1.2.0 2025-2-7
* 新增属性:`arcNormalStrokeWidth``arcProgressStrokeWidth`(废弃属性:`arcStrokeWidth`
* 修复BUG:最大值多次动态变化后,会影响到进度拖动问题。([#14](https://github.com/jenly1314/ArcSeekBar/issues/14)
* 优化细节

#### [查看更多版本日志](CHANGELOG.md)

Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 5,
"versionName": "1.1.0",
"versionCode": 7,
"versionName": "1.2.0",
"outputFile": "app-release.apk"
}
],
Expand Down
23 changes: 13 additions & 10 deletions app/src/main/java/com/king/view/arcseekbar/app/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package com.king.view.arcseekbar.app;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import com.king.view.arcseekbar.ArcSeekBar;
import androidx.appcompat.app.AppCompatActivity;

import com.king.view.arcseekbar.ArcSeekBar;

/**
* 示例
*
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
* <p>
* <a href="https://github.com/jenly1314">Follow me</a>
*/
public class MainActivity extends AppCompatActivity {

ArcSeekBar arcSeekBar1;
Expand All @@ -38,13 +41,13 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
}


public void onClick(View v){
switch (v.getId()){
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn1:
arcSeekBar2.showAnimation(arcSeekBar2.getProgress() == 100 ? 0 :arcSeekBar2.getProgress(),100,3000);
arcSeekBar2.showAnimation(arcSeekBar2.getProgress() == 100 ? 0 : arcSeekBar2.getProgress(), 100, 3000);
break;
case R.id.btn2:
arcSeekBar2.showAnimation(arcSeekBar2.getProgress() == 0 ? 100 :arcSeekBar2.getProgress(),0,3000);
arcSeekBar2.showAnimation(arcSeekBar2.getProgress() == 0 ? 100 : arcSeekBar2.getProgress(), 0, 3000);
break;
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
app:arcLabelPaddingBottom="10dp"
app:arcTickOffsetAngle="3"
app:arcThumbDrawable="@drawable/ic_dog"
app:arcNormalStrokeWidth="8dp"
app:arcProgressStrokeWidth="12dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.king.view.arcseekbar.ArcSeekBar
android:id="@+id/arcSeekBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:arcEnabledDrag="false"
app:arcEnabledSingle="false"
app:arcShowThumb="false"
Expand Down
Loading

0 comments on commit 8335476

Please sign in to comment.