diff --git a/app/src/main/java/com/scwang/wave/app/slice/MainAbilitySlice.java b/app/src/main/java/com/scwang/wave/app/slice/MainAbilitySlice.java index 57fd78ef304ff22ebdf5959dde1d5c018fc46de9..dfc9dd7a0deb98d261964900766dafe84fd207ee 100644 --- a/app/src/main/java/com/scwang/wave/app/slice/MainAbilitySlice.java +++ b/app/src/main/java/com/scwang/wave/app/slice/MainAbilitySlice.java @@ -122,7 +122,7 @@ public class MainAbilitySlice extends AbilitySlice implements Slider.ValueChange radioContainer.setMarkChangedListener(this::onCheckedChanged); cbIsRunning.setChecked(multiWaveHeader.isRunning()); cbUpSideDown.setChecked(multiWaveHeader.getScaleY() == -1f); - radioContainer.mark(0); + sliderNumber.setProgressValue(5); sliderAngle.setProgressValue(multiWaveHeader.getGradientAngle()); sliderVelocity.setProgressValue((int) (multiWaveHeader.getVelocity() * 10)); @@ -132,6 +132,7 @@ public class MainAbilitySlice extends AbilitySlice implements Slider.ValueChange sliderStartColor.setProgressColors(new int[]{Color.GREEN.getValue(),Color.CYAN.getValue(),Color.YELLOW.getValue(),Color.RED.getValue(),Color.MAGENTA.getValue(),Color.BLUE.getValue()}); sliderCloseColor.setProgressColors(new int[]{Color.GREEN.getValue(),Color.CYAN.getValue(),Color.YELLOW.getValue(),Color.RED.getValue(),Color.MAGENTA.getValue(),Color.BLUE.getValue()}); + radioContainer.mark(multiWaveHeader.getShape().ordinal()); } /** diff --git a/app/src/main/resources/base/layout/ability_main.xml b/app/src/main/resources/base/layout/ability_main.xml index d4a186c5e6002968fa8a10fc39b14e9ea57ba23f..b8b683b1f8f9e6b53c74f9c74481b4db4b430f86 100644 --- a/app/src/main/resources/base/layout/ability_main.xml +++ b/app/src/main/resources/base/layout/ability_main.xml @@ -80,7 +80,7 @@ ohos:text_size="14fp"/> ShapeType.values().length) { + if (index >= ShapeType.values().length) { return ShapeType.values()[0]; } return ShapeType.values()[index];