Skip to content

Commit e00f3fc

Browse files
committed
1、修复一个5.0以下Drawable位移错误的问题
2、修复cancel后Loading没有结束的问题 3、修复错误使用硬件加速的问题
1 parent 68e396c commit e00f3fc

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Loadingbutton-support/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
defaultConfig {
88
minSdkVersion 17
99
targetSdkVersion 28
10-
versionCode 104
11-
versionName "1.0.4"
10+
versionCode 105
11+
versionName "1.0.5"
1212
}
1313

1414
buildTypes {

Loadingbutton-support/src/main/java/com/flod/loadingbutton/DrawableTextView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private void init(Context context, AttributeSet attrs) {
101101
bottomBounds.bottom = (int) array.getDimension(R.styleable.DrawableTextView_drawableBottomHeight, drawables[POSITION.BOTTOM].getIntrinsicHeight());
102102
}
103103
array.recycle();
104-
setCompoundDrawablesRelative(drawables[POSITION.START], drawables[POSITION.TOP], drawables[POSITION.END], drawables[POSITION.BOTTOM]);
104+
setCompoundDrawables(drawables[POSITION.START], drawables[POSITION.TOP], drawables[POSITION.END], drawables[POSITION.BOTTOM]);
105105
}
106106

107107

@@ -304,7 +304,7 @@ public void setDrawable(@POSITION int position, @Nullable Drawable drawable, @Px
304304
mDrawables[position].setBounds(bounds.left, bounds.top, bounds.right, bounds.bottom);
305305
mDrawablesBounds[position] = bounds;
306306
}
307-
super.setCompoundDrawablesRelative(mDrawables[POSITION.START], mDrawables[POSITION.TOP], mDrawables[POSITION.END], mDrawables[POSITION.BOTTOM]);
307+
super.setCompoundDrawables(mDrawables[POSITION.START], mDrawables[POSITION.TOP], mDrawables[POSITION.END], mDrawables[POSITION.BOTTOM]);
308308
}
309309

310310

Loadingbutton-support/src/main/java/com/flod/loadingbutton/LoadingButton.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import android.view.View;
2727

2828

29-
3029
/**
3130
* SimpleDes:
3231
* Creator: Flood
@@ -218,7 +217,7 @@ public void onAnimationEnd(Animator animation) {
218217
/**
219218
* 开始收缩或恢复
220219
*
221-
* @param isReverse true:恢复false:收缩
220+
* @param isReverse true:恢复,且开始时停止Loading false:收缩,且结束时开始Loading
222221
* @param lastFrame 是否只显示最后一帧
223222
*/
224223
private void beginChangeSize(boolean isReverse, boolean lastFrame) {
@@ -356,6 +355,7 @@ private void cancelAllRunning(boolean withAnim) {
356355
if (enableShrink) {
357356
beginChangeSize(true, !withAnim);
358357
} else {
358+
stopLoading();
359359
toIde();
360360
}
361361
break;
@@ -731,7 +731,7 @@ private EndDrawable(@DrawableRes int completeResId, @DrawableRes int failResId)
731731
}
732732

733733
private void init() {
734-
setLayerType(LAYER_TYPE_HARDWARE, null);
734+
//setLayerType(LAYER_TYPE_HARDWARE, null);
735735
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
736736
mCirclePath = new Path();
737737
mAppearAnimator = ObjectAnimator.ofFloat(this, "animValue", 1.0f);

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ android {
44
compileSdkVersion 28
55
defaultConfig {
66
applicationId "com.flod.loadingbutton.app"
7-
minSdkVersion 19
7+
minSdkVersion 17
88
targetSdkVersion 28
99
versionCode 100
1010
versionName "1.0.0"

0 commit comments

Comments
 (0)