Browse Source

添加节拍器节奏型

Pq 10 months ago
parent
commit
bc02d91ba4
60 changed files with 963 additions and 256 deletions
  1. 63 15
      metronome/src/main/java/com/cooleshow/metronome/MetronomeActivity.java
  2. 116 76
      metronome/src/main/java/com/cooleshow/metronome/Utils/PlayBeanManager.java
  3. 1 1
      metronome/src/main/java/com/cooleshow/metronome/Utils/SoundPoolUtils.java
  4. 41 0
      metronome/src/main/java/com/cooleshow/metronome/adapter/MoreRhythmTypeAdapter.java
  5. 1 1
      metronome/src/main/java/com/cooleshow/metronome/constants/MetronomeConfig.java
  6. 23 11
      metronome/src/main/java/com/cooleshow/metronome/constants/MetronomeType.java
  7. 96 0
      metronome/src/main/java/com/cooleshow/metronome/constants/QuarterNoteRhythmType.java
  8. 160 0
      metronome/src/main/java/com/cooleshow/metronome/widget/MoreRhythmTypeDialog.java
  9. 6 0
      metronome/src/main/res/drawable/shape_ebf8ff_6dp_border_1cacf1.xml
  10. 5 0
      metronome/src/main/res/drawable/shape_f6f6f6_6dp.xml
  11. 92 46
      metronome/src/main/res/layout-sw600dp-hdpi/activity_metronome_layout.xml
  12. 110 66
      metronome/src/main/res/layout/activity_metronome_layout.xml
  13. 66 0
      metronome/src/main/res/layout/dialog_rhythm_type_layout.xml
  14. 21 0
      metronome/src/main/res/layout/item_more_rhythm_type_layout.xml
  15. 28 7
      metronome/src/main/res/layout/pickerview_beat_symbol_layout.xml
  16. BIN
      metronome/src/main/res/mipmap-sw600dp-hdpi/icon_beat_value_bg.png
  17. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_1_normal.png
  18. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_1_select.png
  19. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_2_normal.png
  20. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_2_select.png
  21. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_3_normal.png
  22. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_3_select.png
  23. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_4_normal.png
  24. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_4_select.png
  25. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_5_normal.png
  26. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_5_select.png
  27. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_6_normal.png
  28. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_6_select.png
  29. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_7_normal.png
  30. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_7_select.png
  31. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_beat_value_bg.png
  32. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_metronome_add_bt_bg.png
  33. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_metronome_bt_bg.png
  34. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_quarter_note_tag2.png
  35. BIN
      metronome/src/main/res/mipmap-xhdpi/icon_volume_trumpet_add.png
  36. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_1_normal.png
  37. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_1_select.png
  38. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_2_normal.png
  39. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_2_select.png
  40. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_3_normal.png
  41. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_3_select.png
  42. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_4_normal.png
  43. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_4_select.png
  44. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_5_normal.png
  45. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_5_select.png
  46. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_6_normal.png
  47. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_6_select.png
  48. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_7_normal.png
  49. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_7_select.png
  50. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_beat_value_bg.png
  51. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_metronome_add_bt_bg.png
  52. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_metronome_bt_bg.png
  53. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_quarter_note_tag2.png
  54. BIN
      metronome/src/main/res/mipmap-xxhdpi/icon_volume_trumpet_add.png
  55. 1 0
      metronome/src/main/res/values/colors.xml
  56. 64 16
      musictuner/src/main/java/com/cooleshow/musictuner/MusicTunerActivity.java
  57. BIN
      musictuner/src/main/res/drawable-xhdpi/icon_quarter_note_tag3.png
  58. BIN
      musictuner/src/main/res/drawable-xxhdpi/icon_quarter_note_tag3.png
  59. 68 17
      musictuner/src/main/res/layout/activity_music_tuner_layout.xml
  60. 1 0
      musictuner/src/main/res/values/colors.xml

+ 63 - 15
metronome/src/main/java/com/cooleshow/metronome/MetronomeActivity.java

@@ -27,9 +27,11 @@ import com.cooleshow.metronome.Utils.VolumeManager;
 import com.cooleshow.metronome.adapter.MetronomeAdapter;
 import com.cooleshow.metronome.constants.MetronomeConfig;
 import com.cooleshow.metronome.constants.MetronomeType;
+import com.cooleshow.metronome.constants.QuarterNoteRhythmType;
 import com.cooleshow.metronome.databinding.ActivityMetronomeLayoutBinding;
 import com.cooleshow.metronome.interfaces.IPlayBeatCallBack;
 import com.cooleshow.metronome.widget.CircularSeekBar;
+import com.cooleshow.metronome.widget.MoreRhythmTypeDialog;
 
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
@@ -43,10 +45,11 @@ import androidx.recyclerview.widget.LinearLayoutManager;
 @Route(path = RouterPath.Other.METRONOME_PAGE)
 public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBinding> implements View.OnClickListener, VolumeManager.VolumeChangeListener, IPlayBeatCallBack {
     private OptionsPickerView pvOptions;
-    private int currentSelectPosition;
+    private int currentSelectPosition =-1;
     private MetronomeAdapter mMetronomeAdapter;
     private VolumeManager mVolumeManager;
     private boolean isUpdateMode = false;//如果是更新设置的方式进入此页面,则不需要relase相关组件
+    private MoreRhythmTypeDialog mRhythmTypeDialog;
 
     public static void start(Context context) {
         Intent intent = new Intent(context, MetronomeActivity.class);
@@ -124,6 +127,8 @@ public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBindi
         MetronomeType currentBeatType = PlayBeanManager.getInstance().getCurrentBeatType();
         int beatSymbolCount = PlayBeanManager.getInstance().getBeatSymbolCount();
         viewBinding.tvCurrentBeat.setText(currentBeatType.getName());
+        QuarterNoteRhythmType currentRhythmType = PlayBeanManager.getInstance().getCurrentRhythmType();
+        viewBinding.ivRhythmValue.setImageResource(currentRhythmType.getImgRes());
         mMetronomeAdapter.notifyData(MetronomeAdapter.DEFAULT_SELECT_POSITION);
         mMetronomeAdapter.setCount(beatSymbolCount);
         int noteDrawable = MetronomeConfig.getNoteDrawable(currentBeatType);
@@ -135,7 +140,7 @@ public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBindi
     }
 
     private void setDefault() {
-        PlayBeanManager.getInstance().setBeat(MetronomeType.METRONOME_44_TYPE);
+        PlayBeanManager.getInstance().setBeat(MetronomeType.METRONOME_44_TYPE, QuarterNoteRhythmType.METRONOME_1_TYPE);
         PlayBeanManager.getInstance().setCurrentBeatRate(MetronomeConfig.DEFAULT_PLAY_RATE);
     }
 
@@ -150,7 +155,7 @@ public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBindi
         int totalSection = MetronomeConfig.MAX_PLAY_RATE - MetronomeConfig.MIN_PLAY_RATE;
         int result = currentBeatRate - MetronomeConfig.MIN_PLAY_RATE;
         float progressPercent = result * 1.0f / totalSection;
-        float progress =(progressPercent * viewBinding.cirSeekbar.getMaxProgress());
+        float progress = (progressPercent * viewBinding.cirSeekbar.getMaxProgress());
         viewBinding.cirSeekbar.setProgress(progress);
     }
 
@@ -166,6 +171,7 @@ public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBindi
         viewBinding.ivBeatValue.setOnClickListener(this);
         viewBinding.ivAdd.setOnClickListener(this);
         viewBinding.ivReduce.setOnClickListener(this);
+        viewBinding.ivRhythmValueBg.setOnClickListener(this);
         viewBinding.llPlay.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -241,23 +247,28 @@ public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBindi
 
     private void selectSymbols() {
         ArrayList<MetronomeType> beatSymbolLists = PlayBeanManager.getInstance().getAllBeatTypeList();
+        checkSelectDefault(beatSymbolLists);
         pvOptions = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
             this.currentSelectPosition = options1;
             MetronomeType metronomeType = beatSymbolLists.get(currentSelectPosition);
             PlayBeanManager.getInstance().pausePlay();
-            PlayBeanManager.getInstance().setBeat(metronomeType);
+            PlayBeanManager.getInstance().setBeat(metronomeType, QuarterNoteRhythmType.METRONOME_1_TYPE);
             loadData();
         }).setTitleText("拍号").setTitleColor(Color.BLACK).setLayoutRes(R.layout.pickerview_beat_symbol_layout, v -> {
-            //自定义布局中的控件初始化及事件处理
-            final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
-            TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
-            tvSubmit.setOnClickListener(v12 -> {
-                pvOptions.returnData();
-                pvOptions.dismiss();
-            });
-            ivCancel.setOnClickListener(v1 -> pvOptions.dismiss());
-
-        }).isDialog(false).build();
+                    //自定义布局中的控件初始化及事件处理
+                    final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
+                    TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
+                    tvSubmit.setOnClickListener(v12 -> {
+                        pvOptions.returnData();
+                        pvOptions.dismiss();
+                    });
+                    ivCancel.setOnClickListener(v1 -> pvOptions.dismiss());
+
+                }).setDividerColor(Color.TRANSPARENT)
+                .setBgColor(Color.TRANSPARENT)
+                .setLineSpacingMultiplier(2.7f)
+                .isDialog(false)
+                .build();
         pvOptions.setPicker(beatSymbolLists);
         if (currentSelectPosition < beatSymbolLists.size()) {
             pvOptions.setSelectOptions(currentSelectPosition);
@@ -266,6 +277,19 @@ public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBindi
 
     }
 
+    private void checkSelectDefault(ArrayList<MetronomeType> beatSymbolLists) {
+        if (currentSelectPosition == -1) {
+            MetronomeType currentBeatType = PlayBeanManager.getInstance().getCurrentBeatType();
+            for (int i = 0; i < beatSymbolLists.size(); i++) {
+                MetronomeType metronomeType = beatSymbolLists.get(i);
+                if (currentBeatType == metronomeType) {
+                    currentSelectPosition = i;
+                    return;
+                }
+            }
+        }
+    }
+
 
     @Override
     public void onClick(View v) {
@@ -292,6 +316,30 @@ public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBindi
             }
             return;
         }
+
+        if (id == R.id.iv_rhythm_value_bg) {
+            showRhythmDialog();
+            return;
+        }
+    }
+
+    private void showRhythmDialog() {
+        if (mRhythmTypeDialog == null) {
+            mRhythmTypeDialog = new MoreRhythmTypeDialog(this);
+            mRhythmTypeDialog.setEventListener(new MoreRhythmTypeDialog.OnEventListener() {
+                @Override
+                public void onSelect(QuarterNoteRhythmType rhythmType) {
+                    PlayBeanManager.getInstance().pausePlay();
+                    PlayBeanManager.getInstance().setBeat(PlayBeanManager.getInstance().getCurrentBeatType(), rhythmType);
+                    loadData();
+                    mRhythmTypeDialog.dismiss();
+                }
+            });
+        }
+        if (!mRhythmTypeDialog.isShowing()) {
+            mRhythmTypeDialog.show();
+        }
+        mRhythmTypeDialog.setSelect(PlayBeanManager.getInstance().getCurrentRhythmType());
     }
 
     private void updateAnim(int value) {
@@ -325,7 +373,7 @@ public class MetronomeActivity extends BaseActivity<ActivityMetronomeLayoutBindi
     @Subscribe(threadMode = ThreadMode.MAIN)
     public void loadEventBus(LoginStatusEvent event) {
         if (event != null && event.eventCode == LoginStatusConstants.LOGIN_OUT) {
-            LogUtils.i("pq", "MetronomeActivity LoginStatusEvent:logout");
+            LogUtils.i("pq", "MusicTunerActivity LoginStatusEvent:logout");
             finish();
         }
     }

+ 116 - 76
metronome/src/main/java/com/cooleshow/metronome/Utils/PlayBeanManager.java

@@ -10,6 +10,7 @@ import com.cooleshow.metronome.R;
 import com.cooleshow.metronome.adapter.MetronomeAdapter;
 import com.cooleshow.metronome.constants.MetronomeConfig;
 import com.cooleshow.metronome.constants.MetronomeType;
+import com.cooleshow.metronome.constants.QuarterNoteRhythmType;
 import com.cooleshow.metronome.interfaces.IPlayBeatCallBack;
 
 import java.util.ArrayList;
@@ -18,6 +19,7 @@ import java.util.ArrayList;
  * Author by pq, Date on 2023/7/13.
  */
 public class PlayBeanManager {
+    public static final String TAG = "PlayBeanManager";
     private Handler mHandler = new Handler(Looper.getMainLooper());
     private int[] musicFileRes = new int[]{R.raw.tick, R.raw.tock};
     private boolean isInit = false;
@@ -29,6 +31,7 @@ public class PlayBeanManager {
     private float currentNoteRate = MetronomeConfig.DEFAULT_NOTE_RATE;
 
     private MetronomeType currentBeatType;
+    private QuarterNoteRhythmType currentRhythmType = QuarterNoteRhythmType.METRONOME_1_TYPE;
     private int playPosition = 0;
     private IPlayBeatCallBack mCallBack;
 
@@ -38,11 +41,11 @@ public class PlayBeanManager {
     private Runnable mRunnable = new Runnable() {
         @Override
         public void run() {
-            long delayMillis = (long) (1 / (currentBeatRate / 60d) * 1000 * currentNoteRate);
+            long delayMillis = (long) (1 / (currentBeatRate / 60d) * 1000 * currentNoteRate * getRhythmParams());
             long next = MetronomeConfig.MIN_COUNT_TIME_SPACE;
-                long l = System.currentTimeMillis();
+            long l = System.currentTimeMillis();
             if (totalTime == -1) {
-                handleMusic(delayMillis,l);
+                handleMusic(delayMillis, l);
             } else {
                 long d = Math.abs(l - totalTime);
                 long d2 = Math.abs(d - delayMillis);
@@ -67,11 +70,17 @@ public class PlayBeanManager {
         }
     };
 
-    private void handleMusic(long delayMillis,long cTime) {
+    private float getRhythmParams() {
+        float v = QuarterNoteRhythmType.countSingleNoteDuration(currentRhythmType, playPosition);
+        LOG.i(TAG, "getRhythmParams:" + v);
+        return v;
+    }
+
+    private void handleMusic(long delayMillis, long cTime) {
         boolean tickOrTock = isTickOrTock();
         if (lastTime != -1) {
             long diff = cTime - lastTime;
-            LOG.i("diff:" + diff);
+            LOG.i(TAG, "diff:" + diff);
         }
         lastTime = cTime;
         if (tickOrTock) {
@@ -80,16 +89,17 @@ public class PlayBeanManager {
             SoundPoolUtils.getInstance().play(1);
         }
         if (mCallBack != null) {
-            mCallBack.notifyData(playPosition);
-            mHandler.postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    //实现闪烁动画效果
-                    if (mCallBack != null) {
-                        mCallBack.notifyData(MetronomeAdapter.DEFAULT_SELECT_POSITION);
-                    }
-                }
-            }, delayMillis / 2);
+            //20240429暂时去掉节拍器圆点
+//            mCallBack.notifyData(playPosition);
+//            mHandler.postDelayed(new Runnable() {
+//                @Override
+//                public void run() {
+//                    //实现闪烁动画效果
+//                    if (mCallBack != null) {
+//                        mCallBack.notifyData(MetronomeAdapter.DEFAULT_SELECT_POSITION);
+//                    }
+//                }
+//            }, delayMillis / 2);
         }
         playPosition++;
         totalTime = cTime;
@@ -128,46 +138,50 @@ public class PlayBeanManager {
             return;
         }
         reset();
-        setBeat(MetronomeType.METRONOME_44_TYPE);
+        setBeat(MetronomeType.METRONOME_44_TYPE, QuarterNoteRhythmType.METRONOME_1_TYPE);
         SoundPoolUtils.getInstance().init(context.getApplicationContext(), musicFileRes);
         isInit = true;
     }
 
-    public void setBeat(MetronomeType metronomeType) {
+    public void setBeat(MetronomeType metronomeType, QuarterNoteRhythmType rhythmType) {
         currentBeatType = metronomeType;
+        currentRhythmType = rhythmType;
         playPosition = 0;
         currentNoteRate = MetronomeType.getNoteSpeedValue(metronomeType);
     }
 
     public int getBeatSymbolCount() {
-        int value = currentBeatType.getValue();
-        if (value == MetronomeType.METRONOME_12_TYPE.getValue()
-                || value == MetronomeType.METRONOME_14_TYPE.getValue()) {
-            return 1;
-        }
-
-        if (value == MetronomeType.METRONOME_22_TYPE.getValue()
-                || value == MetronomeType.METRONOME_24_TYPE.getValue()) {
-            return 2;
-        }
-
-        if (value == MetronomeType.METRONOME_34_TYPE.getValue()
-                || value == MetronomeType.METRONOME_38_TYPE.getValue()) {
-            return 3;
+        if (currentBeatType != null) {
+            return currentBeatType.getBeatValue();
         }
-
-        if (value == MetronomeType.METRONOME_44_TYPE.getValue()) {
-            return 4;
-        }
-
-        if (value == MetronomeType.METRONOME_68_TYPE.getValue()) {
-            return 6;
-        }
-
-        if (value == MetronomeType.METRONOME_816_TYPE.getValue()) {
-            return 8;
-        }
-        return 0;
+//        int value = currentBeatType.getValue();
+//        if (value == MetronomeType.METRONOME_12_TYPE.getValue()
+//                || value == MetronomeType.METRONOME_14_TYPE.getValue()) {
+//            return 1;
+//        }
+//
+//        if (value == MetronomeType.METRONOME_22_TYPE.getValue()
+//                || value == MetronomeType.METRONOME_24_TYPE.getValue()) {
+//            return 2;
+//        }
+//
+//        if (value == MetronomeType.METRONOME_34_TYPE.getValue()
+//                || value == MetronomeType.METRONOME_38_TYPE.getValue()) {
+//            return 3;
+//        }
+//
+//        if (value == MetronomeType.METRONOME_44_TYPE.getValue()) {
+//            return 4;
+//        }
+//
+//        if (value == MetronomeType.METRONOME_68_TYPE.getValue()) {
+//            return 6;
+//        }
+//
+//        if (value == MetronomeType.METRONOME_816_TYPE.getValue()) {
+//            return 8;
+//        }
+        return MetronomeType.METRONOME_44_TYPE.getBeatValue();
     }
 
 
@@ -198,58 +212,84 @@ public class PlayBeanManager {
         return currentBeatType;
     }
 
+    public QuarterNoteRhythmType getCurrentRhythmType() {
+        return currentRhythmType;
+    }
+
     public void play() {
-        mHandler.removeCallbacksAndMessages(null);
-        SoundPoolUtils.getInstance().stop();
+        stopPlay();
+        resetStatus();
         mHandler.post(mRunnable);
-        totalTime = -1;
-        lastTime =-1;
         isPlaying = true;
     }
 
+    private void  resetStatus(){
+        playPosition = 0;
+        totalTime = -1;
+        lastTime = -1;
+    }
+
     public void pausePlay() {
+        stopPlay();
+        isPlaying = false;
+    }
+
+    private void stopPlay() {
         mHandler.removeCallbacksAndMessages(null);
         SoundPoolUtils.getInstance().stop();
-        isPlaying = false;
     }
 
     private boolean isTickOrTock() {
-        if (currentBeatType.getValue() == MetronomeType.METRONOME_12_TYPE.getValue() && playPosition % 1 == 0) {
-            return true;
-        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_22_TYPE.getValue() && playPosition % 2 == 0) {
-            return true;
-        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_14_TYPE.getValue() && playPosition % 1 == 0) {
-            return true;
-        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_24_TYPE.getValue() && playPosition % 2 == 0) {
-            return true;
-        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_34_TYPE.getValue() && playPosition % 3 == 0) {
-            return true;
-        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_44_TYPE.getValue() && playPosition % 4 == 0) {
-            return true;
-        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_38_TYPE.getValue() && playPosition % 3 == 0) {
-            return true;
-        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_68_TYPE.getValue() && playPosition % 6 == 0) {
-            return true;
-        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_816_TYPE.getValue() && playPosition % 8 == 0) {
-            return true;
-        } else {
+        if (currentRhythmType != QuarterNoteRhythmType.METRONOME_1_TYPE) {
+            return playPosition % currentRhythmType.getNoteCount() == 0;
+        }
+        if (currentBeatType.getValue() == MetronomeType.METRONOME_04_TYPE.getValue()) {
             return false;
         }
+        int beatValue = currentBeatType.getBeatValue();
+        return playPosition % beatValue == 0;
+//        if (currentBeatType.getValue() == MetronomeType.METRONOME_12_TYPE.getValue() && playPosition % 1 == 0) {
+//            return true;
+//        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_22_TYPE.getValue() && playPosition % 2 == 0) {
+//            return true;
+//        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_14_TYPE.getValue() && playPosition % 1 == 0) {
+//            return true;
+//        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_24_TYPE.getValue() && playPosition % 2 == 0) {
+//            return true;
+//        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_34_TYPE.getValue() && playPosition % 3 == 0) {
+//            return true;
+//        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_44_TYPE.getValue() && playPosition % 4 == 0) {
+//            return true;
+//        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_38_TYPE.getValue() && playPosition % 3 == 0) {
+//            return true;
+//        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_68_TYPE.getValue() && playPosition % 6 == 0) {
+//            return true;
+//        } else if (currentBeatType.getValue() == MetronomeType.METRONOME_816_TYPE.getValue() && playPosition % 8 == 0) {
+//            return true;
+//        } else {
+//            return false;
+//        }
     }
 
 
     public ArrayList<MetronomeType> getAllBeatTypeList() {
         if (beatSymbolLists == null) {
             beatSymbolLists = new ArrayList<>();
-            beatSymbolLists.add(MetronomeType.METRONOME_12_TYPE);
+//            beatSymbolLists.add(MetronomeType.METRONOME_12_TYPE);
+//            beatSymbolLists.add(MetronomeType.METRONOME_22_TYPE);
+//            beatSymbolLists.add(MetronomeType.METRONOME_38_TYPE);
+//            beatSymbolLists.add(MetronomeType.METRONOME_68_TYPE);
+//            beatSymbolLists.add(MetronomeType.METRONOME_816_TYPE);
+            beatSymbolLists.add(MetronomeType.METRONOME_04_TYPE);
             beatSymbolLists.add(MetronomeType.METRONOME_14_TYPE);
-            beatSymbolLists.add(MetronomeType.METRONOME_22_TYPE);
             beatSymbolLists.add(MetronomeType.METRONOME_24_TYPE);
             beatSymbolLists.add(MetronomeType.METRONOME_34_TYPE);
-            beatSymbolLists.add(MetronomeType.METRONOME_38_TYPE);
             beatSymbolLists.add(MetronomeType.METRONOME_44_TYPE);
-            beatSymbolLists.add(MetronomeType.METRONOME_68_TYPE);
-            beatSymbolLists.add(MetronomeType.METRONOME_816_TYPE);
+            beatSymbolLists.add(MetronomeType.METRONOME_54_TYPE);
+            beatSymbolLists.add(MetronomeType.METRONOME_64_TYPE);
+            beatSymbolLists.add(MetronomeType.METRONOME_74_TYPE);
+            beatSymbolLists.add(MetronomeType.METRONOME_84_TYPE);
+            beatSymbolLists.add(MetronomeType.METRONOME_94_TYPE);
         }
         return beatSymbolLists;
     }
@@ -259,9 +299,9 @@ public class PlayBeanManager {
         this.mCallBack = callBackListener;
     }
 
-    public void resetCallBackListener(IPlayBeatCallBack callBackListener){
-        if(this.mCallBack == callBackListener){
-            this.mCallBack =null;
+    public void resetCallBackListener(IPlayBeatCallBack callBackListener) {
+        if (this.mCallBack == callBackListener) {
+            this.mCallBack = null;
         }
     }
 }

+ 1 - 1
metronome/src/main/java/com/cooleshow/metronome/Utils/SoundPoolUtils.java

@@ -66,7 +66,7 @@ public class SoundPoolUtils implements SoundPool.OnLoadCompleteListener {
 
     public void stop() {
         if (soundPool != null) {
-            soundPool.stop(mStreamID);
+            soundPool.pause(mStreamID);
             mStreamID = DEFAULT_INVALID_ID;
         }
     }

+ 41 - 0
metronome/src/main/java/com/cooleshow/metronome/adapter/MoreRhythmTypeAdapter.java

@@ -0,0 +1,41 @@
+package com.cooleshow.metronome.adapter;
+
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.viewholder.BaseViewHolder;
+import com.cooleshow.metronome.R;
+import com.cooleshow.metronome.constants.QuarterNoteRhythmType;
+
+import androidx.annotation.NonNull;
+
+/**
+ * Author by pq, Date on 2024/4/29.
+ */
+public class MoreRhythmTypeAdapter extends BaseQuickAdapter<QuarterNoteRhythmType, BaseViewHolder> {
+    public QuarterNoteRhythmType selectData;
+
+
+    public MoreRhythmTypeAdapter() {
+        super(R.layout.item_more_rhythm_type_layout);
+    }
+
+    public QuarterNoteRhythmType getSelectData() {
+        return selectData;
+    }
+
+    public void setSelectData(QuarterNoteRhythmType selectData) {
+        this.selectData = selectData;
+        notifyDataSetChanged();
+    }
+
+    @Override
+    protected void convert(@NonNull BaseViewHolder holder, QuarterNoteRhythmType rhythmType) {
+        ImageView iv_icon = holder.getView(R.id.iv_icon);
+        FrameLayout fl_root = holder.getView(R.id.fl_root);
+        boolean isSelect = rhythmType == selectData;
+        iv_icon.setImageResource(isSelect ? rhythmType.getSelectImgRes() : rhythmType.getImgRes());
+        fl_root.setBackgroundResource(isSelect ? R.drawable.shape_ebf8ff_6dp_border_1cacf1 : R.drawable.shape_f6f6f6_6dp);
+    }
+}

+ 1 - 1
metronome/src/main/java/com/cooleshow/metronome/constants/MetronomeConfig.java

@@ -18,7 +18,7 @@ public class MetronomeConfig {
 
 
     public static int getNoteDrawable(MetronomeType metronomeType) {
-        return R.mipmap.icon_quarter_note;
+        return R.mipmap.icon_quarter_note_tag2;
 //        if (TextUtils.equals(metronomeType.getNoteValue(), "4")) {
 //            return R.mipmap.icon_quarter_note;
 //        }

+ 23 - 11
metronome/src/main/java/com/cooleshow/metronome/constants/MetronomeType.java

@@ -8,25 +8,33 @@ import com.contrarywind.interfaces.IPickerViewData;
  * Author by pq, Date on 2022/9/16.
  */
 public enum MetronomeType implements IPickerViewData {
-    METRONOME_12_TYPE(0, "1/2", "2"),
-    METRONOME_22_TYPE(1, "2/2", "2"),
-    METRONOME_14_TYPE(2, "1/4", "4"),
-    METRONOME_24_TYPE(3, "2/4", "4"),
-    METRONOME_34_TYPE(4, "3/4", "4"),
-    METRONOME_44_TYPE(5, "4/4", "4"),
-    METRONOME_38_TYPE(6, "3/8", "8"),
-    METRONOME_68_TYPE(7, "6/8", "8"),
-    METRONOME_816_TYPE(8, "8/16", "16");
+    METRONOME_12_TYPE(0, 1, "1/2", "2"),
+    METRONOME_22_TYPE(1, 2, "2/2", "2"),
+    METRONOME_38_TYPE(2, 3, "3/8", "8"),
+    METRONOME_68_TYPE(3, 6, "6/8", "8"),
+    METRONOME_816_TYPE(4, 8, "8/16", "16"),
+    METRONOME_04_TYPE(5, 1, "0", "4"),//没有重拍
+    METRONOME_14_TYPE(6, 1, "1", "4"),//只有重拍
+    METRONOME_24_TYPE(7, 2, "2", "4"),
+    METRONOME_34_TYPE(8, 3, "3", "4"),
+    METRONOME_44_TYPE(9, 4, "4", "4"),
+    METRONOME_54_TYPE(10, 5, "5", "4"),
+    METRONOME_64_TYPE(11, 6, "6", "4"),
+    METRONOME_74_TYPE(12, 7, "7", "4"),
+    METRONOME_84_TYPE(13, 8, "8", "4"),
+    METRONOME_94_TYPE(14, 9, "9", "4");
 
     private int value;
+    private int beatValue;
     private String name;
     private String noteValue;
 
 
-    private MetronomeType(int value, String name, String noteValue) {
+    private MetronomeType(int value, int beatValue, String name, String noteValue) {
         this.value = value;
         this.name = name;
         this.noteValue = noteValue;
+        this.beatValue = beatValue;
     }
 
     public int getValue() {
@@ -41,6 +49,10 @@ public enum MetronomeType implements IPickerViewData {
         return noteValue;
     }
 
+    public int getBeatValue() {
+        return beatValue;
+    }
+
     public static MetronomeType setValue(int code) {
         MetronomeType[] var1 = values();
         int var2 = var1.length;
@@ -75,6 +87,6 @@ public enum MetronomeType implements IPickerViewData {
 
     @Override
     public String getPickerViewText() {
-        return this.name;
+        return getName();
     }
 }

+ 96 - 0
metronome/src/main/java/com/cooleshow/metronome/constants/QuarterNoteRhythmType.java

@@ -0,0 +1,96 @@
+package com.cooleshow.metronome.constants;
+
+import com.cooleshow.metronome.R;
+
+/**
+ * Author by pq, Date on 2024/4/29.
+ * 4分音符节奏类型
+ */
+public enum QuarterNoteRhythmType {
+    METRONOME_1_TYPE(1, 1,R.mipmap.icon_4_rhythm_1_normal, R.mipmap.icon_4_rhythm_1_select, ""),
+    METRONOME_2_TYPE(2, 2,R.mipmap.icon_4_rhythm_2_normal, R.mipmap.icon_4_rhythm_2_select, ""),
+    METRONOME_3_TYPE(3, 3,R.mipmap.icon_4_rhythm_3_normal, R.mipmap.icon_4_rhythm_3_select, ""),
+    METRONOME_4_TYPE(4, 4,R.mipmap.icon_4_rhythm_4_normal, R.mipmap.icon_4_rhythm_4_select, ""),
+    METRONOME_5_TYPE(5, 2,R.mipmap.icon_4_rhythm_5_normal, R.mipmap.icon_4_rhythm_5_select, ""),
+    METRONOME_6_TYPE(6, 2,R.mipmap.icon_4_rhythm_6_normal, R.mipmap.icon_4_rhythm_6_select, ""),
+    METRONOME_7_TYPE(7, 3,R.mipmap.icon_4_rhythm_7_normal, R.mipmap.icon_4_rhythm_7_select, "");
+    private int value;
+
+    private int noteCount;
+    private int imgRes;
+    private int selectImgRes;
+    private String des;
+
+    private QuarterNoteRhythmType(int value, int noteCount,int imgRes, int selectImgRes, String des) {
+        this.value = value;
+        this.noteCount = noteCount;
+        this.imgRes = imgRes;
+        this.selectImgRes = selectImgRes;
+        this.des = des;
+    }
+
+    public int getNoteCount() {
+        return noteCount;
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public int getImgRes() {
+        return imgRes;
+    }
+
+    public int getSelectImgRes() {
+        return selectImgRes;
+    }
+
+    public String getDes() {
+        return des;
+    }
+
+    public static float countSingleNoteDuration(QuarterNoteRhythmType rhythmType, int pos) {
+        if (rhythmType == QuarterNoteRhythmType.METRONOME_1_TYPE) {
+            //单音符节奏
+            return 1.0f;
+        }
+        if (rhythmType == QuarterNoteRhythmType.METRONOME_2_TYPE) {
+            //二个八分音符的节奏
+            return 0.5f;
+        }
+
+        if (rhythmType == QuarterNoteRhythmType.METRONOME_3_TYPE) {
+            //三连音音符的节奏
+            return 0.333333f;
+        }
+        if (rhythmType == QuarterNoteRhythmType.METRONOME_4_TYPE) {
+            //四连音音符的节奏
+            return 0.25f;
+        }
+        if (rhythmType == QuarterNoteRhythmType.METRONOME_5_TYPE) {
+            //三连音的重音音符的节奏(第一个音符占三分之二,第二个音符占三分之一时值)
+            if (pos % 2 == 1) {
+                return 0.666666f;
+            } else {
+                return 0.333333f;
+            }
+        }
+        if (rhythmType == QuarterNoteRhythmType.METRONOME_6_TYPE) {
+            //
+            if (pos % 2 == 1) {
+                return 0.75f;
+            } else {
+                return 0.25f;
+            }
+        }
+        if (rhythmType == QuarterNoteRhythmType.METRONOME_7_TYPE) {
+            //
+            if (pos % 3 == 1) {
+                return 0.5f;
+            } else {
+                return 0.25f;
+            }
+        }
+        return 1.0f;
+    }
+}

+ 160 - 0
metronome/src/main/java/com/cooleshow/metronome/widget/MoreRhythmTypeDialog.java

@@ -0,0 +1,160 @@
+package com.cooleshow.metronome.widget;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.os.Build;
+import android.os.Bundle;
+import android.view.Gravity;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.TextView;
+
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.listener.OnItemClickListener;
+import com.cooleshow.metronome.R;
+import com.cooleshow.metronome.adapter.MoreRhythmTypeAdapter;
+import com.cooleshow.metronome.constants.QuarterNoteRhythmType;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+/**
+ * Author by pq, Date on 2024/4/29.
+ */
+public class MoreRhythmTypeDialog extends Dialog implements View.OnClickListener {
+
+    private RecyclerView mRecyclerView;
+    private MoreRhythmTypeAdapter mTypeAdapter;
+    private TextView mTvFinish;
+    private TextView mTvCancel;
+
+    private OnEventListener mEventListener;
+
+    public MoreRhythmTypeDialog(@NonNull Context context) {
+        super(context, com.cooleshow.base.R.style.BottomDialogStyle);
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.dialog_rhythm_type_layout);
+        initParams();
+        initView();
+        initData();
+        initListener();
+    }
+
+    private void initView() {
+        mRecyclerView = findViewById(R.id.recyclerView);
+        mTvFinish = findViewById(R.id.tv_finish);
+        mTvCancel = findViewById(R.id.tv_cancel);
+        mTypeAdapter = new MoreRhythmTypeAdapter();
+        mRecyclerView.setLayoutManager(new GridLayoutManager(getContext(), 3));
+        mRecyclerView.setAdapter(mTypeAdapter);
+    }
+
+    private void initParams() {
+        Window window = getWindow();
+        //设置dialog在屏幕底部
+        window.setGravity(Gravity.BOTTOM);
+        //设置dialog弹出时的动画效果,从屏幕底部向上弹出
+        window.setWindowAnimations(com.cooleshow.base.R.style.BottomAnimation);
+        window.getDecorView().setPadding(0, 0, 0, 0);
+        //获得window窗口的属性
+        WindowManager.LayoutParams lp = window.getAttributes();
+        //设置窗口宽度为充满全屏
+        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
+        //设置窗口高度为包裹内容
+        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
+        lp.horizontalMargin = 0;
+        lp.verticalMargin = 0;
+        //将设置好的属性set回去
+        window.setAttributes(lp);
+        hideNavigationBar();
+        adjustFullScreen(getWindow());
+    }
+
+    private void hideNavigationBar() {
+        int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                | View.SYSTEM_UI_FLAG_IMMERSIVE
+                | View.SYSTEM_UI_FLAG_FULLSCREEN;
+        this.getWindow().getDecorView().setSystemUiVisibility(uiOptions);
+    }
+
+    public void adjustFullScreen(Window window) {
+        if (window == null) {
+            return;
+        }
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+            WindowManager.LayoutParams lp = window.getAttributes();
+            lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
+            window.setAttributes(lp);
+            final View decorView = window.getDecorView();
+            decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+        }
+    }
+
+    private void initListener() {
+        mTypeAdapter.setOnItemClickListener(new OnItemClickListener() {
+            @Override
+            public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                if (position < mTypeAdapter.getData().size()) {
+                    QuarterNoteRhythmType quarterNoteRhythmType = mTypeAdapter.getData().get(position);
+                    mTypeAdapter.setSelectData(quarterNoteRhythmType);
+                }
+            }
+        });
+        mTvCancel.setOnClickListener(this);
+        mTvFinish.setOnClickListener(this);
+    }
+
+    private void initData() {
+        QuarterNoteRhythmType[] values = QuarterNoteRhythmType.values();
+        ArrayList<QuarterNoteRhythmType> list = new ArrayList<>(Arrays.asList(values));
+        mTypeAdapter.setList(list);
+    }
+
+    public void setSelect(QuarterNoteRhythmType rhythmType) {
+        if (mTypeAdapter != null) {
+            mTypeAdapter.setSelectData(rhythmType);
+        }
+    }
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == R.id.tv_cancel) {
+            dismiss();
+            return;
+        }
+        if (id == R.id.tv_finish) {
+            if (mEventListener != null) {
+                QuarterNoteRhythmType selectData = mTypeAdapter.getSelectData();
+                if (selectData != null) {
+                    mEventListener.onSelect(selectData);
+                }
+            }
+            return;
+        }
+    }
+
+
+    public void setEventListener(OnEventListener eventListener) {
+        mEventListener = eventListener;
+    }
+
+    public interface OnEventListener {
+        void onSelect(QuarterNoteRhythmType rhythmType);
+    }
+}

+ 6 - 0
metronome/src/main/res/drawable/shape_ebf8ff_6dp_border_1cacf1.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#EBF8FF"/>
+    <corners android:radius="6dp"/>
+    <stroke android:color="@color/color_1cacf1" android:width="1dp"/>
+</shape>

+ 5 - 0
metronome/src/main/res/drawable/shape_f6f6f6_6dp.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_f6f6f6"/>
+    <corners android:radius="6dp"/>
+</shape>

+ 92 - 46
metronome/src/main/res/layout-sw600dp-hdpi/activity_metronome_layout.xml

@@ -15,6 +15,7 @@
         android:id="@+id/recyclerView"
         android:layout_width="wrap_content"
         android:layout_height="21dp"
+        android:visibility="gone"
         android:layout_marginStart="13dp"
         android:layout_marginTop="@dimen/qb_px_100"
         android:layout_marginEnd="13dp"
@@ -26,9 +27,9 @@
 
     <ImageView
         android:id="@+id/iv_plate"
-        android:layout_width="316dp"
-        android:layout_height="316dp"
-        android:layout_marginTop="@dimen/qb_px_165"
+        android:layout_width="@dimen/qb_px_316"
+        android:layout_height="@dimen/qb_px_316"
+        android:layout_marginTop="@dimen/qb_px_100"
         android:src="@mipmap/bg_metronome"
         android:visibility="visible"
         app:layout_constraintLeft_toLeftOf="parent"
@@ -38,8 +39,8 @@
 
     <ImageView
         android:id="@+id/iv_plate2"
-        android:layout_width="232dp"
-        android:layout_height="232dp"
+        android:layout_width="@dimen/qb_px_232"
+        android:layout_height="@dimen/qb_px_232"
         android:src="@mipmap/bg_metronome2"
         android:visibility="visible"
         app:layout_constraintBottom_toBottomOf="@+id/iv_plate"
@@ -49,8 +50,8 @@
 
     <com.cooleshow.metronome.widget.CircularSeekBar
         android:id="@+id/cir_seekbar"
-        android:layout_width="232dp"
-        android:layout_height="232dp"
+        android:layout_width="@dimen/qb_px_232"
+        android:layout_height="@dimen/qb_px_232"
         app:maxProgress="150"
         app:layout_constraintBottom_toBottomOf="@+id/iv_plate"
         app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
@@ -60,8 +61,8 @@
 
     <ImageView
         android:id="@+id/iv_plate3"
-        android:layout_width="178dp"
-        android:layout_height="178dp"
+        android:layout_width="@dimen/qb_px_178"
+        android:layout_height="@dimen/qb_px_178"
         android:src="@mipmap/bg_metronome3"
         android:visibility="invisible"
         app:layout_constraintBottom_toBottomOf="@+id/iv_plate"
@@ -70,6 +71,7 @@
         app:layout_constraintTop_toTopOf="@+id/iv_plate" />
     
     <ImageView
+        android:visibility="gone"
         android:id="@+id/iv_bg_metronome4"
         app:layout_constraintBottom_toBottomOf="@+id/iv_plate"
         app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
@@ -88,22 +90,24 @@
         android:textColor="@color/color_333333"
         android:textSize="@dimen/sp_40"
         android:textStyle="bold"
+        app:layout_constraintLeft_toRightOf="@+id/iv_note"
         app:layout_constraintBottom_toBottomOf="@+id/iv_plate"
-        app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
         app:layout_constraintRight_toRightOf="@+id/iv_plate"
         app:layout_constraintTop_toTopOf="@+id/iv_plate"
         tools:text="136" />
 
 
     <ImageView
-        android:visibility="gone"
         android:id="@+id/iv_note"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:src="@mipmap/icon_quarter_note"
-        app:layout_constraintCircle="@+id/tv_speed"
-        app:layout_constraintCircleAngle="320"
-        app:layout_constraintCircleRadius="55dp" />
+        android:src="@mipmap/icon_quarter_note_tag2"
+        android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_speed"
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
+        app:layout_constraintRight_toLeftOf="@+id/tv_speed"
+        app:layout_constraintTop_toTopOf="@+id/tv_speed" />
 
     <TextView
         android:layout_marginBottom="10dp"
@@ -113,6 +117,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="速度"
+        android:visibility="gone"
         android:textColor="@color/color_333333"
         android:textSize="@dimen/sp_15" />
 
@@ -120,12 +125,23 @@
         android:id="@+id/iv_reduce"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="11dp"
+        android:padding="@dimen/qb_px_8"
         android:src="@mipmap/icon_metronome_bt_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
+        app:layout_constraintRight_toRightOf="@+id/iv_plate"
+        app:layout_constraintTop_toBottomOf="@+id/tv_speed" />
+
+
+    <ImageView
+        android:id="@+id/iv_add"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/qb_px_8"
+        android:src="@mipmap/icon_metronome_add_bt_bg"
+        app:layout_constraintBottom_toTopOf="@+id/tv_speed"
         app:layout_constraintHorizontal_chainStyle="packed"
         app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
-        app:layout_constraintRight_toLeftOf="@+id/iv_beat_value"
-        app:layout_constraintTop_toBottomOf="@+id/iv_plate" />
+        app:layout_constraintRight_toRightOf="@+id/iv_plate" />
 
     <!--    <ImageView-->
     <!--        android:layout_width="wrap_content"-->
@@ -136,56 +152,86 @@
     <!--        app:layout_constraintRight_toRightOf="@+id/iv_reduce"-->
     <!--        app:layout_constraintTop_toTopOf="@+id/iv_reduce" />-->
 
+    <androidx.constraintlayout.widget.Guideline
+        android:id="@+id/guideline_center"
+        app:layout_constraintGuide_percent="0.5"
+        android:orientation="vertical"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
     <ImageView
+        app:layout_constraintWidth_default="wrap"
         android:id="@+id/iv_beat_value"
-        android:layout_width="wrap_content"
+        android:layout_width="0dp"
+        app:layout_constraintHorizontal_bias="1"
         android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/qb_px_20"
         android:src="@mipmap/icon_beat_value_bg"
-        app:layout_constraintLeft_toRightOf="@+id/iv_reduce"
-        app:layout_constraintRight_toLeftOf="@+id/iv_add"
-        app:layout_constraintTop_toTopOf="@+id/iv_reduce" />
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toLeftOf="@+id/guideline_center"
+        app:layout_constraintTop_toBottomOf="@+id/iv_plate" />
 
     <ImageView
-        android:id="@+id/iv_add"
-        android:layout_width="wrap_content"
+        app:layout_constraintHorizontal_bias="0"
+        app:layout_constraintWidth_default="wrap"
+        android:id="@+id/iv_rhythm_value_bg"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:src="@mipmap/icon_metronome_add_bt_bg"
-        app:layout_constraintLeft_toRightOf="@+id/iv_beat_value"
-        app:layout_constraintRight_toRightOf="@+id/iv_plate"
-        app:layout_constraintTop_toTopOf="@+id/iv_reduce" />
+        android:src="@mipmap/icon_beat_value_bg"
+        app:layout_constraintLeft_toRightOf="@+id/guideline_center"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/iv_beat_value" />
 
-    <!--    <ImageView-->
-    <!--        android:layout_width="wrap_content"-->
-    <!--        android:layout_height="wrap_content"-->
-    <!--        android:src="@mipmap/icon_add_symbol"-->
-    <!--        app:layout_constraintBottom_toBottomOf="@+id/iv_add"-->
-    <!--        app:layout_constraintLeft_toLeftOf="@+id/iv_add"-->
-    <!--        app:layout_constraintRight_toRightOf="@+id/iv_add"-->
-    <!--        app:layout_constraintTop_toTopOf="@+id/iv_add" />-->
 
     <TextView
         android:id="@+id/tv_current_beat"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:drawablePadding="10dp"
         android:includeFontPadding="false"
-        android:text="6/4"
+        android:text="4"
         android:textColor="@color/color_1a1a1a"
-        android:textSize="@dimen/sp_19"
-        android:drawablePadding="10dp"
+        android:textSize="@dimen/sp_24"
         android:textStyle="bold"
-        android:drawableRight="@mipmap/icon_play_beat_arrow_down"
         app:layout_constraintBottom_toBottomOf="@+id/iv_beat_value"
+        app:layout_constraintTop_toTopOf="@+id/iv_beat_value"
+        app:layout_constraintHorizontal_chainStyle="packed"
         app:layout_constraintLeft_toLeftOf="@+id/iv_beat_value"
+        app:layout_constraintRight_toLeftOf="@+id/tv_current_beat_tip"
+        tools:text="4" />
+
+    <TextView
+        android:id="@+id/tv_current_beat_tip"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="3dp"
+        android:includeFontPadding="false"
+        android:text="拍"
+        android:textColor="@color/color_1a1a1a"
+        android:textSize="@dimen/sp_16"
+        android:textStyle="bold"
+        app:layout_constraintBottom_toBottomOf="@+id/iv_beat_value"
+        app:layout_constraintLeft_toRightOf="@+id/tv_current_beat"
         app:layout_constraintRight_toRightOf="@+id/iv_beat_value"
-        app:layout_constraintTop_toTopOf="@+id/iv_beat_value"
-        tools:text="6/4" />
+        app:layout_constraintTop_toTopOf="@+id/iv_beat_value" />
+
+    <ImageView
+        android:id="@+id/iv_rhythm_value"
+        android:layout_width="44dp"
+        android:layout_height="46dp"
+        android:src="@mipmap/icon_4_rhythm_1_normal"
+        app:layout_constraintBottom_toBottomOf="@+id/iv_rhythm_value_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_rhythm_value_bg"
+        app:layout_constraintRight_toRightOf="@+id/iv_rhythm_value_bg"
+        app:layout_constraintTop_toTopOf="@+id/iv_rhythm_value_bg" />
 
 
     <androidx.appcompat.widget.AppCompatSeekBar
         android:id="@+id/volume_seek_bar"
-        android:layout_width="210dp"
+        android:layout_width="@dimen/qb_px_210"
         android:layout_height="wrap_content"
-        android:layout_marginTop="24dp"
+        android:layout_marginTop="@dimen/qb_px_24"
         android:max="100"
         android:background="@null"
         android:maxHeight="4dp"
@@ -234,14 +280,14 @@
         android:layout_width="0dp"
         android:layout_height="54dp"
         android:layout_marginStart="@dimen/qb_px_103"
-        android:layout_marginTop="@dimen/qb_px_114"
+        android:layout_marginTop="@dimen/qb_px_54"
         android:layout_marginEnd="@dimen/qb_px_103"
         android:background="@drawable/shape_00acff_27dp"
         android:gravity="center"
         android:orientation="horizontal"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/iv_beat_value">
+        app:layout_constraintTop_toBottomOf="@+id/volume_seek_bar">
 
         <TextView
             android:id="@+id/tv_play"

+ 110 - 66
metronome/src/main/res/layout/activity_metronome_layout.xml

@@ -11,6 +11,7 @@
         android:id="@+id/toolbar_include"
         layout="@layout/common_toolbar_layout" />
 
+
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/recyclerView"
         android:layout_width="wrap_content"
@@ -20,6 +21,7 @@
         android:layout_marginEnd="13dp"
         android:overScrollMode="never"
         android:scrollbars="none"
+        android:visibility="gone"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/toolbar_include" />
@@ -28,7 +30,7 @@
         android:id="@+id/iv_plate"
         android:layout_width="316dp"
         android:layout_height="316dp"
-        android:layout_marginTop="65dp"
+        android:layout_marginTop="@dimen/qb_px_65"
         android:src="@mipmap/bg_metronome"
         android:visibility="visible"
         app:layout_constraintLeft_toLeftOf="parent"
@@ -51,11 +53,11 @@
         android:id="@+id/cir_seekbar"
         android:layout_width="232dp"
         android:layout_height="232dp"
-        app:maxProgress="150"
         app:layout_constraintBottom_toBottomOf="@+id/iv_plate"
         app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
         app:layout_constraintRight_toRightOf="@+id/iv_plate"
-        app:layout_constraintTop_toTopOf="@+id/iv_plate" />
+        app:layout_constraintTop_toTopOf="@+id/iv_plate"
+        app:maxProgress="150" />
 
 
     <ImageView
@@ -68,17 +70,31 @@
         app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
         app:layout_constraintRight_toRightOf="@+id/iv_plate"
         app:layout_constraintTop_toTopOf="@+id/iv_plate" />
-    
+
     <ImageView
         android:id="@+id/iv_bg_metronome4"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:src="@mipmap/bg_metronome4"
+        android:visibility="gone"
         app:layout_constraintBottom_toBottomOf="@+id/iv_plate"
         app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
         app:layout_constraintRight_toRightOf="@+id/iv_plate"
-        app:layout_constraintTop_toTopOf="@+id/iv_plate"
-        android:src="@mipmap/bg_metronome4"
+        app:layout_constraintTop_toTopOf="@+id/iv_plate" />
+
+
+    <ImageView
+        android:id="@+id/iv_note"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
-    
+        android:layout_height="wrap_content"
+        android:src="@mipmap/icon_quarter_note_tag2"
+        android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_speed"
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
+        app:layout_constraintRight_toLeftOf="@+id/tv_speed"
+        app:layout_constraintTop_toTopOf="@+id/tv_speed" />
+
     <TextView
         android:id="@+id/tv_speed"
         android:layout_width="wrap_content"
@@ -89,44 +105,44 @@
         android:textSize="@dimen/sp_40"
         android:textStyle="bold"
         app:layout_constraintBottom_toBottomOf="@+id/iv_plate"
-        app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
+        app:layout_constraintLeft_toRightOf="@+id/iv_note"
         app:layout_constraintRight_toRightOf="@+id/iv_plate"
         app:layout_constraintTop_toTopOf="@+id/iv_plate"
         tools:text="136" />
 
-
-    <ImageView
-        android:visibility="gone"
-        android:id="@+id/iv_note"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:src="@mipmap/icon_quarter_note"
-        app:layout_constraintCircle="@+id/tv_speed"
-        app:layout_constraintCircleAngle="320"
-        app:layout_constraintCircleRadius="55dp" />
-
     <TextView
-        android:layout_marginBottom="10dp"
-        app:layout_constraintRight_toRightOf="@+id/iv_bg_metronome4"
-        app:layout_constraintLeft_toLeftOf="@+id/iv_bg_metronome4"
-        app:layout_constraintBottom_toTopOf="@+id/iv_bg_metronome4"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="10dp"
         android:text="速度"
         android:textColor="@color/color_333333"
-        android:textSize="@dimen/sp_15" />
+        android:textSize="@dimen/sp_15"
+        android:visibility="gone"
+        app:layout_constraintBottom_toTopOf="@+id/iv_bg_metronome4"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_bg_metronome4"
+        app:layout_constraintRight_toRightOf="@+id/iv_bg_metronome4" />
 
     <ImageView
         android:id="@+id/iv_reduce"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="11dp"
+        android:padding="@dimen/qb_px_8"
         android:src="@mipmap/icon_metronome_bt_bg"
-        app:layout_constraintHorizontal_chainStyle="packed"
         app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
-        app:layout_constraintRight_toLeftOf="@+id/iv_beat_value"
-        app:layout_constraintTop_toBottomOf="@+id/iv_plate" />
+        app:layout_constraintRight_toRightOf="@+id/iv_plate"
+        app:layout_constraintTop_toBottomOf="@+id/tv_speed" />
+
 
+    <ImageView
+        android:id="@+id/iv_add"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/qb_px_8"
+        android:src="@mipmap/icon_metronome_add_bt_bg"
+        app:layout_constraintBottom_toTopOf="@+id/tv_speed"
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_plate"
+        app:layout_constraintRight_toRightOf="@+id/iv_plate" />
     <!--    <ImageView-->
     <!--        android:layout_width="wrap_content"-->
     <!--        android:layout_height="wrap_content"-->
@@ -136,75 +152,105 @@
     <!--        app:layout_constraintRight_toRightOf="@+id/iv_reduce"-->
     <!--        app:layout_constraintTop_toTopOf="@+id/iv_reduce" />-->
 
+    <View
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:id="@+id/view_help"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        android:layout_width="10dp"
+        android:layout_height="match_parent"/>
+
     <ImageView
         android:id="@+id/iv_beat_value"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/qb_px_20"
         android:src="@mipmap/icon_beat_value_bg"
-        app:layout_constraintLeft_toRightOf="@+id/iv_reduce"
-        app:layout_constraintRight_toLeftOf="@+id/iv_add"
-        app:layout_constraintTop_toTopOf="@+id/iv_reduce" />
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintRight_toRightOf="@+id/view_help"
+        app:layout_constraintTop_toBottomOf="@+id/iv_plate" />
+
 
     <ImageView
-        android:id="@+id/iv_add"
+        android:id="@+id/iv_rhythm_value_bg"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:src="@mipmap/icon_metronome_add_bt_bg"
-        app:layout_constraintLeft_toRightOf="@+id/iv_beat_value"
-        app:layout_constraintRight_toRightOf="@+id/iv_plate"
-        app:layout_constraintTop_toTopOf="@+id/iv_reduce" />
+        android:src="@mipmap/icon_beat_value_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_help"
+        app:layout_constraintTop_toTopOf="@+id/iv_beat_value" />
 
-    <!--    <ImageView-->
-    <!--        android:layout_width="wrap_content"-->
-    <!--        android:layout_height="wrap_content"-->
-    <!--        android:src="@mipmap/icon_add_symbol"-->
-    <!--        app:layout_constraintBottom_toBottomOf="@+id/iv_add"-->
-    <!--        app:layout_constraintLeft_toLeftOf="@+id/iv_add"-->
-    <!--        app:layout_constraintRight_toRightOf="@+id/iv_add"-->
-    <!--        app:layout_constraintTop_toTopOf="@+id/iv_add" />-->
 
     <TextView
         android:id="@+id/tv_current_beat"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:drawablePadding="10dp"
         android:includeFontPadding="false"
-        android:text="6/4"
+        android:text="4"
         android:textColor="@color/color_1a1a1a"
-        android:textSize="@dimen/sp_19"
-        android:drawablePadding="10dp"
+        android:textSize="@dimen/sp_24"
         android:textStyle="bold"
-        android:drawableRight="@mipmap/icon_play_beat_arrow_down"
         app:layout_constraintBottom_toBottomOf="@+id/iv_beat_value"
+        app:layout_constraintTop_toTopOf="@+id/iv_beat_value"
+        app:layout_constraintHorizontal_chainStyle="packed"
         app:layout_constraintLeft_toLeftOf="@+id/iv_beat_value"
+        app:layout_constraintRight_toLeftOf="@+id/tv_current_beat_tip"
+        tools:text="4" />
+
+    <TextView
+        android:id="@+id/tv_current_beat_tip"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="3dp"
+        android:includeFontPadding="false"
+        android:text="拍"
+        android:textColor="@color/color_1a1a1a"
+        android:textSize="@dimen/sp_16"
+        android:textStyle="bold"
+        app:layout_constraintBottom_toBottomOf="@+id/iv_beat_value"
+        app:layout_constraintLeft_toRightOf="@+id/tv_current_beat"
         app:layout_constraintRight_toRightOf="@+id/iv_beat_value"
-        app:layout_constraintTop_toTopOf="@+id/iv_beat_value"
-        tools:text="6/4" />
+        app:layout_constraintTop_toTopOf="@+id/iv_beat_value" />
+
+    <ImageView
+        android:id="@+id/iv_rhythm_value"
+        android:layout_width="44dp"
+        android:layout_height="46dp"
+        android:src="@mipmap/icon_4_rhythm_1_normal"
+        app:layout_constraintBottom_toBottomOf="@+id/iv_rhythm_value_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/iv_rhythm_value_bg"
+        app:layout_constraintRight_toRightOf="@+id/iv_rhythm_value_bg"
+        app:layout_constraintTop_toTopOf="@+id/iv_rhythm_value_bg" />
 
 
     <androidx.appcompat.widget.AppCompatSeekBar
+        android:paddingStart="16dp"
+        android:paddingEnd="16dp"
         android:id="@+id/volume_seek_bar"
-        android:layout_width="210dp"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginTop="24dp"
-        android:max="100"
+        android:layout_marginTop="@dimen/qb_px_22"
         android:background="@null"
+        android:max="100"
         android:maxHeight="4dp"
         android:progress="50"
         android:progressDrawable="@drawable/bg_volume_seekbar"
         android:splitTrack="false"
         android:thumb="@mipmap/icon_beat_volume_seekbar_thump"
         android:visibility="visible"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintRight_toLeftOf="@+id/tv_volume_value"
+        app:layout_constraintLeft_toRightOf="@+id/iv_volume"
         app:layout_constraintTop_toBottomOf="@+id/iv_beat_value" />
 
     <ImageView
+        android:id="@+id/iv_volume"
+        app:layout_constraintLeft_toLeftOf="@+id/ll_play"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginEnd="2dp"
         android:src="@mipmap/icon_volume_trumpet_add"
         app:layout_constraintBottom_toBottomOf="@+id/volume_seek_bar"
-        app:layout_constraintRight_toLeftOf="@+id/volume_seek_bar"
         app:layout_constraintTop_toTopOf="@+id/volume_seek_bar" />
 
     <!--    <ImageView-->
@@ -217,14 +263,14 @@
     <!--        android:layout_height="wrap_content"/>-->
 
     <TextView
+        app:layout_constraintRight_toRightOf="@+id/ll_play"
         android:id="@+id/tv_volume_value"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:paddingStart="6dp"
-        android:textColor="@color/color_58a2ec"
+        android:textColor="@color/color_1cacf1"
         android:textSize="@dimen/sp_16"
         app:layout_constraintBottom_toBottomOf="@+id/volume_seek_bar"
-        app:layout_constraintLeft_toRightOf="@+id/volume_seek_bar"
         app:layout_constraintTop_toTopOf="@+id/volume_seek_bar"
         tools:text="40" />
 
@@ -234,14 +280,14 @@
         android:layout_width="0dp"
         android:layout_height="54dp"
         android:layout_marginStart="53dp"
-        android:layout_marginTop="101dp"
+        android:layout_marginTop="@dimen/qb_px_40"
         android:layout_marginEnd="53dp"
         android:background="@drawable/shape_00acff_27dp"
         android:gravity="center"
         android:orientation="horizontal"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/iv_beat_value">
+        app:layout_constraintTop_toBottomOf="@+id/volume_seek_bar">
 
         <TextView
             android:id="@+id/tv_play"
@@ -255,11 +301,9 @@
 
         <ImageView
             android:id="@+id/iv_play_status_tag"
-            android:layout_marginStart="10dp"
-            android:src="@mipmap/icon_play_beat_bt_tag"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"/>
+            android:layout_height="wrap_content"
+            android:layout_marginStart="10dp"
+            android:src="@mipmap/icon_play_beat_bt_tag" />
     </LinearLayout>
-
-
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 66 - 0
metronome/src/main/res/layout/dialog_rhythm_type_layout.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/bg_white_top_10dp"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="50dp">
+
+
+        <TextView
+            android:id="@+id/tv_cancel"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="17dp"
+            android:text="取消"
+            android:textColor="@color/color_999999"
+            android:textSize="@dimen/dp_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:text="节奏型"
+            android:textColor="@color/color_1a1a1a"
+            android:textSize="18dp" />
+
+        <TextView
+            android:id="@+id/tv_finish"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:layout_marginRight="17dp"
+            android:padding="8dp"
+            android:text="确定"
+            android:textColor="@color/color_1cacf1"
+            android:textSize="@dimen/dp_16" />
+
+    </RelativeLayout>
+
+    <View style="@style/line_style" />
+    <!--此部分需要完整复制过去,删减或者更改ID会导致初始化找不到内容而报空-->
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/optionspicker"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/dp_250"
+        android:background="#ffffff"
+        android:gravity="center"
+        android:minHeight="150dp"
+        android:orientation="horizontal">
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/recyclerView"
+            android:layout_marginTop="16dp"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginStart="7dp"
+            android:layout_marginEnd="7dp"
+            android:overScrollMode="never"
+            android:scrollbars="none" />
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</LinearLayout>

+ 21 - 0
metronome/src/main/res/layout/item_more_rhythm_type_layout.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_marginStart="5dp"
+    android:layout_marginEnd="5dp"
+    android:paddingStart="9dp"
+    android:id="@+id/fl_root"
+    android:paddingEnd="9dp"
+    android:minHeight="@dimen/qb_px_48"
+    android:layout_marginBottom="12dp"
+    android:background="@drawable/shape_f6f6f6_6dp"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:layout_gravity="center"
+        android:src="@mipmap/icon_4_rhythm_1_normal"
+        android:id="@+id/iv_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:adjustViewBounds="true" />
+</FrameLayout>

+ 28 - 7
metronome/src/main/res/layout/pickerview_beat_symbol_layout.xml

@@ -1,11 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:background="@drawable/bg_white_top_10dp"
     android:orientation="vertical">
 
     <RelativeLayout
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:id="@+id/rl_top"
         android:layout_width="match_parent"
         android:layout_height="50dp">
 
@@ -24,7 +28,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_centerInParent="true"
-            android:text="调整拍数"
+            android:text="节拍"
             android:textColor="@color/color_1a1a1a"
             android:textSize="18dp" />
 
@@ -37,18 +41,35 @@
             android:layout_marginRight="17dp"
             android:padding="8dp"
             android:text="确定"
-            android:textColor="@color/colorPrimary"
+            android:textColor="@color/color_1cacf1"
             android:textSize="@dimen/dp_16" />
 
     </RelativeLayout>
 
-    <View style="@style/line_style" />
+    <View
+        android:layout_marginEnd="13dp"
+        android:layout_marginStart="13dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintBottom_toBottomOf="@+id/optionspicker"
+        app:layout_constraintTop_toTopOf="@+id/optionspicker"
+        android:background="@drawable/shape_f2f2f2_6dp"
+        android:layout_width="match_parent"
+        android:layout_height="44dp"/>
+
+    <View
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/rl_top"
+        android:id="@+id/view_line"
+        style="@style/line_style"
+        android:layout_marginEnd="13dp"
+        android:layout_marginStart="13dp"/>
     <!--此部分需要完整复制过去,删减或者更改ID会导致初始化找不到内容而报空-->
     <LinearLayout
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/view_line"
         android:id="@+id/optionspicker"
         android:layout_width="match_parent"
-        android:layout_height="@dimen/dp_200"
-        android:background="#ffffff"
+        android:layout_height="@dimen/dp_250"
         android:gravity="center"
         android:minHeight="150dp"
         android:orientation="horizontal">
@@ -73,4 +94,4 @@
     </LinearLayout>
 
 
-</LinearLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

BIN
metronome/src/main/res/mipmap-sw600dp-hdpi/icon_beat_value_bg.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_1_normal.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_1_select.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_2_normal.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_2_select.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_3_normal.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_3_select.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_4_normal.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_4_select.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_5_normal.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_5_select.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_6_normal.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_6_select.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_7_normal.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_4_rhythm_7_select.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_beat_value_bg.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_metronome_add_bt_bg.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_metronome_bt_bg.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_quarter_note_tag2.png


BIN
metronome/src/main/res/mipmap-xhdpi/icon_volume_trumpet_add.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_1_normal.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_1_select.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_2_normal.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_2_select.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_3_normal.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_3_select.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_4_normal.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_4_select.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_5_normal.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_5_select.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_6_normal.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_6_select.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_7_normal.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_4_rhythm_7_select.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_beat_value_bg.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_metronome_add_bt_bg.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_metronome_bt_bg.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_quarter_note_tag2.png


BIN
metronome/src/main/res/mipmap-xxhdpi/icon_volume_trumpet_add.png


+ 1 - 0
metronome/src/main/res/values/colors.xml

@@ -7,4 +7,5 @@
     <color name="color_009fff">#009FFF</color>
     <color name="color_0ba7ff">#0ba7ff</color>
     <color name="color_51dbff">#51DBFF</color>
+    <color name="color_1cacf1">#1cacf1</color>
 </resources>

+ 64 - 16
musictuner/src/main/java/com/cooleshow/musictuner/MusicTunerActivity.java

@@ -29,12 +29,15 @@ import com.cooleshow.base.constanst.LoginStatusConstants;
 import com.cooleshow.base.event.LoginStatusEvent;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseActivity;
+import com.cooleshow.base.utils.LOG;
 import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.SizeUtils;
 import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.utils.helper.PermissionTipHelper;
 import com.cooleshow.metronome.Utils.PlayBeanManager;
 import com.cooleshow.metronome.constants.MetronomeType;
+import com.cooleshow.metronome.constants.QuarterNoteRhythmType;
+import com.cooleshow.metronome.widget.MoreRhythmTypeDialog;
 import com.cooleshow.musictuner.bean.VoiceToneBean;
 import com.cooleshow.musictuner.constants.MusicTunerConstants;
 import com.cooleshow.musictuner.databinding.ActivityMusicTunerLayoutBinding;
@@ -61,7 +64,8 @@ public class MusicTunerActivity extends BaseActivity<ActivityMusicTunerLayoutBin
     private boolean isTransposing = false;
     private String currentTransposingTag = "";
     private OptionsPickerView pvOptions;
-    private int currentSelectPosition;
+    private int currentSelectPosition = -1;
+    private MoreRhythmTypeDialog mRhythmTypeDialog;
 
     public static void start(Context context) {
         Intent intent = new Intent(context, MusicTunerActivity.class);
@@ -104,9 +108,11 @@ public class MusicTunerActivity extends BaseActivity<ActivityMusicTunerLayoutBin
         viewBinding.toolbarInclude.tvRightText.setCompoundDrawablePadding(SizeUtils.dp2px(5));
         viewBinding.toolbarInclude.tvRightText.setVisibility(View.VISIBLE);
         viewBinding.toolbarInclude.tvRightText.setCompoundDrawablesWithIntrinsicBounds(null, null, getResources().getDrawable(R.drawable.icon_music_tuner_setting), null);
+        viewBinding.viewBeat.setOnClickListener(this);
+        viewBinding.viewRhythm.setOnClickListener(this);
         VoiceDataUtils.getInstance().resetHzStandard();
         updateCurrentHzStandardText();
-        Log.i("qwe","MusicTunerActivity onCreate"+this);
+        LOG.i("qwe", "MusicTunerActivity onCreate" + this);
         PlayBeanManager.getInstance().init(this);
     }
 
@@ -124,8 +130,10 @@ public class MusicTunerActivity extends BaseActivity<ActivityMusicTunerLayoutBin
     private void updateBeatInfo() {
         String currentSpeed = PlayBeanManager.getInstance().getCurrentSpeed();
         String currentBeatTypeName = PlayBeanManager.getInstance().getCurrentBeanType();
-        viewBinding.tvPlayBeatSpeed.setText(currentSpeed);
+        viewBinding.tvPlayBeatSpeed.setText(String.format("BPM=%s", currentSpeed));
         viewBinding.tvPlayBeatType.setText(currentBeatTypeName);
+        QuarterNoteRhythmType currentRhythmType = PlayBeanManager.getInstance().getCurrentRhythmType();
+        viewBinding.ivRhythm.setImageResource(currentRhythmType.getImgRes());
         updatePlayIcon();
     }
 
@@ -176,7 +184,7 @@ public class MusicTunerActivity extends BaseActivity<ActivityMusicTunerLayoutBin
             viewBinding.ivCorrect.setVisibility(isCorrect ? View.VISIBLE : View.GONE);
             viewBinding.progress.setProgress(getDiffProgress((int) differenceValue));
 
-            viewBinding.tvDifference.setTextColor(getResources().getColor(isCorrect ? com.cooleshow.base.R.color.white: com.cooleshow.base.R.color.color_333333));
+            viewBinding.tvDifference.setTextColor(getResources().getColor(isCorrect ? com.cooleshow.base.R.color.white : com.cooleshow.base.R.color.color_333333));
             viewBinding.tvDifference.setText(differenceValue != -100 ? String.format("%d¢", differenceValue) : "");
             viewBinding.viewDashBoard.setCorrect(isCorrect);
             viewBinding.viewDashBoard.setProgress((int) differenceValue);
@@ -281,11 +289,16 @@ public class MusicTunerActivity extends BaseActivity<ActivityMusicTunerLayoutBin
             return;
         }
 
-        if (id == R.id.iv_metronome_mode_bg) {
+        if (id == R.id.view_beat) {
             selectSymbols();
             return;
         }
 
+        if (id == R.id.view_rhythm) {
+            showRhythmDialog();
+            return;
+        }
+
         if (id == R.id.iv_metronome_speed_bg) {
             ARouter.getInstance().build(RouterPath.Other.METRONOME_PAGE)
                     .withBoolean("isUpdateMode", true)
@@ -294,6 +307,25 @@ public class MusicTunerActivity extends BaseActivity<ActivityMusicTunerLayoutBin
         }
     }
 
+    private void showRhythmDialog() {
+        if (mRhythmTypeDialog == null) {
+            mRhythmTypeDialog = new MoreRhythmTypeDialog(this);
+            mRhythmTypeDialog.setEventListener(new MoreRhythmTypeDialog.OnEventListener() {
+                @Override
+                public void onSelect(QuarterNoteRhythmType rhythmType) {
+                    PlayBeanManager.getInstance().pausePlay();
+                    PlayBeanManager.getInstance().setBeat(PlayBeanManager.getInstance().getCurrentBeatType(), rhythmType);
+                    updateBeatInfo();
+                    mRhythmTypeDialog.dismiss();
+                }
+            });
+        }
+        if (!mRhythmTypeDialog.isShowing()) {
+            mRhythmTypeDialog.show();
+        }
+        mRhythmTypeDialog.setSelect(PlayBeanManager.getInstance().getCurrentRhythmType());
+    }
+
     private void showTuningForkDialog() {
         if (mTuningForkDialog == null) {
             mTuningForkDialog = new MusicTuningForkDialog(this);
@@ -391,23 +423,28 @@ public class MusicTunerActivity extends BaseActivity<ActivityMusicTunerLayoutBin
 
     private void selectSymbols() {
         ArrayList<MetronomeType> allBeatTypeList = PlayBeanManager.getInstance().getAllBeatTypeList();
+        checkSelectDefault(allBeatTypeList);
         pvOptions = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
             this.currentSelectPosition = options1;
             MetronomeType metronomeType = allBeatTypeList.get(currentSelectPosition);
             PlayBeanManager.getInstance().pausePlay();
-            PlayBeanManager.getInstance().setBeat(metronomeType);
+            PlayBeanManager.getInstance().setBeat(metronomeType, QuarterNoteRhythmType.METRONOME_1_TYPE);
             updateBeatInfo();
         }).setTitleText("拍号").setTitleColor(Color.BLACK).setLayoutRes(com.cooleshow.metronome.R.layout.pickerview_beat_symbol_layout, v -> {
-            //自定义布局中的控件初始化及事件处理
-            final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.metronome.R.id.tv_finish);
-            TextView ivCancel = (TextView) v.findViewById(com.cooleshow.metronome.R.id.tv_cancel);
-            tvSubmit.setOnClickListener(v12 -> {
-                pvOptions.returnData();
-                pvOptions.dismiss();
-            });
-            ivCancel.setOnClickListener(v1 -> pvOptions.dismiss());
+                    //自定义布局中的控件初始化及事件处理
+                    final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.metronome.R.id.tv_finish);
+                    TextView ivCancel = (TextView) v.findViewById(com.cooleshow.metronome.R.id.tv_cancel);
+                    tvSubmit.setOnClickListener(v12 -> {
+                        pvOptions.returnData();
+                        pvOptions.dismiss();
+                    });
+                    ivCancel.setOnClickListener(v1 -> pvOptions.dismiss());
 
-        }).isDialog(false).build();
+                })
+                .setDividerColor(Color.TRANSPARENT)
+                .setBgColor(Color.TRANSPARENT)
+                .setLineSpacingMultiplier(2.7f)
+                .isDialog(false).isDialog(false).build();
         pvOptions.setPicker(allBeatTypeList);
         if (currentSelectPosition < allBeatTypeList.size()) {
             pvOptions.setSelectOptions(currentSelectPosition);
@@ -416,10 +453,21 @@ public class MusicTunerActivity extends BaseActivity<ActivityMusicTunerLayoutBin
 
     }
 
+    private void checkSelectDefault(ArrayList<MetronomeType> beatSymbolLists) {
+        MetronomeType currentBeatType = PlayBeanManager.getInstance().getCurrentBeatType();
+        for (int i = 0; i < beatSymbolLists.size(); i++) {
+            MetronomeType metronomeType = beatSymbolLists.get(i);
+            if (currentBeatType == metronomeType) {
+                currentSelectPosition = i;
+                return;
+            }
+        }
+    }
+
     @Override
     protected void onPause() {
         super.onPause();
-        if(isFinishing()){
+        if (isFinishing()) {
             //提前释放相关资源
             releaseBeatManager();
         }

BIN
musictuner/src/main/res/drawable-xhdpi/icon_quarter_note_tag3.png


BIN
musictuner/src/main/res/drawable-xxhdpi/icon_quarter_note_tag3.png


+ 68 - 17
musictuner/src/main/res/layout/activity_music_tuner_layout.xml

@@ -388,26 +388,26 @@
                 app:layout_constraintTop_toBottomOf="@+id/iv_left_bg" />
 
             <ImageView
+                android:visibility="gone"
                 android:id="@+id/iv_beat_speed_tag"
-                app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_speed_bg"
-                app:layout_constraintTop_toTopOf="@+id/iv_metronome_speed_bg"
-                app:layout_constraintLeft_toLeftOf="@+id/iv_metronome_speed_bg"
+                android:layout_width="16dp"
+                android:layout_height="26dp"
                 android:src="@drawable/icon_play_beat_speed_tag"
-                android:layout_width="wrap_content"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_speed_bg"
                 app:layout_constraintHorizontal_chainStyle="packed"
+                app:layout_constraintLeft_toLeftOf="@+id/iv_metronome_speed_bg"
                 app:layout_constraintRight_toLeftOf="@+id/tv_play_beat_speed"
-                android:layout_height="wrap_content"/>
+                app:layout_constraintTop_toTopOf="@+id/iv_metronome_speed_bg" />
 
             <TextView
-                android:layout_marginStart="12dp"
-                app:layout_constraintLeft_toRightOf="@+id/iv_beat_speed_tag"
+                app:layout_constraintLeft_toLeftOf="@+id/iv_metronome_speed_bg"
                 android:textColor="@color/color_333333"
                 app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_speed_bg"
                 app:layout_constraintTop_toTopOf="@+id/iv_metronome_speed_bg"
                 app:layout_constraintRight_toRightOf="@+id/iv_metronome_speed_bg"
                 android:id="@+id/tv_play_beat_speed"
                 android:includeFontPadding="false"
-                tools:text="90"
+                tools:text="BPM=90"
                 android:text="0"
                 android:textSize="@dimen/sp_19"
                 android:textStyle="bold"
@@ -438,24 +438,59 @@
 
 
             <TextView
-                android:layout_marginStart="12dp"
+                android:paddingEnd="4dp"
+                app:layout_constraintBottom_toBottomOf="@+id/tv_current_beat_tip"
+                app:layout_constraintTop_toTopOf="@+id/tv_current_beat_tip"
                 android:textColor="@color/color_333333"
-                app:layout_constraintRight_toRightOf="@+id/iv_metronome_mode_bg"
-                app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_mode_bg"
-                app:layout_constraintTop_toTopOf="@+id/iv_metronome_mode_bg"
-                app:layout_constraintLeft_toLeftOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintRight_toLeftOf="@+id/tv_current_beat_tip"
                 android:id="@+id/tv_play_beat_type"
                 android:includeFontPadding="false"
-                tools:text="4/4"
-                android:text="4/4"
-                android:drawableRight="@drawable/icon_triangle_arrow_blue"
-                android:textSize="@dimen/sp_19"
+                tools:text="4"
+                android:text="4"
+                android:textSize="@dimen/sp_18"
+                app:layout_constraintHorizontal_chainStyle="packed"
                 android:textStyle="bold"
                 android:linksClickable="false"
                 android:drawablePadding="15dp"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/>
 
+
+            <TextView
+                android:layout_marginEnd="11dp"
+                android:id="@+id/tv_current_beat_tip"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="3dp"
+                android:includeFontPadding="false"
+                android:text="拍"
+                android:textColor="@color/color_1a1a1a"
+                android:textSize="@dimen/sp_14"
+                android:textStyle="bold"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintRight_toLeftOf="@+id/view_line1"
+                app:layout_constraintTop_toTopOf="@+id/iv_metronome_mode_bg" />
+            
+            <View
+                android:id="@+id/view_line1"
+                android:background="@color/color_b3e2ff"
+                app:layout_constraintRight_toRightOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintLeft_toLeftOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintTop_toTopOf="@+id/iv_metronome_mode_bg"
+                android:layout_width="1dp"
+                android:layout_height="24dp"/>
+
+            <ImageView
+                android:id="@+id/iv_rhythm"
+                android:layout_marginStart="7dp"
+                app:layout_constraintLeft_toRightOf="@+id/view_line1"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintTop_toTopOf="@+id/iv_metronome_mode_bg"
+                android:src="@drawable/icon_quarter_note_tag3"
+                android:layout_width="35dp"
+                android:layout_height="37dp"/>
+            
             <ImageView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
@@ -464,7 +499,23 @@
                 app:layout_constraintRight_toRightOf="parent"
                 app:layout_constraintTop_toBottomOf="@+id/iv_metronome_speed_bg" />
 
+            <View
+                android:id="@+id/view_beat"
+                app:layout_constraintRight_toLeftOf="@+id/view_line1"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintTop_toTopOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintLeft_toLeftOf="@+id/iv_metronome_mode_bg"
+                android:layout_width="0dp"
+                android:layout_height="0dp"/>
 
+            <View
+                android:id="@+id/view_rhythm"
+                app:layout_constraintLeft_toRightOf="@+id/view_line1"
+                app:layout_constraintBottom_toBottomOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintTop_toTopOf="@+id/iv_metronome_mode_bg"
+                app:layout_constraintRight_toRightOf="@+id/iv_metronome_mode_bg"
+                android:layout_width="0dp"
+                android:layout_height="0dp"/>
         </androidx.constraintlayout.widget.ConstraintLayout>
     </ScrollView>
 </LinearLayout>

+ 1 - 0
musictuner/src/main/res/values/colors.xml

@@ -16,4 +16,5 @@
     <color name="color_0082ff">#0082FF</color>
     <color name="color_50c0ff">#50C0FF</color>
     <color name="color_7cd3ff">#7CD3FF</color>
+    <color name="color_b3e2ff">#b3e2ff</color>
 </resources>