fix: 修复bug
This commit is contained in:
@@ -12,9 +12,9 @@ import com.chwl.app.databinding.ItemRoomModeBinding
|
||||
import com.chwl.app.databinding.RoomTypeSwitchActivityBinding
|
||||
import com.chwl.app.home.helper.OpenRoomHelper
|
||||
import com.chwl.app.ui.utils.load
|
||||
import com.chwl.app.ui.utils.loadAvatar
|
||||
import com.chwl.app.ui.utils.loadFromUrl
|
||||
import com.chwl.app.ui.webview.CommonWebViewActivity
|
||||
import com.chwl.app.utils.NumberUtils
|
||||
import com.chwl.core.UriProvider
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.gift.bean.RoomLevelInfo
|
||||
@@ -134,14 +134,21 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
|
||||
binding.proExp.progress = proExp.toInt()
|
||||
|
||||
|
||||
binding.avatar.loadAvatar(mCurrentRoomInfo?.avatar)
|
||||
binding.nick.text = mCurrentRoomInfo?.nick
|
||||
binding.avatar.load(mCurrentRoomInfo?.avatar)
|
||||
binding.nick.text = mCurrentRoomInfo?.title
|
||||
binding.levelIcon.load(it.getCurrentLevelIcon())
|
||||
binding.roomValue.text = R.string.Room_Value_s.getString(it.roomVal)
|
||||
binding.roomValue.text = R.string.Room_Value_s.getString(it.roomVal.toInt().toString())
|
||||
binding.roomAdmin.text = R.string.Room_Admin_s.getString("${it.currentManagerNum}/${it.managerLimitNum}")
|
||||
binding.currentLevel.text = R.string.LV_s.getString(it.currentLevel)
|
||||
binding.nextLevel.text = R.string.LV_s.getString(it.nextLevel)
|
||||
binding.nextExp.text = R.string.Next_LV_EXP_s.getString(nexExp)
|
||||
binding.nextExp.text = R.string.Next_LV_EXP_s.getString(NumberUtils.format(nexExp))
|
||||
|
||||
if (it.nextLevel == 0) {
|
||||
binding.nextExp.setVis(false,true)
|
||||
binding.proExp.max = 1
|
||||
binding.proExp.progress = 1
|
||||
binding.nextLevel.text = R.string.LV_s.getString(it.currentLevel)
|
||||
}
|
||||
|
||||
|
||||
mCurrentMicSkins = it.usedMicSkinId
|
||||
|
@@ -0,0 +1,30 @@
|
||||
package com.chwl.app.avroom.dialog
|
||||
|
||||
import android.content.DialogInterface
|
||||
import android.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import com.chwl.app.base.BaseDialogFragment
|
||||
import com.chwl.app.databinding.DialogRoomMusicBinding
|
||||
|
||||
class RoomMusicDialog : BaseDialogFragment<DialogRoomMusicBinding>() {
|
||||
|
||||
|
||||
override var width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
override var height = WindowManager.LayoutParams.MATCH_PARENT
|
||||
override var dimAmount = 0f
|
||||
override var gravity = Gravity.BOTTOM
|
||||
|
||||
|
||||
override fun init() {
|
||||
binding.musicView.setCallBack {
|
||||
dismiss()
|
||||
}
|
||||
binding.musicView.showBoxInAnim();
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
binding.musicView.release()
|
||||
super.onDismiss(dialog)
|
||||
}
|
||||
|
||||
}
|
@@ -4,7 +4,6 @@ import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.chwl.app.BuildConfig
|
||||
import com.chwl.app.DemoActivity
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.application.IReportConstants
|
||||
import com.chwl.app.application.ReportManager
|
||||
@@ -17,6 +16,7 @@ import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||
import com.chwl.app.utils.HomeUIManager
|
||||
import com.chwl.core.DemoCache
|
||||
import com.chwl.core.auth.AuthModel
|
||||
|
||||
/**
|
||||
首页
|
||||
@@ -38,8 +38,14 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
when (v.id) {
|
||||
R.id.layout_title_bar->{
|
||||
if (BuildConfig.DEBUG) {
|
||||
//todo do 测试代码
|
||||
context?.let {
|
||||
DemoActivity.start(it)
|
||||
|
||||
|
||||
//自动登录
|
||||
AuthModel.get().autoLogin()
|
||||
.doOnError { throwable: Throwable? -> }
|
||||
.subscribe()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,10 +3,6 @@ package com.chwl.app.ui.widget
|
||||
import android.animation.ObjectAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.VibrationEffect
|
||||
import android.os.Vibrator
|
||||
import android.os.VibratorManager
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -42,14 +38,6 @@ class BonsellaJoinAttackButtonView @JvmOverloads constructor(
|
||||
mBinding.tvText.singleClick (listener,200)
|
||||
}
|
||||
|
||||
private val vibrator by lazy {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
(context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager).defaultVibrator
|
||||
} else {
|
||||
context.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
mBinding.ivBtn.isLongClickable = false
|
||||
mBinding.pvBg.setProgressChangeListener{
|
||||
@@ -70,13 +58,6 @@ class BonsellaJoinAttackButtonView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun onBtnDown(){
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
vibrator.vibrate(VibrationEffect.createOneShot(100L, VibrationEffect.DEFAULT_AMPLITUDE))
|
||||
}else{
|
||||
vibrator.vibrate(100)
|
||||
}
|
||||
} catch (_: Exception) { }
|
||||
|
||||
// mBinding.ivBtn.animate().cancel()
|
||||
// mBinding.ivBtn.animate()
|
||||
|
12
app/src/main/res/layout/dialog_room_music.xml
Normal file
12
app/src/main/res/layout/dialog_room_music.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.chwl.app.music.widget.MusicPlayerView
|
||||
android:id="@+id/musicView"
|
||||
android:layout_width="match_parent"
|
||||
android:elevation="10dp"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</FrameLayout>
|
@@ -43,15 +43,29 @@
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:background="@drawable/ic_room_level_top_bg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
<com.chwl.app.common.widget.RectRoundImageView
|
||||
android:id="@+id/avatarBg"
|
||||
android:layout_width="79dp"
|
||||
android:layout_height="79dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:src="@color/white"
|
||||
app:type="round"
|
||||
app:borderRadius="8dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="8dp" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.chwl.app.common.widget.RectRoundImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="@+id/avatarBg"
|
||||
android:layout_margin="1dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/avatarBg"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatarBg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatarBg"
|
||||
app:type="round"
|
||||
app:borderRadius="8dp" />
|
||||
|
||||
Ω<TextView
|
||||
android:id="@+id/nick"
|
||||
|
@@ -55,6 +55,7 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
private TextView musicName;
|
||||
private String imageBg;
|
||||
private View layoutMusicBgClick;
|
||||
private CallBack mCallBack;
|
||||
|
||||
public MusicPlayerView(Context context) {
|
||||
this(context, null);
|
||||
@@ -132,6 +133,9 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
public void onAnimationStart(Animator animation) {
|
||||
super.onAnimationStart(animation);
|
||||
layoutMusicBgClick.setVisibility(GONE);
|
||||
if (mCallBack != null) {
|
||||
mCallBack.onClose();
|
||||
}
|
||||
}
|
||||
});
|
||||
objectAnimator.start();
|
||||
@@ -154,7 +158,7 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
// objectAnimatorFlag.start();
|
||||
}
|
||||
|
||||
private void showBoxInAnim() {
|
||||
public void showBoxInAnim() {
|
||||
// if (musicFlagLayout == null) {
|
||||
// return;
|
||||
// }
|
||||
@@ -323,7 +327,9 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
public void linkIconView(View iconView, View stateView) {
|
||||
this.musicFlagLayout = iconView;
|
||||
this.musicFlag = stateView;
|
||||
this.musicFlagLayout.setOnClickListener(view -> showBoxInAnim());
|
||||
this.musicFlagLayout.setOnClickListener(view -> {
|
||||
showBoxInAnim();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -336,4 +342,12 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
this.musicFlag.setVisibility(visibility);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCallBack(CallBack mCallBack) {
|
||||
this.mCallBack = mCallBack;
|
||||
}
|
||||
|
||||
public interface CallBack{
|
||||
void onClose();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user