Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit f6c27ef

Browse files
committed
seekbar expand_vertical fix
1 parent a0a5dff commit f6c27ef

File tree

2 files changed

+35
-58
lines changed

2 files changed

+35
-58
lines changed

yanndroid/oneui/src/main/java/androidx/appcompat/widget/SeslAbsSeekBar.java

Lines changed: 32 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,7 @@ public abstract class SeslAbsSeekBar extends ProgressBar {
4949
public static final boolean IS_BASE_SDK_VERSION;
5050

5151
static {
52-
boolean var0;
53-
if (Build.VERSION.SDK_INT <= 23) {
54-
var0 = true;
55-
} else {
56-
var0 = false;
57-
}
58-
59-
IS_BASE_SDK_VERSION = var0;
52+
IS_BASE_SDK_VERSION = Build.VERSION.SDK_INT <= 23;
6053
}
6154

6255
public final List<Rect> mGestureExclusionRects;
@@ -265,7 +258,6 @@ public SeslAbsSeekBar(Context var1, AttributeSet var2, int var3, int var4) {
265258
int[] var8 = new int[]{16842910};
266259
int[] var10 = new int[]{-16842910};
267260
var4 = getColor(var1, R.attr.colorPrimary);
268-
;
269261
var3 = var6.getColor(R.color.sesl_seekbar_disable_color_activated, var1.getTheme());
270262
this.mDefaultActivatedThumbColor = new ColorStateList(new int[][]{var8, var10}, new int[]{var4, var3});
271263
}
@@ -579,7 +571,6 @@ public int getMax() {
579571
var1 = super.getMax();
580572
}
581573
} finally {
582-
;
583574
}
584575

585576
return var1;
@@ -602,7 +593,6 @@ public void setMax(int var1) {
602593
this.setKeyProgressIncrement(Math.max(1, Math.round((float) var1 / 20.0F)));
603594
}
604595
} finally {
605-
;
606596
}
607597

608598
}
@@ -619,7 +609,6 @@ public int getMin() {
619609
var1 = super.getMin();
620610
}
621611
} finally {
622-
;
623612
}
624613

625614
return var1;
@@ -641,7 +630,6 @@ public void setMin(int var1) {
641630
this.setKeyProgressIncrement(Math.max(1, Math.round((float) var1 / 20.0F)));
642631
}
643632
} finally {
644-
;
645633
}
646634

647635
}
@@ -658,7 +646,6 @@ public int getProgress() {
658646
var1 = super.getProgress();
659647
}
660648
} finally {
661-
;
662649
}
663650

664651
return var1;
@@ -676,7 +663,6 @@ public void setProgress(int var1) {
676663

677664
super.setProgress(var2);
678665
} finally {
679-
;
680666
}
681667

682668
}
@@ -970,7 +956,6 @@ public void onDraw(Canvas var1) {
970956
this.drawThumb(var1);
971957
}
972958
} finally {
973-
;
974959
}
975960

976961
}
@@ -1476,33 +1461,30 @@ private void setHoveringPoint(int i, int i2) {
14761461

14771462
public void setMode(int var1) {
14781463
super.setMode(var1);
1479-
if (var1 != 0) {
1480-
if (var1 != 1) {
1481-
if (var1 != 3) {
1482-
if (var1 != 4) {
1483-
if (var1 != 5) {
1484-
if (var1 == 6) {
1485-
this.initializeExpandVerticalMode();
1486-
}
1487-
} else {
1488-
this.initializeExpandMode();
1489-
}
1490-
} else {
1491-
this.mSplitProgress = this.getContext().getResources().getDrawable(R.drawable.sesl_split_seekbar_primary_progress, null);
1492-
this.mDivider = this.getContext().getResources().getDrawable(R.drawable.sesl_split_seekbar_vertical_bar, null);
1493-
this.updateSplitProgress();
1494-
}
1495-
} else {
1496-
Resources var2 = this.getContext().getResources();
1497-
this.setThumb(var2.getDrawable(R.drawable.sesl_scrubber_control_anim, null));
1498-
this.setThumbTintList(this.mDefaultActivatedThumbColor);
1499-
}
1500-
} else {
1464+
switch (var1) {
1465+
case 0:
1466+
this.setProgressTintList(this.mDefaultActivatedProgressColor);
1467+
this.setThumbTintList(this.mDefaultActivatedThumbColor);
1468+
break;
1469+
case 1:
15011470
this.updateWarningMode(this.getProgress());
1502-
}
1503-
} else {
1504-
this.setProgressTintList(this.mDefaultActivatedProgressColor);
1505-
this.setThumbTintList(this.mDefaultActivatedThumbColor);
1471+
break;
1472+
case 3:
1473+
Resources var2 = this.getContext().getResources();
1474+
this.setThumb(var2.getDrawable(R.drawable.sesl_scrubber_control_anim, null));
1475+
this.setThumbTintList(this.mDefaultActivatedThumbColor);
1476+
break;
1477+
case 4:
1478+
this.mSplitProgress = this.getContext().getResources().getDrawable(R.drawable.sesl_split_seekbar_primary_progress, null);
1479+
this.mDivider = this.getContext().getResources().getDrawable(R.drawable.sesl_split_seekbar_vertical_bar, null);
1480+
this.updateSplitProgress();
1481+
break;
1482+
case 5:
1483+
this.initializeExpandMode();
1484+
break;
1485+
case 6:
1486+
this.initializeExpandVerticalMode();
1487+
break;
15061488
}
15071489

15081490
this.invalidate();
@@ -1537,10 +1519,6 @@ public void setOverlapPointForDualColor(int var1) {
15371519
}
15381520
}
15391521

1540-
public void setProgressDrawable(Drawable var1) {
1541-
super.setProgressDrawable(var1);
1542-
}
1543-
15441522
public boolean setProgressInternal(int var1, boolean var2, boolean var3) {
15451523
var2 = super.setProgressInternal(var1, var2, var3);
15461524
this.updateWarningMode(var1);
@@ -1579,7 +1557,9 @@ public void setSystemGestureExclusionRects(List<Rect> var1) {
15791557
@SuppressLint("RestrictedApi")
15801558
public final void setThumbPos(int var1, Drawable var2, float var3, int var4) {
15811559
int var5 = super.mCurrentMode;
1582-
if (var5 != 3 && var5 != 6) {
1560+
if (var5 == 3 || var5 == 6) {
1561+
this.setThumbPosInVertical(this.getHeight(), var2, var3, var4);
1562+
} else {
15831563
int var6 = this.getPaddingLeft();
15841564
int var7 = this.getPaddingRight();
15851565
int var8 = var2.getIntrinsicWidth();
@@ -1614,8 +1594,6 @@ public final void setThumbPos(int var1, Drawable var2, float var3, int var4) {
16141594
this.updateGestureExclusionRects();
16151595
this.mThumbPosX = var5 + this.getPaddingLeft() - (this.getPaddingLeft() - var8 / 2);
16161596
this.updateSplitProgress();
1617-
} else {
1618-
this.setThumbPosInVertical(this.getHeight(), var2, var3, var4);
16191597
}
16201598
}
16211599

@@ -2092,7 +2070,6 @@ public void draw(Canvas var1) {
20922070

20932071
mDrawable.setBounds(0, (int) (SeslAbsSeekBar.this.getHeight() / 2 - var4), (int) var3, (int) (SeslAbsSeekBar.this.getHeight() / 2 + var4));
20942072
mDrawable.draw(var1);
2095-
20962073
} else {
20972074
var4 = (float) (SeslAbsSeekBar.this.getHeight() - SeslAbsSeekBar.this.getPaddingTop() - SeslAbsSeekBar.this.getPaddingBottom());
20982075
var3 = this.mRadius;
@@ -2325,7 +2302,11 @@ public void draw(Canvas var1) {
23252302
if (!this.mIsVertical) {
23262303
var1.drawCircle((float) SeslAbsSeekBar.this.mThumbPosX, (float) SeslAbsSeekBar.this.getHeight() / 2.0F, (float) this.mRadiusForAni, this.mPaint);
23272304
} else {
2328-
var1.drawCircle((float) SeslAbsSeekBar.this.getWidth() / 2.0F, (float) SeslAbsSeekBar.this.mThumbPosX, (float) this.mRadiusForAni, this.mPaint);
2305+
if (SeslAbsSeekBar.this.mCurrentMode == 3) {
2306+
var1.drawCircle((float) SeslAbsSeekBar.this.getWidth() / 2.0F, (float) SeslAbsSeekBar.this.mThumbPosX, (float) this.mRadiusForAni, this.mPaint);
2307+
} else {
2308+
var1.drawCircle((float) (SeslAbsSeekBar.this.getWidth() - (SeslAbsSeekBar.this.getPaddingLeft() + SeslAbsSeekBar.this.getPaddingRight())) / 2.0F, (float) SeslAbsSeekBar.this.mThumbPosX - SeslAbsSeekBar.this.getPaddingLeft(), (float) this.mRadiusForAni, this.mPaint);
2309+
}
23292310
}
23302311

23312312
var1.restore();

yanndroid/oneui/src/main/java/de/dlyt/yanndroid/oneui/view/ProgressBar.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,6 @@ private void updateDrawableState() {
643643
}
644644
}
645645

646-
/* JADX INFO: finally extract failed */
647-
/* access modifiers changed from: package-private */
648646
@SuppressLint("RestrictedApi")
649647
public void drawTrack(Canvas canvas) {
650648
Drawable drawable = this.mCurrentDrawable;
@@ -945,7 +943,7 @@ public void setProgressDrawable(Drawable drawable) {
945943
if (drawable.isStateful()) {
946944
drawable.setState(getDrawableState());
947945
}
948-
if (this.mCurrentMode == 3) {
946+
if (this.mCurrentMode == 3 || this.mCurrentMode == 6) {
949947
int minimumWidth = drawable.getMinimumWidth();
950948
if (this.mMaxWidth < minimumWidth) {
951949
this.mMaxWidth = minimumWidth;
@@ -1307,13 +1305,11 @@ public void setInterpolator(Context context, @InterpolatorRes int i) {
13071305
}
13081306

13091307
public void setMode(int i2) {
1310-
Drawable drawable;
1308+
Drawable drawable = null;
13111309
this.mCurrentMode = i2;
13121310
if (i2 == 3) {
13131311
drawable = androidx.core.content.ContextCompat.getDrawable(getContext(), R.drawable.sesl_scrubber_progress_vertical);
1314-
} else if (i2 != 4) {
1315-
drawable = null;
1316-
} else {
1312+
} else if (i2 == 4) {
13171313
drawable = androidx.core.content.ContextCompat.getDrawable(getContext(), R.drawable.sesl_split_seekbar_background_progress);
13181314
}
13191315
if (drawable != null) {

0 commit comments

Comments
 (0)