From 6a7a7300d31be45be29c862662f3a628420afb89 Mon Sep 17 00:00:00 2001 From: woxingxiao Date: Wed, 22 Feb 2017 17:30:25 +0800 Subject: [PATCH] Update README.md --- README.md | 115 +++++++++++---------------------------------------- README_zh.md | 115 +++++++++++---------------------------------------- 2 files changed, 46 insertions(+), 184 deletions(-) diff --git a/README.md b/README.md index dab815e..e1d5456 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,8 @@ **A beautiful Android custom seekbar, which has a bubble view with progress appearing upon when seeking. Highly customizable, mostly demands has been considered. `star` or `pull request` will be welcomed** **** ##Screenshot -![demo](https://github.com/woxingxiao/BubbleSeekBar/blob/master/demo.gif) - -[**sample.apk**](https://github.com/woxingxiao/BubbleSeekBar/raw/master/apk/sample.apk) +![demo](https://github.com/woxingxiao/BubbleSeekBar/blob/master/screenshot/demo.gif) +![demo](https://github.com/woxingxiao/BubbleSeekBar/blob/master/screenshot/demo2.gif) ##Download root project:`build.gradle` ```groovy @@ -21,9 +20,26 @@ root project:`build.gradle` app:`build.gradle` ```groovy dependencies { - compile 'com.github.woxingxiao:BubbleSeekBar:v1.8' + compile 'com.github.woxingxiao:BubbleSeekBar:v1.9' } ``` +##Usage +Check out the demo for more details: [**`MainActivity.java`**](https://github.com/woxingxiao/BubbleSeekBar/blob/master/app/src/main/java/com/xw/samlpe/bubbleseekbar/MainActivity.java) [**`content_main.xml`**](https://github.com/woxingxiao/BubbleSeekBar/blob/master/app/src/main/res/layout/content_main.xml) +[**sample.apk**](https://github.com/woxingxiao/BubbleSeekBar/raw/master/apk/sample.apk) +##Attentions +- You must correct the offsets by setting `ScrollListener` when `BubbleSeekBar`'s parent view is scrollable, otherwise the position of bubble appears maybe be wrong. For example: +```java + mContainer.setOnYourContainerScrollListener(new OnYourContainerScrollListener() { + @Override + public void onScroll() { + // call this method to correct offsets + mBubbleSeekBar.correctOffsetWhenContainerOnScrolling(); + } + }); +``` +- When set `bsb_touch_to_seek` attribute to be `true` , you better not to click **too fast** because the animation may not have enough time to play. +- This library depends `support:appcompat-v7` is **`provided`**, so you don't need to worry about redundant `dependencies`. + ##Attributes attr | format | description -------- | ---|--- @@ -51,93 +67,8 @@ bsb_show_progress_in_float|boolean|show _bubble-progress_ in float or not, defau bsb_bubble_color|int|color of bubble, default: same as _left-track_'s color bsb_bubble_text_size|dimension|text size of _bubble-progress_, default: 14sp bsb_bubble_text_color|int|text color of _bubble-progress_, default: #ffffffff -bsb_anim_duration|int|duration of animation, default: 200ms   - -##Usage -```xml - - - - - - - - - - - -``` -You must correct the offsets by setting `ScrollListener` when `BubbleSeekBar`'s parent view is scrollable, otherwise the position of bubble appears maybe be wrong. For example: -```java - mContainer.setOnYourContainerScrollListener(new OnYourContainerScrollListener() { - @Override - public void onScroll() { - // call this method to correct offsets - mBubbleSeekBar.correctOffsetWhenContainerOnScrolling(); - } - }); -``` - +bsb_anim_duration|int|duration of animation, default: 200ms +bsb_touch_to_seek|boolean|touch anywhere on _track_ to quickly seek, default: false ##License ``` The MIT License (MIT) @@ -161,4 +92,4 @@ 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. -``` +``` \ No newline at end of file diff --git a/README_zh.md b/README_zh.md index c4bf079..c5d5c66 100644 --- a/README_zh.md +++ b/README_zh.md @@ -3,9 +3,8 @@ **自定义`SeekBar`,进度变化由可视化气泡样式呈现,定制化程度较高,适合大部分需求。欢迎`star` or `pull request`** **** ##Screenshot -![demo](https://github.com/woxingxiao/BubbleSeekBar/blob/master/demo.gif) - -[**sample.apk**](https://github.com/woxingxiao/BubbleSeekBar/raw/master/apk/sample.apk) +![demo](https://github.com/woxingxiao/BubbleSeekBar/blob/master/screenshot/demo.gif) +![demo](https://github.com/woxingxiao/BubbleSeekBar/blob/master/screenshot/demo2.gif) ##Download root project:`build.gradle` ```groovy @@ -19,9 +18,25 @@ root project:`build.gradle` app:`build.gradle` ```groovy dependencies { - compile 'com.github.woxingxiao:BubbleSeekBar:v1.8' + compile 'com.github.woxingxiao:BubbleSeekBar:v1.9' } -``` +``` +##Usage +查看demo获知更多使用细节: [**`MainActivity.java`**](https://github.com/woxingxiao/BubbleSeekBar/blob/master/app/src/main/java/com/xw/samlpe/bubbleseekbar/MainActivity.java) [**`content_main.xml`**](https://github.com/woxingxiao/BubbleSeekBar/blob/master/app/src/main/res/layout/content_main.xml) +[**sample.apk**](https://github.com/woxingxiao/BubbleSeekBar/raw/master/apk/sample.apk) +##Attentions +- 如果`BubbleSeekBar`的外部容器是可滑动的控件,需要设置滑动监听来修正气泡的偏移,否则滑动后气泡出现位置可能错乱。方法如下: +```java + mContainer.setOnYourContainerScrollListener(new OnYourContainerScrollListener() { + @Override + public void onScroll() { + // 调用修正偏移方法 + mBubbleSeekBar.correctOffsetWhenContainerOnScrolling(); + } + }); +``` +- 当设置`bsb_touch_to_seek`属性为`true`时, 最好不要点击**太快**去seek进度,否则动画可能没有足够时间播放。 +- 本库依赖`support:appcompat-v7`采用的**`provided`**方式,所以不必担心冗余的依赖引入。 ##Attributes attr | format | description -------- | ---|--- @@ -48,93 +63,9 @@ bsb_thumb_text_color|int|thumb下进度文字颜色,默认与左track相同 bsb_show_progress_in_float|boolean|进度是否显示浮点数,默认false bsb_bubble_color|int|气泡的颜色,默认与左track相同 bsb_bubble_text_size|dimension|气泡中进度文字大小,默认14sp -bsb_bubble_text_color|int|气泡中进度文字颜色,默认白色 - -##Usage -```xml - - - - - - - - - - - -``` -如果`BubbleSeekBar`的外部容器是可滑动的控件,需要设置滑动监听来修正气泡的偏移,否则滑动后气泡出现位置可能错乱。方法如下: -```java - mContainer.setOnYourContainerScrollListener(new OnYourContainerScrollListener() { - @Override - public void onScroll() { - // 调用修正偏移方法 - mBubbleSeekBar.correctOffsetWhenContainerOnScrolling(); - } - }); -``` - +bsb_bubble_text_color|int|气泡中进度文字颜色,默认白色 +bsb_anim_duration|int|动画执行时间, 默认: 200ms +bsb_touch_to_seek|boolean|是否点击track任意地方来快速设置进度, 默认: false   ##License ``` The MIT License (MIT)