fix:修复房间音乐音量无法调节bug
This commit is contained in:
@@ -1,20 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="91dp">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1px"
|
android:layout_height="@dimen/dp_1"
|
||||||
android:background="@color/color_F5F5F5"/>
|
android:background="@color/color_F5F5F5" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="90dp"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center" >
|
android:paddingVertical="@dimen/dp_20">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -22,32 +23,32 @@
|
|||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="12dp"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/layout_dialog_voice_seek_01"
|
android:text="@string/layout_dialog_voice_seek_01"
|
||||||
android:textSize="13sp"
|
android:textColor="@color/color_999999"
|
||||||
android:textColor="@color/color_999999" />
|
android:textSize="13sp" />
|
||||||
|
|
||||||
<SeekBar
|
<SeekBar
|
||||||
android:id="@+id/voice_seek"
|
android:id="@+id/voice_seek"
|
||||||
|
style="@style/seekbarAppearance"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:minHeight="2dp"
|
|
||||||
android:maxHeight="2dp"
|
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
style="@style/seekbarAppearance"/>
|
android:layout_weight="1.0"
|
||||||
|
android:maxHeight="2dp"
|
||||||
|
android:minHeight="2dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/voice_number"
|
android:id="@+id/voice_number"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="50%"
|
android:text="50%"
|
||||||
android:textSize="12sp"
|
android:textColor="@color/color_999999"
|
||||||
android:textColor="@color/color_999999" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -55,34 +56,34 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginEnd="20dp"
|
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:orientation="horizontal" >
|
android:layout_marginEnd="20dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/layout_dialog_voice_seek_02"
|
android:text="@string/layout_dialog_voice_seek_02"
|
||||||
android:textSize="13sp"
|
android:textColor="@color/color_999999"
|
||||||
android:textColor="@color/color_999999" />
|
android:textSize="13sp" />
|
||||||
|
|
||||||
<SeekBar
|
<SeekBar
|
||||||
android:id="@+id/music_voice_seek"
|
android:id="@+id/music_voice_seek"
|
||||||
|
style="@style/seekbarAppearance"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:minHeight="2dp"
|
|
||||||
android:maxHeight="2dp"
|
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
style="@style/seekbarAppearance"/>
|
android:layout_weight="1.0"
|
||||||
|
android:maxHeight="2dp"
|
||||||
|
android:minHeight="2dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/music_voice_number"
|
android:id="@+id/music_voice_number"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="100%"
|
android:text="100%"
|
||||||
android:textSize="12sp"
|
android:textColor="@color/color_999999"
|
||||||
android:textColor="@color/color_999999" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -2,17 +2,15 @@ package com.chwl.app.music.widget;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.Gravity;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.FrameLayout;
|
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
import com.chwl.app.ui.widget.dialog.BaseDialog;
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
|
||||||
import com.chwl.app.R;
|
import com.chwl.app.R;
|
||||||
import com.chwl.library.common.util.Utils;
|
|
||||||
import com.chwl.core.music.model.PlayerModel;
|
import com.chwl.core.music.model.PlayerModel;
|
||||||
|
|
||||||
|
|
||||||
@@ -20,7 +18,7 @@ import com.chwl.core.music.model.PlayerModel;
|
|||||||
* Created by chenran on 2017/12/18.
|
* Created by chenran on 2017/12/18.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class VoiceSeekDialog extends BottomSheetDialog implements SeekBar.OnSeekBarChangeListener{
|
public class VoiceSeekDialog extends BaseDialog implements SeekBar.OnSeekBarChangeListener{
|
||||||
private Context context;
|
private Context context;
|
||||||
private SeekBar musicVoiceSeek;
|
private SeekBar musicVoiceSeek;
|
||||||
private SeekBar voiceSeek;
|
private SeekBar voiceSeek;
|
||||||
@@ -54,15 +52,9 @@ public class VoiceSeekDialog extends BottomSheetDialog implements SeekBar.OnSeek
|
|||||||
musicVoiceNum.setText(PlayerModel.get().getCurrentVolume()+"%");
|
musicVoiceNum.setText(PlayerModel.get().getCurrentVolume()+"%");
|
||||||
voiceNum.setText(PlayerModel.get().getCurrentRecordingVolume()+"%");
|
voiceNum.setText(PlayerModel.get().getCurrentRecordingVolume()+"%");
|
||||||
|
|
||||||
FrameLayout bottomSheet = findViewById(R.id.design_bottom_sheet);
|
|
||||||
if (bottomSheet != null) {
|
|
||||||
BottomSheetBehavior.from(bottomSheet).setSkipCollapsed(false);
|
|
||||||
BottomSheetBehavior.from(bottomSheet).setPeekHeight(
|
|
||||||
(int) context.getResources().getDimension(R.dimen.dialog_gift_height) +
|
|
||||||
(Utils.hasSoftKeys(context) ? Utils.getNavigationBarHeight(context) : 0));
|
|
||||||
}
|
|
||||||
WindowManager.LayoutParams params = getWindow().getAttributes();
|
WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
|
params.gravity = Gravity.BOTTOM;
|
||||||
getWindow().setAttributes(params);
|
getWindow().setAttributes(params);
|
||||||
|
|
||||||
getWindow().setDimAmount(0F); // 弹框背景全透明
|
getWindow().setDimAmount(0F); // 弹框背景全透明
|
||||||
|
Reference in New Issue
Block a user