Skip to content

Commit

Permalink
完善seekBar thumb为@null时的UI
Browse files Browse the repository at this point in the history
  • Loading branch information
duduhuang88 committed Jun 25, 2021
1 parent 65dcd66 commit 5baf949
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ Gradle 3.5.0 以上

### 1. 在 Project `build.gradle` 中添加依赖

最新版本为 **1.0.2**,查看 [Releases](https://github.com/duduhuang88/qxml/releases) 获取最新版本信息
最新版本为 **1.0.3**,查看 [Releases](https://github.com/duduhuang88/qxml/releases) 获取最新版本信息

```groovy
buildscript {
...
ext.qxml_version = "1.0.2"
ext.qxml_version = "1.0.3"
repositories {
...
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ Gradle 3.5.0 above

### 1. Add dependency in Project `build.gradle`

The newest version code is **1.0.2**,check [Releases](https://github.com/duduhuang88/qxml/releases) to get newest version info
The newest version code is **1.0.3**,check [Releases](https://github.com/duduhuang88/qxml/releases) to get newest version info

```groovy
buildscript {
...
ext.qxml_version = "1.0.2"
ext.qxml_version = "1.0.3"
repositories {
...
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class AbsSeekBarGen extends ProgressBarGen {

public static class $$AbsSeekBarLocalVariable {
public int thumb = 0;
public int thumb = -1;
public int thumbOffset = 0;
}

Expand Down Expand Up @@ -69,13 +69,16 @@ public void onAbsSeekBarSplitTrack(AbsSeekBar absSeekBar, boolean splitTrack) {

@OnEnd({AndroidRS.attr.thumbOffset, AndroidRS.attr.thumb})
public void onAbsSeekBarThumbEnd(AbsSeekBar absSeekBar) {
if (__absSeekBarLocalVar.thumb != 0) {
absSeekBar.setThumb(com.qxml.tools.DrawableTools.getDrawable(__context, ___resources, __absSeekBarLocalVar.thumb));
if (__absSeekBarLocalVar.thumb != -1) {
if (__absSeekBarLocalVar.thumb == 0) {
absSeekBar.setThumb(null);
} else {
absSeekBar.setThumb(com.qxml.tools.DrawableTools.getDrawable(__context, ___resources, __absSeekBarLocalVar.thumb));
}
}
if (__absSeekBarLocalVar.thumbOffset != 0) {
absSeekBar.setThumbOffset(__absSeekBarLocalVar.thumbOffset);
}
}


}
12 changes: 12 additions & 0 deletions code/test/qxml-test/src/main/res/layout/seekbar_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<SeekBar
android:max="100"
android:progress="50"
android:progressDrawable="@drawable/shape_gradient"
android:splitTrack="true"
android:thumb="@null"
android:minHeight="10dp"
android:maxHeight="10dp"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<RatingBar
android:max="100"
android:progress="10"
Expand Down
2 changes: 1 addition & 1 deletion common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def REMOTE_DEPENDENCE = false

allprojects {

ext.PUBLISH_VERSION = "1.0.2"
ext.PUBLISH_VERSION = "1.0.3"

ext.versions = [
'minSdkVersion': 14,
Expand Down

0 comments on commit 5baf949

Please sign in to comment.