同步hiyoo:调整房间小时榜、音乐、房间榜入口位置
This commit is contained in:
@@ -287,7 +287,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
// 刷新禮物列表,獲取房間專屬禮物列表
|
||||
GiftModel.get().refreshGiftList(AvRoomDataManager.get().roomUid.toString()).subscribe()
|
||||
checkFollowOwner()
|
||||
mvpPresenter?.loadRoomRank()
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
|
||||
//先隐藏航海冒险
|
||||
@@ -555,6 +554,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
if (isOnMic) {
|
||||
if (musicPlayerView == null) {
|
||||
musicPlayerView = mVsMusicPlayer?.inflate() as? MusicPlayerView
|
||||
musicPlayerView?.let {
|
||||
onInitMusicPlayerView(it)
|
||||
}
|
||||
}
|
||||
musicPlayerView?.visibility = View.VISIBLE
|
||||
} else {
|
||||
@@ -677,11 +679,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
sendMsg()
|
||||
}
|
||||
|
||||
R.id.contribute_list -> {
|
||||
DialogWebViewActivity.start(mContext, UriProvider.getRoomRanking())
|
||||
mvpPresenter?.loadRoomRank()
|
||||
}
|
||||
|
||||
R.id.iv_first_charge_enter -> FirstChargeDialog.start(mContext)
|
||||
R.id.iv_treasure_box,
|
||||
R.id.iv_treasure_box_cp -> GoldBoxHelper.handleBoxClick(mContext)
|
||||
@@ -1159,18 +1156,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun updateRoomRanks(data: List<RoomContributeUserInfo>) {
|
||||
// val avatarList = arrayListOf<ImageView?>(
|
||||
// mView.findViewById(R.id.iv_rank_0),
|
||||
// mView.findViewById(R.id.iv_rank_1),
|
||||
// mView.findViewById(R.id.iv_rank_2)
|
||||
// )
|
||||
//
|
||||
// for (i in 0 until avatarList.size) {
|
||||
// avatarList[i]?.loadAvatar(data.getOrNull(i)?.avatar)
|
||||
// }
|
||||
}
|
||||
|
||||
private fun onSendGiftBtnClick(giftId: Int = 0) {
|
||||
if (giftDialog == null) {
|
||||
GiftDialog.GIFT_DIALOG_FROM = getString(R.string.room)
|
||||
@@ -1367,4 +1352,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
protected open fun onEnterRoom(){
|
||||
|
||||
}
|
||||
|
||||
protected open fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
|
||||
}
|
||||
}
|
@@ -14,6 +14,7 @@ import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.yizhuan.erban.avroom.game.GameDelegate
|
||||
import com.yizhuan.erban.avroom.game.OnGameStatusChangeListener
|
||||
import com.yizhuan.erban.avroom.presenter.GameRoomPresenter
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
import com.yizhuan.erban.avroom.view.IGameRoomView
|
||||
import com.yizhuan.erban.databinding.FragmentGameRoomBinding
|
||||
@@ -68,9 +69,9 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.mgId
|
||||
)
|
||||
gameDelegate.setOnGameStatusChangeListener(this)
|
||||
gameBinding.rankWidget.setContentBackgroundResource(R.drawable.room_rank_widget_bg_game)
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
gameBinding.microView.bindAdapter(GameMicroViewAdapter(context))
|
||||
@@ -197,5 +198,6 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
registerWidget(RedPackageWidget::class.java.simpleName, gameBinding.redPackageWidget)
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
}
|
||||
}
|
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
@@ -26,6 +27,7 @@ import com.yizhuan.erban.avroom.dialog.PKScoreBoardDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyPresenter;
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
import com.yizhuan.erban.avroom.widget.PKBoardView;
|
||||
@@ -36,6 +38,7 @@ import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.ui.webview.DatingRuleWebViewActivity;
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -138,6 +141,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
public void initWidget() {
|
||||
super.initWidget();
|
||||
registerWidget(RedPackageWidget.class.getSimpleName(), gameBinding.redPackageWidget);
|
||||
registerWidget(RoomRankWidget.class.getSimpleName(), gameBinding.rankWidget);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -603,7 +607,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
getMvpPresenter().cancelDragon();
|
||||
});
|
||||
break;
|
||||
case R.id.tv_hour_rank:
|
||||
case R.id.layout_hour_rank:
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getRoomHourRankUrl(AvRoomDataManager.get().getRoomUid())
|
||||
@@ -787,7 +791,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
|
||||
private void hideKtvRelaView() {
|
||||
gameBinding.setKtvModel(false);
|
||||
gameBinding.contributeList.setVisibility(View.VISIBLE);
|
||||
changeModelShowView();
|
||||
gameBinding.bottomView.showKtvBottom(false);
|
||||
}
|
||||
@@ -799,9 +802,9 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo.getIsPermitRoom() == 1) {
|
||||
gameBinding.tvHourRank.setVisibility(View.VISIBLE);
|
||||
gameBinding.layoutHourRank.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
gameBinding.tvHourRank.setVisibility(View.GONE);
|
||||
gameBinding.layoutHourRank.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
@@ -1070,4 +1073,10 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitMusicPlayerView(@NonNull MusicPlayerView view) {
|
||||
super.onInitMusicPlayerView(view);
|
||||
view.linkIconView(gameBinding.ivMusic, gameBinding.ivMusic);
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ import com.yizhuan.erban.avroom.adapter.SingleRoomPKMicroViewAdapter
|
||||
import com.yizhuan.erban.avroom.dialog.RequestUpMicDialog
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog
|
||||
import com.yizhuan.erban.avroom.presenter.SingleRoomPresenter
|
||||
import com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageWidget
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPkFinishDialog
|
||||
import com.yizhuan.erban.avroom.singleroompk.SingleRoomPkForceFinishDialog
|
||||
@@ -29,6 +30,7 @@ import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.fansteam.FansTeamInitInfo
|
||||
@@ -109,7 +111,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
}
|
||||
|
||||
gameBinding.tvHourRank.setOnClickListener {
|
||||
gameBinding.layoutHourRank.setOnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getSingleRoomHourRankUrl(AvRoomDataManager.get().roomUid)
|
||||
@@ -273,5 +275,11 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
registerWidget(RedPackageWidget::class.java.simpleName, gameBinding.redPackageWidget)
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
}
|
||||
|
||||
override fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
super.onInitMusicPlayerView(view)
|
||||
view.linkIconView(gameBinding.ivMusic, gameBinding.ivMusic)
|
||||
}
|
||||
}
|
@@ -525,20 +525,6 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void loadRoomRank() {
|
||||
String type = AvRoomDataManager.get().isSingleRoom() ? RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING : RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING;
|
||||
RoomContributeListModel.get().getSingleRoomRanking(1, type)
|
||||
.compose(bindToLifecycle())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.subscribe(roomContributeDataInfo -> {
|
||||
if (getMvpView() == null) {
|
||||
return;
|
||||
}
|
||||
getMvpView().updateRoomRanks(roomContributeDataInfo.getRankings());
|
||||
});
|
||||
}
|
||||
|
||||
/***
|
||||
* 發送房間消息
|
||||
* @param message
|
||||
|
@@ -0,0 +1,94 @@
|
||||
package com.yizhuan.erban.avroom.rank
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.chuhai.utils.ktx.singleClick
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.RoomRankWidgetBinding
|
||||
import com.yizhuan.erban.ui.utils.loadAvatar
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.xchat_android_core.support.room.FrameLayoutRoomWidget
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomView
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomWidget
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeDataInfo
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomContributeUserInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.RoomContributeListModel
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
|
||||
/**
|
||||
* 房间榜单入口
|
||||
*/
|
||||
class RoomRankWidget : FrameLayoutRoomWidget, RoomWidget {
|
||||
|
||||
private val binding: RoomRankWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_rank_widget, this, true
|
||||
)
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
this.singleClick {
|
||||
DialogWebViewActivity.start(context, UriProvider.getRoomRanking())
|
||||
refreshData()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onInitialize(roomView: RoomView, roomContext: RoomContext) {
|
||||
super.onInitialize(roomView, roomContext)
|
||||
refreshData()
|
||||
}
|
||||
|
||||
override fun onUnbindContext() {
|
||||
super.onUnbindContext()
|
||||
updateView(null)
|
||||
}
|
||||
|
||||
private fun refreshData() {
|
||||
val disposable = RoomContributeListModel.get()
|
||||
.getSingleRoomRanking(1, RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.subscribe { roomContributeDataInfo: RoomContributeDataInfo ->
|
||||
updateView(roomContributeDataInfo.rankings)
|
||||
}
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun updateView(list: List<RoomContributeUserInfo>?) {
|
||||
arrayListOf(
|
||||
binding.ivRank0, binding.ivRank1, binding.ivRank2
|
||||
).forEachIndexed { index, imageView ->
|
||||
val url = list?.getOrNull(index)?.avatar
|
||||
if (url.isNullOrEmpty()) {
|
||||
imageView.isVisible = false
|
||||
} else {
|
||||
imageView.loadAvatar(url)
|
||||
imageView.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setContentBackgroundResource(resId: Int) {
|
||||
binding.layoutRoot.setBackgroundResource(resId)
|
||||
}
|
||||
}
|
@@ -56,8 +56,6 @@ class RedPackageWidget : FrameLayoutRoomWidget, RoomWidget {
|
||||
), R.layout.red_package_widget, this, true
|
||||
)
|
||||
|
||||
private var compositeDisposable: CompositeDisposable? = null
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
@@ -218,26 +216,14 @@ class RedPackageWidget : FrameLayoutRoomWidget, RoomWidget {
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun getCompositeDisposable(): CompositeDisposable {
|
||||
var disposable = compositeDisposable
|
||||
if (disposable == null) {
|
||||
disposable = CompositeDisposable()
|
||||
compositeDisposable = disposable
|
||||
}
|
||||
return disposable
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
this.dialogManager?.dismissDialog()
|
||||
this.dialogManager = null
|
||||
this.roomView = null
|
||||
}
|
||||
|
||||
override fun onUnbindContext() {
|
||||
super.onUnbindContext()
|
||||
compositeDisposable?.dispose()
|
||||
compositeDisposable = null
|
||||
loadData(null)
|
||||
}
|
||||
|
||||
|
@@ -71,6 +71,4 @@ interface IBaseRoomView : IMvpBaseView {
|
||||
|
||||
fun updateMicView()
|
||||
|
||||
fun updateRoomRanks(data: List<RoomContributeUserInfo>)
|
||||
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/room_ic_hour_rank.webp
Normal file
BIN
app/src/main/res/drawable-xxhdpi/room_ic_hour_rank.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/room_ic_music.webp
Normal file
BIN
app/src/main/res/drawable-xxhdpi/room_ic_music.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
9
app/src/main/res/drawable/base_arrow_right_f1f1fa.xml
Normal file
9
app/src/main/res/drawable/base_arrow_right_f1f1fa.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="9dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="9">
|
||||
<path
|
||||
android:pathData="M2.5158,7.0939L6.5158,3.7124L7,4.2851L6.524,4.8647L2.524,1.5796L3.476,0.4204L7.476,3.7055Q7.5287,3.7488 7.5728,3.8009Q7.6205,3.8573 7.6562,3.922Q7.692,3.9866 7.7144,4.057Q7.7369,4.1273 7.7452,4.2007Q7.7536,4.2741 7.7474,4.3477Q7.7412,4.4213 7.7208,4.4923Q7.7004,4.5633 7.6665,4.629Q7.6327,4.6946 7.5866,4.7524Q7.5406,4.8102 7.4842,4.8579L3.4842,8.2394L2.5158,7.0939ZM3.75,7.6667Q3.75,7.7405 3.7356,7.813Q3.7212,7.8854 3.6929,7.9537Q3.6646,8.0219 3.6236,8.0833Q3.5826,8.1448 3.5303,8.197Q3.4781,8.2492 3.4167,8.2903Q3.3553,8.3313 3.287,8.3596Q3.2188,8.3878 3.1463,8.4023Q3.0739,8.4167 3,8.4167Q2.9261,8.4167 2.8537,8.4023Q2.7812,8.3878 2.713,8.3596Q2.6447,8.3313 2.5833,8.2903Q2.5219,8.2492 2.4697,8.197Q2.4174,8.1448 2.3764,8.0833Q2.3354,8.0219 2.3071,7.9537Q2.2788,7.8854 2.2644,7.813Q2.25,7.7405 2.25,7.6667Q2.25,7.5928 2.2644,7.5203Q2.2788,7.4479 2.3071,7.3797Q2.3354,7.3114 2.3764,7.25Q2.4174,7.1886 2.4697,7.1363Q2.5219,7.0841 2.5833,7.0431Q2.6447,7.002 2.713,6.9738Q2.7812,6.9455 2.8537,6.9311Q2.9261,6.9167 3,6.9167Q3.0739,6.9167 3.1463,6.9311Q3.2188,6.9455 3.287,6.9738Q3.3553,7.002 3.4167,7.0431Q3.4781,7.0841 3.5303,7.1363Q3.5826,7.1886 3.6236,7.25Q3.6646,7.3114 3.6929,7.3797Q3.7212,7.4479 3.7356,7.5203Q3.75,7.5928 3.75,7.6667ZM3.75,1Q3.75,1.0739 3.7356,1.1463Q3.7212,1.2188 3.6929,1.287Q3.6646,1.3553 3.6236,1.4167Q3.5826,1.4781 3.5303,1.5303Q3.4781,1.5826 3.4167,1.6236Q3.3553,1.6646 3.287,1.6929Q3.2188,1.7212 3.1463,1.7356Q3.0739,1.75 3,1.75Q2.9261,1.75 2.8537,1.7356Q2.7812,1.7212 2.713,1.6929Q2.6447,1.6646 2.5833,1.6236Q2.5219,1.5826 2.4697,1.5303Q2.4174,1.4781 2.3764,1.4167Q2.3354,1.3553 2.3071,1.287Q2.2788,1.2188 2.2644,1.1463Q2.25,1.0739 2.25,1Q2.25,0.9261 2.2644,0.8537Q2.2788,0.7812 2.3071,0.713Q2.3354,0.6447 2.3764,0.5833Q2.4174,0.5219 2.4697,0.4697Q2.5219,0.4174 2.5833,0.3764Q2.6447,0.3354 2.713,0.3071Q2.7812,0.2788 2.8537,0.2644Q2.9261,0.25 3,0.25Q3.0739,0.25 3.1463,0.2644Q3.2188,0.2788 3.287,0.3071Q3.3553,0.3354 3.4167,0.3764Q3.4781,0.4174 3.5303,0.4697Q3.5826,0.5219 3.6236,0.5833Q3.6646,0.6447 3.6929,0.713Q3.7212,0.7812 3.7356,0.8537Q3.75,0.9261 3.75,1Z"
|
||||
android:fillColor="#F1F1FA"/>
|
||||
</vector>
|
10
app/src/main/res/drawable/room_bg_hour_rank.xml
Normal file
10
app/src/main/res/drawable/room_bg_hour_rank.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#33170ACD"
|
||||
android:startColor="#8C2B00CA" />
|
||||
<corners android:radius="11dp" />
|
||||
</shape>
|
10
app/src/main/res/drawable/room_rank_widget_bg.xml
Normal file
10
app/src/main/res/drawable/room_rank_widget_bg.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#19ffffff" />
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_12"
|
||||
android:bottomRightRadius="0dp"
|
||||
android:topLeftRadius="@dimen/dp_12"
|
||||
android:topRightRadius="0dp" />
|
||||
</shape>
|
10
app/src/main/res/drawable/room_rank_widget_bg_game.xml
Normal file
10
app/src/main/res/drawable/room_rank_widget_bg_game.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#19ffffff" />
|
||||
<corners
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="@dimen/dp_12"
|
||||
android:topLeftRadius="0dp"
|
||||
android:topRightRadius="@dimen/dp_12" />
|
||||
</shape>
|
56
app/src/main/res/layout/room_rank_widget.xml
Normal file
56
app/src/main/res/layout/room_rank_widget.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/layout_root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:background="@drawable/room_rank_widget_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="@dimen/dp_4"
|
||||
tools:background="@color/black">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_0"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/default_avatar"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_1"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="-12dp"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/default_avatar"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_2"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="-12dp"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/default_avatar"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:includeFontPadding="false"
|
||||
android:text="房间榜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_9"
|
||||
android:layout_height="@dimen/dp_9"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/base_arrow_right_f1f1fa" />
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
@@ -24,14 +24,13 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginTop="@dimen/dp_85"
|
||||
android:clipChildren="false">
|
||||
|
||||
<com.yizhuan.erban.avroom.widget.MicroView
|
||||
android:id="@+id/micro_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp" />
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_room_pk_order"
|
||||
@@ -64,43 +63,58 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contribute_list"
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_left_top_menu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignTop="@id/micro_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:background="@drawable/bg_single_room_rank_entrance"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_4"
|
||||
android:text="@string/room_contribute_list"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:visibility="visible"
|
||||
app:drawableStartCompat="@drawable/ic_sing_room_contribute_list" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hour_rank"
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_hour_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/room_bg_hour_rank"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="@dimen/dp_6"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_ic_hour_rank" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:gravity="center_vertical"
|
||||
android:text="小时榜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_music"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:src="@drawable/room_ic_music"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
android:id="@+id/rank_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_below="@+id/contribute_list"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="@drawable/bg_single_room_rank_entrance"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_4"
|
||||
android:text="@string/room_list_hour"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:visibility="visible"
|
||||
app:drawableStartCompat="@drawable/ic_single_room_rank" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/layout_left_top_menu"
|
||||
android:layout_alignParentEnd="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_dating_step"
|
||||
@@ -356,7 +370,7 @@
|
||||
<com.yizhuan.erban.avroom.anotherroompk.RoomPKBoardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/contribute_list"
|
||||
android:layout_below="@id/layout_left_top_menu"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="80dp"
|
||||
android:visibility="@{(roomInfo.roomModeType==7) ? View.VISIBLE : View.GONE}" />
|
||||
@@ -407,7 +421,7 @@
|
||||
android:id="@+id/vs_music_player"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/tv_hour_rank"
|
||||
android:layout_below="@id/layout_left_top_menu"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout="@layout/avroom_music_player_layout" />
|
||||
|
||||
|
@@ -30,50 +30,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/contribute_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="22dp"
|
||||
<com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
android:id="@+id/rank_widget"
|
||||
android:layout_marginTop="80dp"
|
||||
android:background="@drawable/bg_contribute_entrance"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_0"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_1"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_2"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/layout_fragment_game_room_01"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_right_white" />
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@@ -41,13 +41,63 @@
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="view_pk_board,micro_view" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_hour_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_95"
|
||||
android:background="@drawable/room_bg_hour_rank"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="@dimen/dp_6"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_ic_hour_rank" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:gravity="center_vertical"
|
||||
android:text="小时榜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_music"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:src="@drawable/room_ic_music"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_hour_rank"
|
||||
app:layout_constraintStart_toEndOf="@id/layout_hour_rank"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_hour_rank"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.yizhuan.erban.avroom.rank.RoomRankWidget
|
||||
android:id="@+id/rank_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_hour_rank"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_hour_rank" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_fans_team"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/contribute_list">
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_hour_rank"
|
||||
tools:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/fl_fans_team_join_tip"
|
||||
@@ -70,12 +120,12 @@
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ImageView
|
||||
android:layout_marginStart="6dp"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/fans_team_ic_room_entrance" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -98,41 +148,6 @@
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contribute_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="85dp"
|
||||
android:background="@drawable/bg_single_room_rank_entrance"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_4"
|
||||
android:text="@string/room_host_list"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:drawableStartCompat="@drawable/ic_sing_room_contribute_list"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hour_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:background="@drawable/bg_single_room_rank_entrance"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_4"
|
||||
android:text="@string/room_list_hour"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:drawableStartCompat="@drawable/ic_single_room_rank"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/contribute_list" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/vs_music_player"
|
||||
android:layout_width="0dp"
|
||||
@@ -142,7 +157,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_hour_rank" />
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_music" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speedy_message"
|
||||
@@ -170,7 +185,6 @@
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/ic_speedymsg_close" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.yizhuan.erban.avroom.widget.BottomView
|
||||
@@ -203,10 +217,10 @@
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintBottom_toTopOf="@id/red_package_widget"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:contentDescription="@string/layout_fragment_single_room_06" />
|
||||
tools:contentDescription="@string/layout_fragment_single_room_06"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
@@ -228,10 +242,10 @@
|
||||
android:layout_height="58dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_treasure_box"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_treasure_box"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_treasure_box" />
|
||||
app:layout_constraintStart_toStartOf="@id/iv_treasure_box"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.yizhuan.erban.avroom.widget.MessageView
|
||||
android:id="@+id/message_view"
|
||||
|
@@ -45,9 +45,9 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
public class MusicPlayerView extends FrameLayout implements View.OnClickListener, SeekBar.OnSeekBarChangeListener {
|
||||
private LinearLayout musicFlagLayout;
|
||||
private View musicFlagLayout;
|
||||
private RelativeLayout musicBoxLayout;
|
||||
private ImageView musicFlag;
|
||||
private View musicFlag;
|
||||
private ImageView musicListMore;
|
||||
private ImageView musicPlayPause;
|
||||
private ImageView nextBtn;
|
||||
@@ -73,9 +73,6 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
private void init() {
|
||||
EventBus.getDefault().register(this);
|
||||
LayoutInflater.from(getContext()).inflate(R.layout.layout_music_player_view, this, true);
|
||||
musicFlagLayout = findViewById(R.id.music_flag_layout);
|
||||
musicFlagLayout.setOnClickListener(this);
|
||||
musicFlag = findViewById(R.id.music_flag);
|
||||
musicBoxLayout = findViewById(R.id.music_box_layout);
|
||||
musicBoxLayout.setOnClickListener(this);
|
||||
musicListMore = findViewById(R.id.music_list_more);
|
||||
@@ -109,6 +106,9 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
}
|
||||
|
||||
private void playFlagRotateAnim() {
|
||||
if (musicFlag == null) {
|
||||
return;
|
||||
}
|
||||
Animation operatingAnim = AnimationUtils.loadAnimation(getContext(), R.anim.rotate_quick_anim);
|
||||
LinearInterpolator lin = new LinearInterpolator();
|
||||
operatingAnim.setInterpolator(lin);
|
||||
@@ -116,41 +116,57 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
}
|
||||
|
||||
private void stopFlagRotateAnim() {
|
||||
if (musicFlag == null) {
|
||||
return;
|
||||
}
|
||||
musicFlag.clearAnimation();
|
||||
}
|
||||
|
||||
private void showFlagInAnim() {
|
||||
// if (musicFlagLayout == null) {
|
||||
// return;
|
||||
// }
|
||||
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(musicBoxLayout, "translationX", 0, -UIUtil.dip2px(getContext(), 317)).setDuration(150);
|
||||
objectAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
objectAnimator.start();
|
||||
|
||||
ObjectAnimator objectAnimatorFlag = ObjectAnimator.ofFloat(
|
||||
musicFlagLayout,
|
||||
"translationX",
|
||||
UIUtil.dip2px(getContext(), 76),
|
||||
0)
|
||||
.setDuration(150);
|
||||
objectAnimatorFlag.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
objectAnimatorFlag.setStartDelay(150);
|
||||
objectAnimatorFlag.addListener(new AnimatorListenerAdapter() {
|
||||
objectAnimator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
super.onAnimationStart(animation);
|
||||
layoutMusicBgClick.setVisibility(GONE);
|
||||
}
|
||||
});
|
||||
objectAnimatorFlag.start();
|
||||
objectAnimator.start();
|
||||
|
||||
// ObjectAnimator objectAnimatorFlag = ObjectAnimator.ofFloat(
|
||||
// musicFlagLayout,
|
||||
// "translationX",
|
||||
// UIUtil.dip2px(getContext(), 76),
|
||||
// 0)
|
||||
// .setDuration(150);
|
||||
// objectAnimatorFlag.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
// objectAnimatorFlag.setStartDelay(150);
|
||||
// objectAnimatorFlag.addListener(new AnimatorListenerAdapter() {
|
||||
// @Override
|
||||
// public void onAnimationStart(Animator animation) {
|
||||
// super.onAnimationStart(animation);
|
||||
// layoutMusicBgClick.setVisibility(GONE);
|
||||
// }
|
||||
// });
|
||||
// objectAnimatorFlag.start();
|
||||
}
|
||||
|
||||
private void showBoxInAnim() {
|
||||
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(
|
||||
musicFlagLayout,
|
||||
"translationX",
|
||||
0,
|
||||
UIUtil.dip2px(getContext(), 76))
|
||||
.setDuration(150);
|
||||
objectAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
objectAnimator.start();
|
||||
// if (musicFlagLayout == null) {
|
||||
// return;
|
||||
// }
|
||||
// ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(
|
||||
// musicFlagLayout,
|
||||
// "translationX",
|
||||
// 0,
|
||||
// UIUtil.dip2px(getContext(), 76))
|
||||
// .setDuration(150);
|
||||
// objectAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
// objectAnimator.start();
|
||||
|
||||
|
||||
ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(musicBoxLayout, "translationX", -UIUtil.dip2px(getContext(), 317), 0).setDuration(150);
|
||||
@@ -179,9 +195,6 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.music_flag_layout:
|
||||
showBoxInAnim();
|
||||
break;
|
||||
case R.id.layout_music_bg_click:
|
||||
showFlagInAnim();
|
||||
break;
|
||||
@@ -295,4 +308,27 @@ public class MusicPlayerView extends FrameLayout implements View.OnClickListener
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联入口View
|
||||
* @param iconView 入口View
|
||||
* @param stateView 播放状态View
|
||||
*
|
||||
*/
|
||||
public void linkIconView(View iconView, View stateView) {
|
||||
this.musicFlagLayout = iconView;
|
||||
this.musicFlag = stateView;
|
||||
this.musicFlagLayout.setOnClickListener(view -> showBoxInAnim());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisibility(int visibility) {
|
||||
super.setVisibility(visibility);
|
||||
if (musicFlagLayout != null) {
|
||||
this.musicFlagLayout.setVisibility(visibility);
|
||||
}
|
||||
if (musicFlag != null) {
|
||||
this.musicFlag.setVisibility(visibility);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB |
@@ -4,34 +4,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/music_flag_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_single_room_rank_entrance"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/music_flag"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:src="@drawable/icon_music_flag" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:lines="1"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:text="@string/room_play_music"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_music_bg_click"
|
||||
android:layout_width="match_parent"
|
||||
|
Reference in New Issue
Block a user