version:beta
fix: update:优化seekbar
This commit is contained in:
@@ -66,8 +66,8 @@ public class ControlActivity extends AppCompatActivity {
|
||||
@BindView(R.id.tv_bt_ssid)
|
||||
TextView tv_bt_ssid;
|
||||
|
||||
@BindView(R.id.tv_font_size)
|
||||
TextView tv_font_size;
|
||||
// @BindView(R.id.tv_font_size)
|
||||
// TextView tv_font_size;
|
||||
@BindView(R.id.seekBar)
|
||||
RulerSeekBar seekBar;
|
||||
@BindView(R.id.seekbar_brightness)
|
||||
@@ -622,7 +622,7 @@ public class ControlActivity extends AppCompatActivity {
|
||||
} else {
|
||||
font_size = mEntries.get(index);
|
||||
}
|
||||
tv_font_size.setText(font_size);
|
||||
// tv_font_size.setText(font_size);
|
||||
seekBar.setProgress(index);
|
||||
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
@@ -745,7 +745,6 @@ public class ControlActivity extends AppCompatActivity {
|
||||
int volume = (int) (((double) i / (double) maxVolume) * 100f);
|
||||
tv_sound.setText(volume + "%");
|
||||
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, i, 0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
|
||||
import android.util.AttributeSet;
|
||||
|
||||
public class RulerSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
|
||||
@@ -35,7 +34,7 @@ public class RulerSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
|
||||
/**
|
||||
* 滑块上面是否要显示刻度线
|
||||
*/
|
||||
private boolean isShowTopOfThumb = false;
|
||||
private boolean isShowTopOfThumb = true;
|
||||
|
||||
public RulerSeekBar(Context context) {
|
||||
super(context);
|
||||
@@ -106,7 +105,8 @@ public class RulerSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
|
||||
}
|
||||
|
||||
//进行绘制
|
||||
canvas.drawRect(rulerLeft, rulerTop, rulerRight, rulerBottom, mRulerPaint);
|
||||
// canvas.drawRect(rulerLeft, rulerTop, rulerRight, rulerBottom, mRulerPaint);
|
||||
canvas.drawCircle(rulerLeft, rulerTop, 12, mRulerPaint);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user