移除KTV相关代码
This commit is contained in:
@@ -852,23 +852,6 @@
|
||||
<activity
|
||||
android:name=".avroom.activity.RoomOnlineUserActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".avroom.ktv.KtvSelectSongActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden" />
|
||||
<activity
|
||||
android:name=".avroom.ktv.KtvRoomListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".avroom.ktv.KtvSearchSongActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize|stateHidden" />
|
||||
<activity
|
||||
android:name=".avroom.ktv.KtvSongListActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name=".public_chat_hall.activity.PublicChatHallRelatedToMeActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
@@ -48,7 +48,6 @@ import com.tongdaxing.erban.upgrade.AppUpgradeHelper;
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
import com.mango.moshen.application.ActivityStackManager;
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.avroom.ktv.KtvMusicManager;
|
||||
import com.mango.moshen.avroom.newuserchargegift.NewUserChargeGiftDialog;
|
||||
import com.mango.moshen.base.BaseMvpActivity;
|
||||
import com.mango.moshen.common.widget.CircleImageView;
|
||||
@@ -651,11 +650,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
@Override
|
||||
public void exitRoom(RoomInfo roomInfo) {
|
||||
closeOpenRoomAnimation();
|
||||
//ktv退出的时候需要用到
|
||||
if (AudioEngineManager.get().isOpenKtv() && roomInfo != null) {
|
||||
KtvMusicManager.INSTANCE.deleteUserAllChooseMusic(roomInfo.getUid()).subscribe();
|
||||
AudioEngineManager.get().closeKtvModel();
|
||||
}
|
||||
DaemonService.stop(MainActivity.this);
|
||||
}
|
||||
|
||||
|
@@ -1,188 +0,0 @@
|
||||
package com.mango.moshen.avroom.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.ktv.KtvMusicManager;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.mango.core.bean.RoomQueueInfo;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.ktv.event.MusicCountEvent;
|
||||
import com.mango.core.room.pk.bean.PKTeamInfo;
|
||||
import com.mango.core.room.queue.bean.MicMemberInfo;
|
||||
import com.mango.core.utils.StringUtils;
|
||||
import com.mango.xchat_android_library.rxbus.RxBus;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
|
||||
/**
|
||||
* @author xiaoyu
|
||||
* @date 2017/12/18
|
||||
*/
|
||||
|
||||
public class KtvMicroViewAdapter extends BaseMicroViewAdapter {
|
||||
|
||||
private int[] realPositions = {1, 5, 2, 6, 0, 3, 7, 4, 8};
|
||||
|
||||
private ViewGroup.LayoutParams microParams;
|
||||
private ViewGroup.LayoutParams bossParams;
|
||||
|
||||
public KtvMicroViewAdapter(Context context) {
|
||||
super(context);
|
||||
int itemWidth = (int) (ScreenUtil.screenWidth * 0.1875);
|
||||
microParams = new ViewGroup.LayoutParams(itemWidth, UIUtil.dip2px(context, 80));
|
||||
bossParams = new ViewGroup.LayoutParams(ScreenUtil.screenWidth / 4, UIUtil.dip2px(context, 160));
|
||||
disposables.add(RxBus.get().toFlowable(MusicCountEvent.class)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(musicCountEvent -> notifyDataSetChanged()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set LayoutManager and bind this to {@link RecyclerView}
|
||||
*/
|
||||
@Override
|
||||
public void bindToRecyclerView(RecyclerView recyclerView) {
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(context, 2);
|
||||
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
||||
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
|
||||
@Override
|
||||
public int getSpanSize(int position) {
|
||||
return position == 4 ? 2 : 1;
|
||||
}
|
||||
});
|
||||
recyclerView.setLayoutManager(layoutManager);
|
||||
recyclerView.setAdapter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View item = LayoutInflater.from(parent.getContext())
|
||||
.inflate(viewType == TYPE_BOSS ? R.layout.item_ktv_boss_micro : R.layout.list_item_ktv_micro, parent, false);
|
||||
return new KtvMicroViewHolder(item, viewType == TYPE_BOSS);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, final int position) {
|
||||
int realPosition = realPositions[position];
|
||||
RoomQueueInfo roomQueueInfo = AvRoomDataManager.get().getRoomQueueMemberInfoByMicPosition(realPosition - 1);
|
||||
viewHolder.itemView.setLayoutParams(position == 4 ? bossParams : microParams);
|
||||
if (roomQueueInfo == null) return;
|
||||
NormalMicroViewHolder holder = (NormalMicroViewHolder) viewHolder;
|
||||
holder.bind(roomQueueInfo, realPosition - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String microType() {
|
||||
return BaseMicroViewAdapter.MICRO_TYPE_KTV;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return (position == 4) ? TYPE_BOSS : TYPE_NORMAL;
|
||||
}
|
||||
|
||||
class KtvMicroViewHolder extends NormalMicroViewHolder {
|
||||
|
||||
ImageView ivSinger;
|
||||
TextView tvPkMark;
|
||||
boolean mIsBoss;
|
||||
|
||||
KtvMicroViewHolder(View itemView, boolean isBoss) {
|
||||
super(itemView);
|
||||
ivSinger = itemView.findViewById(R.id.iv_singer);
|
||||
tvPkMark = (TextView) itemView.findViewById(R.id.tv_pk_mark);
|
||||
mIsBoss = isBoss;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
super.clear();
|
||||
ivSinger.setVisibility(View.GONE);
|
||||
tvPkMark.setVisibility(View.GONE);
|
||||
disposables.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setDefalutText(int index) {
|
||||
tvNick.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
if (mIsBoss) {
|
||||
tvNick.setTextColor(context.getResources().getColor(R.color.white_transparent_30));
|
||||
tvNick.setText("未上座");
|
||||
} else
|
||||
super.setDefalutText(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setSelectText(int index, String nick, int gender) {
|
||||
super.setSelectText(index, nick, gender);
|
||||
|
||||
if (mIsBoss) {
|
||||
setBossViewGender(tvNick, gender == 1);
|
||||
} else
|
||||
tvNick.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
void bind(RoomQueueInfo info, int position) {
|
||||
super.bind(info, position);
|
||||
MicMemberInfo micMemberInfo = info.mChatRoomMember;
|
||||
if (micMemberInfo != null && micMemberInfo.getGroupType() == PKTeamInfo.TEAM_RED) {
|
||||
tvPkMark.setVisibility(View.VISIBLE);
|
||||
tvPkMark.setBackgroundResource(R.drawable.shape_pk_mic_queue_mark_red);
|
||||
tvPkMark.setText("红队");
|
||||
ivSinger.setVisibility(View.GONE);
|
||||
if (isSinging(info.mChatRoomMember)) {
|
||||
tvPkMark.setCompoundDrawablesWithIntrinsicBounds(tvPkMark.getResources().getDrawable(R.drawable.ktv_pk_singing_mark), null, null, null);
|
||||
} else {
|
||||
tvPkMark.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
||||
}
|
||||
} else if (micMemberInfo != null && micMemberInfo.getGroupType() == PKTeamInfo.TEAM_BLUE) {
|
||||
tvPkMark.setVisibility(View.VISIBLE);
|
||||
tvPkMark.setBackgroundResource(R.drawable.shape_pk_mic_queue_mark_blue);
|
||||
tvPkMark.setText("蓝队");
|
||||
ivSinger.setVisibility(View.GONE);
|
||||
if (isSinging(info.mChatRoomMember)) {
|
||||
tvPkMark.setCompoundDrawablesWithIntrinsicBounds(tvPkMark.getResources().getDrawable(R.drawable.ktv_pk_singing_mark), null, null, null);
|
||||
} else {
|
||||
tvPkMark.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
||||
}
|
||||
} else {
|
||||
tvPkMark.setVisibility(View.GONE);
|
||||
if (isSinging(info.mChatRoomMember)) {
|
||||
ivSinger.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
ivSinger.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean isSinging(MicMemberInfo chatRoomMember) {
|
||||
return chatRoomMember != null && KtvMusicManager.INSTANCE.getCurrMusic().getUid() == StringUtils.toLong(chatRoomMember.getAccount());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private CompositeDisposable disposables = new CompositeDisposable();
|
||||
|
||||
@Override
|
||||
public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
|
||||
super.onDetachedFromRecyclerView(recyclerView);
|
||||
disposables.dispose();
|
||||
}
|
||||
|
||||
}
|
@@ -7,38 +7,6 @@ import android.view.View;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.mango.core.statistic.StatisticManager;
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.avroom.adapter.BaseMicroViewAdapter;
|
||||
import com.mango.moshen.avroom.adapter.CpMicroViewAdapter;
|
||||
import com.mango.moshen.avroom.adapter.DatingMicroViewAdapter;
|
||||
import com.mango.moshen.avroom.adapter.KtvMicroViewAdapter;
|
||||
import com.mango.moshen.avroom.adapter.MicroViewAdapter;
|
||||
import com.mango.moshen.avroom.anotherroompk.RoomPkFinishDialog;
|
||||
import com.mango.moshen.avroom.anotherroompk.RoomPkForceFinishDialog;
|
||||
import com.mango.moshen.avroom.anotherroompk.RoomPkReceivedDialog;
|
||||
import com.mango.moshen.avroom.dialog.MicQueueDialog;
|
||||
import com.mango.moshen.avroom.dialog.PKMicQueueDialog;
|
||||
import com.mango.moshen.avroom.dialog.PKResultDialog;
|
||||
import com.mango.moshen.avroom.dialog.PKScoreBoardDialog;
|
||||
import com.mango.moshen.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
import com.mango.moshen.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.mango.moshen.avroom.ktv.KtvSongListActivity;
|
||||
import com.mango.moshen.avroom.presenter.HomePartyPresenter;
|
||||
import com.mango.moshen.avroom.view.IHomePartyView;
|
||||
import com.mango.moshen.avroom.widget.PKBoardView;
|
||||
import com.mango.moshen.base.BaseMvpActivity;
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||
import com.mango.moshen.databinding.FragmentAvRoomGameBinding;
|
||||
import com.mango.moshen.treasure_box.widget.GoldBoxHelper;
|
||||
import com.mango.moshen.ui.webview.DatingRuleWebViewActivity;
|
||||
import com.mango.moshen.ui.webview.DialogWebViewActivity;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.Constants;
|
||||
import com.mango.core.UriProvider;
|
||||
import com.mango.core.auth.AuthModel;
|
||||
@@ -63,14 +31,41 @@ import com.mango.core.room.pk.model.PkModel;
|
||||
import com.mango.core.room.queuing_mic.bean.RespQueuingMicListInfo;
|
||||
import com.mango.core.room.queuing_mic.event.QueuingMicEmptyEvent;
|
||||
import com.mango.core.room.queuing_mic.event.QueuingMicNotEmptyEvent;
|
||||
import com.mango.core.statistic.StatisticManager;
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.mango.core.super_admin.util.SuperAdminUtil;
|
||||
import com.mango.core.user.UserModel;
|
||||
import com.mango.core.utils.CurrentTimeUtils;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.avroom.adapter.BaseMicroViewAdapter;
|
||||
import com.mango.moshen.avroom.adapter.CpMicroViewAdapter;
|
||||
import com.mango.moshen.avroom.adapter.DatingMicroViewAdapter;
|
||||
import com.mango.moshen.avroom.adapter.MicroViewAdapter;
|
||||
import com.mango.moshen.avroom.anotherroompk.RoomPkFinishDialog;
|
||||
import com.mango.moshen.avroom.anotherroompk.RoomPkForceFinishDialog;
|
||||
import com.mango.moshen.avroom.anotherroompk.RoomPkReceivedDialog;
|
||||
import com.mango.moshen.avroom.dialog.MicQueueDialog;
|
||||
import com.mango.moshen.avroom.dialog.PKMicQueueDialog;
|
||||
import com.mango.moshen.avroom.dialog.PKResultDialog;
|
||||
import com.mango.moshen.avroom.dialog.PKScoreBoardDialog;
|
||||
import com.mango.moshen.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
import com.mango.moshen.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.mango.moshen.avroom.presenter.HomePartyPresenter;
|
||||
import com.mango.moshen.avroom.view.IHomePartyView;
|
||||
import com.mango.moshen.avroom.widget.PKBoardView;
|
||||
import com.mango.moshen.base.BaseMvpActivity;
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||
import com.mango.moshen.databinding.FragmentAvRoomGameBinding;
|
||||
import com.mango.moshen.ui.webview.DatingRuleWebViewActivity;
|
||||
import com.mango.moshen.ui.webview.DialogWebViewActivity;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
import com.mango.xchat_android_library.utils.TimeUtils;
|
||||
import com.mango.xchat_android_library.utils.UIUtils;
|
||||
import com.mango.xchat_android_library.utils.config.BasicConfig;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -459,10 +454,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
if (!microType.equals(BaseMicroViewAdapter.MICRO_TYPE_CP)) {
|
||||
microView.bindAdapter(new CpMicroViewAdapter(mContext));
|
||||
}
|
||||
} else if (AvRoomDataManager.get().isOpenKTV()) {
|
||||
if (!microType.equals(BaseMicroViewAdapter.MICRO_TYPE_KTV)) {
|
||||
microView.bindAdapter(new KtvMicroViewAdapter(mContext));
|
||||
}
|
||||
} else if (AvRoomDataManager.get().isDatingMode()) {
|
||||
if (!microType.equals(BaseMicroViewAdapter.MICRO_TYPE_DATING)) {
|
||||
microView.bindAdapter(new DatingMicroViewAdapter(mContext));
|
||||
@@ -612,9 +603,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
getMvpPresenter().cancelDragon();
|
||||
});
|
||||
break;
|
||||
case R.id.stv_ktv_song:
|
||||
KtvSongListActivity.start(mContext, false);
|
||||
break;
|
||||
case R.id.tv_hour_rank:
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
|
@@ -1,28 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
public class KickDownMicEvent {
|
||||
|
||||
private String account;
|
||||
private String nick;
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public KickDownMicEvent(String account, String nick) {
|
||||
this.account = account;
|
||||
this.nick = nick;
|
||||
}
|
||||
}
|
@@ -1,107 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.treasure_box.widget.dialog.BaseBindingDialog;
|
||||
import com.mango.moshen.databinding.DialogKtvCommitErrorBinding;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_ktv_commit_error)
|
||||
public class KtvCommitErrorDialog extends BaseBindingDialog<DialogKtvCommitErrorBinding> implements View.OnClickListener {
|
||||
|
||||
private String[] errs = new String[]{
|
||||
"歌词有误",
|
||||
"歌词与伴奏有错位",
|
||||
"原唱与伴奏不匹配",
|
||||
"伴奏有误",
|
||||
"伴奏音质差",
|
||||
"MV质量差",
|
||||
"无法播放",
|
||||
"其他"};
|
||||
private int musicId;
|
||||
|
||||
public KtvCommitErrorDialog(Context context, int musicId) {
|
||||
super(context, R.style.TranslucentNoTitle);
|
||||
this.musicId = musicId;
|
||||
}
|
||||
|
||||
public static KtvCommitErrorDialog newInstance(Context context, int musicId) {
|
||||
return new KtvCommitErrorDialog(context, musicId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
binding.setClick(this);
|
||||
TextView checkBox;
|
||||
for (String err : errs) {
|
||||
checkBox = (TextView) getLayoutInflater().inflate(R.layout.item_ktv_err, null);
|
||||
checkBox.setText(err);
|
||||
binding.llErrs.addView(checkBox, createLayoutParams());
|
||||
checkBox.setOnClickListener(v -> {
|
||||
v.setSelected(!v.isSelected());
|
||||
updateCommitStatus();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updateCommitStatus() {
|
||||
boolean clickable = false;
|
||||
for (int i = 0; i < binding.llErrs.getChildCount(); i++) {
|
||||
if (binding.llErrs.getChildAt(i).isSelected()) {
|
||||
clickable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
binding.tvSure.setClickable(clickable);
|
||||
binding.tvSure.setSolid(clickable ? context.getResources().getColor(R.color.appColor) :
|
||||
context.getResources().getColor(R.color.color_FFC4A7));
|
||||
}
|
||||
|
||||
private LinearLayout.LayoutParams createLayoutParams() {
|
||||
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT, UIUtil.dip2px(context, 38));
|
||||
layoutParams.setMarginStart(UIUtil.dip2px(context, 15));
|
||||
layoutParams.setMarginEnd(UIUtil.dip2px(context, 15));
|
||||
return layoutParams;
|
||||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
TextView checkBox;
|
||||
switch (view.getId()) {
|
||||
case R.id.tv_sure:
|
||||
StringBuilder errMsg = new StringBuilder();
|
||||
for (int i = 0; i < binding.llErrs.getChildCount(); i++) {
|
||||
checkBox = (TextView) binding.llErrs.getChildAt(i);
|
||||
if (checkBox.isSelected()) {
|
||||
if (i != 0) errMsg.append(",");
|
||||
errMsg.append(checkBox.getText().toString());
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(errMsg.toString())) {
|
||||
SingleToastUtil.showToast("请至少选择一种错误!");
|
||||
return;
|
||||
}
|
||||
KtvMusicManager.INSTANCE.musicError(musicId, errMsg.toString())
|
||||
.subscribe(s -> {
|
||||
closeDialog();
|
||||
SingleToastUtil.showToast("提交成功!");
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@@ -1,71 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.im.custom.bean.MusicInfoAttachment;
|
||||
import com.mango.core.manager.IMNetEaseManager;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
import com.mango.xchat_android_library.utils.NetworkUtils;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_KTV;
|
||||
|
||||
|
||||
public class KtvHelper {
|
||||
|
||||
public static final int NO_NET = 1;
|
||||
public static final int NO_SONG = 2;
|
||||
public static final int NO_ROOM = 3;
|
||||
public static final int NO_DATA = 4;
|
||||
public static View createKtvEmptyView(Context context,int type ) {
|
||||
if (!NetworkUtils.isNetworkAvailable(context)) type = NO_NET;
|
||||
String hint ="";
|
||||
int resId = 0;
|
||||
switch (type) {
|
||||
case NO_NET:
|
||||
hint = "网络异常,加载失败";
|
||||
resId = R.drawable.icon_common_failure;
|
||||
break;
|
||||
case NO_DATA:
|
||||
hint = "搜索无歌曲";
|
||||
resId = R.drawable.icon_common_failure;
|
||||
break;
|
||||
case NO_ROOM:
|
||||
hint = "无房间开唱";
|
||||
resId = R.drawable.icon_common_failure;
|
||||
break;
|
||||
case NO_SONG:
|
||||
hint = "无点唱歌曲";
|
||||
resId = R.drawable.icon_common_failure;
|
||||
break;
|
||||
}
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.fragment_no_data_large_iv, null);
|
||||
view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
((TextView)view.findViewById(R.id.no_data_text)).setText(hint);
|
||||
((ImageView)view.findViewById(R.id.no_data_icon)).setImageResource(resId);
|
||||
return view;
|
||||
}
|
||||
|
||||
public static Single<ChatRoomMessage> sendChatRoomMusicMessage(int sub, MusicInfo musicInfo) {
|
||||
MusicInfoAttachment musicInfoAttachment = new MusicInfoAttachment(CUSTOM_MSG_KTV, sub);
|
||||
if (musicInfo != null) {
|
||||
musicInfo.setOperationNick(UserUtils.getUserInfo().getNick());
|
||||
musicInfo.setOperationUid(UserUtils.getUserUid());
|
||||
musicInfoAttachment.setMusicInfo(musicInfo);
|
||||
}
|
||||
final ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
UserUtils.getCurrentRoomId() + "", musicInfoAttachment);
|
||||
return IMNetEaseManager.get().sendChatRoomMessage(message, false);
|
||||
}
|
||||
}
|
@@ -1,207 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
|
||||
import com.mango.core.manager.IMNetEaseManager;
|
||||
import com.mango.core.manager.AudioEngineManager;
|
||||
import com.mango.core.room.ktv.KtvModel;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
import com.mango.core.room.ktv.bean.RoomMusicInfo;
|
||||
import com.mango.core.room.ktv.event.KtvEvent;
|
||||
import com.mango.core.room.ktv.event.MusicCountEvent;
|
||||
import com.mango.core.utils.net.RxHelper;
|
||||
import com.mango.xchat_android_library.rxbus.RxBus;
|
||||
import com.mango.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_KTV_DELETE_USER_ALL;
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_KTV_FINISH;
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_KTV_SWITCH;
|
||||
|
||||
public enum KtvMusicManager {
|
||||
INSTANCE;
|
||||
private final ArrayList<MusicInfo> mData = new ArrayList<>();
|
||||
private MusicInfo currMusic;
|
||||
private double currPlayPos;
|
||||
private Disposable ktvDisposable;
|
||||
private Disposable startDisposable;
|
||||
private Disposable dataDisposable;
|
||||
private Disposable switchDisposable;
|
||||
|
||||
public void reset() {
|
||||
dispose(ktvDisposable);
|
||||
ktvDisposable = RxBus.get().toFlowable(KtvEvent.class)
|
||||
.subscribe(this::handleKtvEvent);
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
dispose(dataDisposable);
|
||||
dataDisposable = KtvModel.get().getRoomMusic(UserUtils.getCurrentRoomUid())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.doOnSuccess(this::setData)
|
||||
.filter(roomMusicInfo -> !AvRoomDataManager.get().isOwnerOnMic() && !ListUtils.isListEmpty(roomMusicInfo.getUserChooseMusicVos()))
|
||||
.toObservable()
|
||||
.flatMap(roomMusicInfo -> Observable.fromIterable(roomMusicInfo.getUserChooseMusicVos()))
|
||||
.filter(musicInfo -> musicInfo.getUid() == UserUtils.getUserUid())
|
||||
.firstElement()
|
||||
.toSingle()
|
||||
.flatMap(musicInfo -> deleteUserAllChooseMusic())
|
||||
.subscribe(s -> { }, e -> { });
|
||||
}
|
||||
|
||||
public void setData(RoomMusicInfo roomMusicInfo) {
|
||||
mData.clear();
|
||||
currMusic = roomMusicInfo.getSingingMusicVo();
|
||||
if (!ListUtils.isListEmpty(roomMusicInfo.getUserChooseMusicVos())) {
|
||||
mData.addAll(roomMusicInfo.getUserChooseMusicVos());
|
||||
}
|
||||
RxBus.get().post(KtvEvent.newInstance(KtvEvent.MUSIC_UPDATE, null));
|
||||
RxBus.get().post(new MusicCountEvent(mData.size()));
|
||||
}
|
||||
|
||||
//处理KTV相关的各种事件
|
||||
private void handleKtvEvent(KtvEvent ktvEvent) {
|
||||
LogUtils.d(ktvEvent.toString());
|
||||
MusicInfo musicInfo = ktvEvent.getMusicInfo();
|
||||
switch (ktvEvent.getType()) {
|
||||
case KtvEvent.SWITCH_MUSIC:
|
||||
if (currMusic != null) mData.remove(currMusic);
|
||||
currMusic = musicInfo;
|
||||
AudioEngineManager.get().stopPush();
|
||||
startMv(musicInfo);
|
||||
break;
|
||||
case KtvEvent.ADD_MUSIC:
|
||||
if (musicInfo != null) {
|
||||
mData.add(musicInfo);
|
||||
}
|
||||
break;
|
||||
case KtvEvent.POP_MUSIC:
|
||||
if (musicInfo != null) {
|
||||
mData.remove(musicInfo);
|
||||
}
|
||||
break;
|
||||
case KtvEvent.NO_MUSIC:
|
||||
case KtvEvent.CLOSE_KTV_MODEL:
|
||||
AudioEngineManager.get().stopPush();
|
||||
AudioEngineManager.get().setLive(false);
|
||||
mData.clear();
|
||||
currMusic = null;
|
||||
break;
|
||||
case KtvEvent.DELETE_USER_CHOOSE_MUSIC:
|
||||
if (musicInfo != null) {
|
||||
mData.remove(musicInfo);
|
||||
}
|
||||
case KtvEvent.DELETE_USER_ALL_MUSIC:
|
||||
if (musicInfo != null) {
|
||||
Iterator<MusicInfo> iterator = mData.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
if (iterator.next().getUid() == musicInfo.getUid()) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KtvEvent.MUSIC_COMPLETE:
|
||||
LogUtils.d("MUSIC_COMPLETE");
|
||||
// if (AudioEngineManager.get().isPush()) switchSong(false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
RxBus.get().post(new MusicCountEvent(mData.size()));
|
||||
}
|
||||
|
||||
private void startMv(MusicInfo musicInfo) {
|
||||
if (musicInfo == null ||UserUtils.getUserUid() != musicInfo.getUid()) return;
|
||||
dispose(startDisposable);
|
||||
currPlayPos = -1;
|
||||
startDisposable = Observable.just(0)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.delay(2, TimeUnit.SECONDS)
|
||||
.takeUntil(integer -> !KtvView.isShowPrepare || UserUtils.getUserUid() != getCurrMusic().getUid())//准备中下麦处理
|
||||
.doOnNext(integer -> AudioEngineManager.get().startMv(musicInfo.getMusicUrl()))
|
||||
.flatMap(integer -> Observable.interval(0, 1, TimeUnit.SECONDS))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.takeUntil(aLong -> !AudioEngineManager.get().isPush())
|
||||
.filter(aLong -> (AudioEngineManager.get().getPlayPos() > 0.99d ||
|
||||
(AudioEngineManager.get().getPlayPos() > 0.94d && AudioEngineManager.get().isPlaying() &&
|
||||
currPlayPos == (currPlayPos = AudioEngineManager.get().getPlayPos()))))
|
||||
.take(1)
|
||||
.subscribe(aLong -> switchSong(false));
|
||||
|
||||
}
|
||||
|
||||
public Single<String> addMusic(MusicInfo musicInfo) {
|
||||
return KtvModel.get().chooseMusic(musicInfo.getMusicId(), UserUtils.getUserUid(), UserUtils.getCurrentRoomUid());
|
||||
}
|
||||
|
||||
public Single<String> popMusic(MusicInfo musicInfo) {
|
||||
return KtvModel.get().popMusic(musicInfo.getMusicId(), musicInfo.getUid(), UserUtils.getCurrentRoomUid());
|
||||
}
|
||||
|
||||
public Single<Boolean> switchMusic() {
|
||||
return KtvModel.get().switchMusic(UserUtils.getCurrentRoomUid());
|
||||
}
|
||||
|
||||
public Single<String> deleteUserChooseMusic(MusicInfo musicInfo) {
|
||||
return KtvModel.get().deleteUserChooseMusic(musicInfo.getMusicId(), musicInfo.getUid(), UserUtils.getCurrentRoomUid());
|
||||
}
|
||||
|
||||
public Single<String> deleteRoomAllChooseMusic() {
|
||||
return KtvModel.get().deleteRoomAllChooseMusic(UserUtils.getCurrentRoomUid());
|
||||
}
|
||||
|
||||
public Single<String> deleteUserAllChooseMusic() {
|
||||
return deleteUserAllChooseMusic(UserUtils.getCurrentRoomUid());
|
||||
}
|
||||
|
||||
public Single<String> deleteUserAllChooseMusic(long roomUid) {
|
||||
return KtvModel.get()
|
||||
.deleteUserAllChooseMusic(UserUtils.getUserUid(), roomUid)
|
||||
.doOnSuccess(s -> KtvHelper.sendChatRoomMusicMessage(CUSTOM_MSG_SUB_KTV_DELETE_USER_ALL, null)
|
||||
.subscribe(chatRoomMessage -> RxBus.get().post(KtvEvent.newInstance(KtvEvent.DELETE_USER_ALL_MUSIC, null))));
|
||||
}
|
||||
|
||||
public void switchSong(boolean isSwitch) {
|
||||
MusicInfo musicInfo = getCurrMusic();
|
||||
dispose(switchDisposable);
|
||||
switchDisposable = KtvMusicManager.INSTANCE.switchMusic()
|
||||
.flatMap(s -> KtvHelper.sendChatRoomMusicMessage(isSwitch ? CUSTOM_MSG_SUB_KTV_SWITCH : CUSTOM_MSG_SUB_KTV_FINISH, musicInfo))
|
||||
.subscribe(chatRoomMessage -> IMNetEaseManager.get().addMessages(chatRoomMessage));
|
||||
}
|
||||
|
||||
public Single<String> musicError(int musicId,String errorMsg) {
|
||||
return KtvModel.get().musicError(musicId, UserUtils.getUserUid(),errorMsg);
|
||||
}
|
||||
|
||||
|
||||
private void dispose(@Nullable Disposable disposable) {
|
||||
if (disposable != null) disposable.dispose();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<MusicInfo> getMusicList() {
|
||||
return mData;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public MusicInfo getCurrMusic() {
|
||||
return currMusic == null ? new MusicInfo() : currMusic;
|
||||
}
|
||||
}
|
@@ -1,61 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.base.BaseBindingActivity;
|
||||
import com.mango.moshen.common.ViewPagerAdapter;
|
||||
import com.mango.moshen.databinding.ActivityKtvRoomListBinding;
|
||||
import com.mango.moshen.decoration.view.widgets.CarMagicIndicator;
|
||||
import com.mango.moshen.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.mango.core.home.bean.TabInfo;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.mango.xchat_android_library.utils.CommonUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> KTV房间列表</p>
|
||||
*
|
||||
*/
|
||||
@ActLayoutRes(R.layout.activity_ktv_room_list)
|
||||
public class KtvRoomListActivity extends BaseBindingActivity<ActivityKtvRoomListBinding> implements CarMagicIndicator.OnItemSelectListener {
|
||||
|
||||
public static void start(Context context) {
|
||||
if (CommonUtils.isFastDoubleClick(500)) return;
|
||||
Intent starter = new Intent(context, KtvRoomListActivity.class);
|
||||
//starter.putExtra();
|
||||
context.startActivity(starter);
|
||||
}
|
||||
@Override
|
||||
protected void init() {
|
||||
List<Fragment> list = new ArrayList<>();
|
||||
list.add(KtvRoomListFragment.newInstance(KtvRoomListFragment.NEW));
|
||||
list.add(KtvRoomListFragment.newInstance(KtvRoomListFragment.HOT));
|
||||
List<TabInfo> tabInfoList = new ArrayList<>(2);
|
||||
tabInfoList.add(new TabInfo(1, "最新"));
|
||||
tabInfoList.add(new TabInfo(2, "最热"));
|
||||
CommonNavigator commonNavigator = new CommonNavigator(this);
|
||||
commonNavigator.setAdjustMode(true);
|
||||
CarMagicIndicator indicator = new CarMagicIndicator(this, tabInfoList, 0);
|
||||
indicator.setOnItemSelectListener(this);
|
||||
commonNavigator.setAdapter(indicator);
|
||||
mBinding.viewIndicator.setNavigator(commonNavigator);
|
||||
ViewPagerHelper.bind(mBinding.viewIndicator, mBinding.viewPager);
|
||||
String[] titles = {"最新", "最热"};
|
||||
mBinding.setClick(this);
|
||||
initTitleBar("KTV房");
|
||||
// mBinding.tabLayout.setupWithViewPager(mBinding.viewPager);
|
||||
// mBinding.tabLayout.setTabGravity(TabLayout.GRAVITY_CENTER);
|
||||
mBinding.viewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager(), list, titles));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelect(int position) {
|
||||
mBinding.viewPager.setCurrentItem(position);
|
||||
}
|
||||
}
|
@@ -1,78 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.mango.moshen.BR;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.base.BaseBindingFragment;
|
||||
import com.mango.moshen.bindadapter.BaseAdapter;
|
||||
import com.mango.moshen.databinding.FragmentRecyclerViewBindNoBgBinding;
|
||||
import com.mango.core.room.ktv.bean.KtvRoomInfo;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
|
||||
@ActLayoutRes(R.layout.fragment_recycler_view_bind_no_bg)
|
||||
public class KtvRoomListFragment extends BaseBindingFragment<FragmentRecyclerViewBindNoBgBinding> implements SwipeRefreshLayout.OnRefreshListener, BaseQuickAdapter.RequestLoadMoreListener {
|
||||
private BaseAdapter<KtvRoomInfo> adapter;
|
||||
private KtvRoomListVm ktvRoomListVm;
|
||||
public static final int NEW = 1;
|
||||
public static final int HOT = 2;
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
int type = getArguments().getInt("type", HOT);
|
||||
ktvRoomListVm = new KtvRoomListVm(mBinding, type);
|
||||
adapter = new BaseAdapter<>(R.layout.list_item_ktv_room, BR.ktvRoomInfo);
|
||||
adapter.setEmptyView(KtvHelper.createKtvEmptyView(getContext(),KtvHelper.NO_ROOM ));
|
||||
mBinding.setViewmodel(ktvRoomListVm);
|
||||
mBinding.recyclerView.setLayoutManager(new GridLayoutManager(mContext,2));
|
||||
mBinding.recyclerView.setAdapter(adapter);
|
||||
mBinding.swipeRefresh.setOnRefreshListener(this);
|
||||
loadData(false);
|
||||
adapter.setOnLoadMoreListener(this, mBinding.recyclerView);
|
||||
adapter.setOnItemClickListener((adapter, view, position) ->{
|
||||
AVRoomActivity.start(getActivity(), ((KtvRoomInfo)adapter.getData().get(position)).getRoomUid());
|
||||
// getActivity().finish();
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
private void loadData(boolean isLoad) {
|
||||
ktvRoomListVm.loadData(isLoad)
|
||||
.compose(bindToLifecycle())
|
||||
.doAfterTerminate(() -> {
|
||||
if (adapter.getItemCount() == 0) showNoData();
|
||||
else hideStatus();
|
||||
}).subscribe();
|
||||
}
|
||||
|
||||
public static KtvRoomListFragment newInstance(int type) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("type", type);
|
||||
KtvRoomListFragment fragment = new KtvRoomListFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReloadData() {
|
||||
loadData(false);
|
||||
showLoading();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
loadData(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreRequested() {
|
||||
loadData(true);
|
||||
}
|
||||
|
||||
}
|
@@ -1,33 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
|
||||
import com.mango.moshen.base.BaseMsListViewModel;
|
||||
import com.mango.moshen.databinding.FragmentRecyclerViewBindNoBgBinding;
|
||||
import com.mango.core.bean.response.ServiceResult;
|
||||
import com.mango.core.room.ktv.KtvModel;
|
||||
import com.mango.core.room.ktv.bean.KtvRoomInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
/**
|
||||
* Created by huangmeng1 on 2018/5/9.
|
||||
*/
|
||||
|
||||
public class KtvRoomListVm extends BaseMsListViewModel<FragmentRecyclerViewBindNoBgBinding, KtvRoomInfo> {
|
||||
|
||||
private int sortType;
|
||||
|
||||
public KtvRoomListVm(FragmentRecyclerViewBindNoBgBinding mBinding, int sortType) {
|
||||
super(mBinding);
|
||||
this.sortType = sortType;
|
||||
pageSize = 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<ServiceResult<List<KtvRoomInfo>>> getSingle() {
|
||||
return KtvModel.get().getKtvRooms(sortType, page, pageSize);
|
||||
}
|
||||
|
||||
}
|
@@ -1,191 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.google.android.flexbox.FlexboxLayout;
|
||||
import com.mango.moshen.BR;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.base.BaseBindingActivity;
|
||||
import com.mango.moshen.bindadapter.BaseAdapter;
|
||||
import com.mango.moshen.databinding.ActivityKtvSearchSongBinding;
|
||||
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
import com.mango.core.room.ktv.event.KtvEvent;
|
||||
import com.mango.core.room.ktv.event.MusicCountEvent;
|
||||
import com.mango.core.utils.SharedPreferenceUtils;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.mango.xchat_android_library.rxbus.RxBus;
|
||||
import com.mango.xchat_android_library.utils.CommonUtils;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
||||
/**
|
||||
* <p> KTV搜索歌曲</p>
|
||||
*
|
||||
*/
|
||||
|
||||
@ActLayoutRes(R.layout.activity_ktv_search_song)
|
||||
public class KtvSearchSongActivity extends BaseBindingActivity<ActivityKtvSearchSongBinding> implements TextWatcher, BaseQuickAdapter.RequestLoadMoreListener, BaseQuickAdapter.OnItemClickListener, TextView.OnEditorActionListener {
|
||||
private KtvSearchSongVm vm;
|
||||
private BaseAdapter<MusicInfo> adapter;
|
||||
|
||||
|
||||
public static void start(Context context) {
|
||||
if (CommonUtils.isFastDoubleClick(500)) return;
|
||||
Intent starter = new Intent(context, KtvSearchSongActivity.class);
|
||||
//starter.putExtra();
|
||||
context.startActivity(starter);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
protected void init() {
|
||||
initTitleBar("点歌台");
|
||||
vm = new KtvSearchSongVm(mBinding);
|
||||
mBinding.setViewModel(vm);
|
||||
mBinding.setClick(this);
|
||||
mBinding.swipeRefresh.setEnabled(false);
|
||||
mBinding.edtSearch.addTextChangedListener(this);
|
||||
adapter = new BaseAdapter<>(R.layout.list_item_ktv_search, BR.musicInfo);
|
||||
adapter.setOnLoadMoreListener(this, mBinding.recyclerView);
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
mBinding.recyclerView.setAdapter(adapter);
|
||||
adapter.setOnItemClickListener(this);
|
||||
adapter.setEmptyView(KtvHelper.createKtvEmptyView(context, KtvHelper.NO_DATA));
|
||||
mBinding.edtSearch.setOnEditorActionListener(this);
|
||||
if (vm.getHistoryList().size() == 0) {
|
||||
mBinding.ivClearHistory.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
for (String item : vm.getHistoryList()) {
|
||||
mBinding.fblHistory.addView(createSearchItem(item), createLayoutParams());
|
||||
}
|
||||
}
|
||||
mBinding.tvSongCount.setText("已点" + KtvMusicManager.INSTANCE.getMusicList().size());
|
||||
RxBus.get().toFlowable(KtvEvent.class)
|
||||
.compose(bindToLifecycle())
|
||||
.filter(ktvEvent -> ktvEvent.getType() == KtvEvent.ADD_MUSIC_BY_USER)
|
||||
.subscribe(ktvEvent -> finish());
|
||||
RxBus.get().toFlowable(MusicCountEvent.class)
|
||||
.compose(bindToLifecycle())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(musicCountEvent -> mBinding.tvSongCount.setText("已点" + musicCountEvent.getCount()));
|
||||
}
|
||||
|
||||
private SuperTextView createSearchItem(String text) {
|
||||
SuperTextView textView = (SuperTextView) LayoutInflater.from(context).inflate(R.layout.item_ktv_search_history, null);
|
||||
textView.setText(text);
|
||||
textView.setMaxLines(1);
|
||||
textView.setOnClickListener(v -> {
|
||||
mBinding.edtSearch.setText(text);
|
||||
mBinding.edtSearch.setSelection(mBinding.edtSearch.getText().toString().length());
|
||||
loadData(text);
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
private FlexboxLayout.LayoutParams createLayoutParams() {
|
||||
FlexboxLayout.LayoutParams layoutParams = new FlexboxLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT, UIUtil.dip2px(this, 28));
|
||||
layoutParams.setMargins(0, 0, UIUtil.dip2px(this, 8), UIUtil.dip2px(this, 10));
|
||||
return layoutParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_search:
|
||||
loadData(mBinding.edtSearch.getText().toString());
|
||||
break;
|
||||
case R.id.iv_clear_history:
|
||||
mBinding.fblHistory.removeAllViews();
|
||||
mBinding.ivClearHistory.setVisibility(View.INVISIBLE);
|
||||
SharedPreferenceUtils.remove("ktv_history");
|
||||
break;
|
||||
|
||||
case R.id.ib_clear_edt:
|
||||
mBinding.edtSearch.setText("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
if (TextUtils.isEmpty(s.toString())) {
|
||||
mBinding.recyclerView.setVisibility(View.GONE);
|
||||
mBinding.llHistory.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void loadData(String searchKey) {
|
||||
if (TextUtils.isEmpty(searchKey)) {
|
||||
toast("请输入搜索关键字~");
|
||||
return;
|
||||
}
|
||||
hideIME();
|
||||
mBinding.recyclerView.setVisibility(View.VISIBLE);
|
||||
mBinding.llHistory.setVisibility(View.GONE);
|
||||
if (vm.addHistory(searchKey)) {
|
||||
if (mBinding.ivClearHistory.getVisibility() == View.INVISIBLE) {
|
||||
mBinding.ivClearHistory.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (mBinding.fblHistory.getChildCount() == 12) mBinding.fblHistory.removeViewAt(11);
|
||||
mBinding.fblHistory.addView(createSearchItem(searchKey), 0, createLayoutParams());
|
||||
}
|
||||
vm.setSearchKey(searchKey);
|
||||
vm.loadData(this, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreRequested() {
|
||||
vm.loadData(this, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
if (CommonUtils.isFastDoubleClick(500)) return;
|
||||
if (AvRoomDataManager.get().isOnMic(UserUtils.getUserUid())) {
|
||||
KtvSelectSongDialog.newInstance(context, this.adapter.getData().get(position))
|
||||
.openDialog();
|
||||
} else {
|
||||
getDialogManager().showOkDialog("只有麦上用户才可以点歌哦~");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEARCH
|
||||
|| (event != null && KeyEvent.KEYCODE_ENTER == event.getKeyCode() && KeyEvent.ACTION_DOWN == event.getAction())) {
|
||||
loadData(mBinding.edtSearch.getText().toString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -1,59 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import com.mango.moshen.base.BaseMsListViewModel;
|
||||
import com.mango.moshen.databinding.ActivityKtvSearchSongBinding;
|
||||
import com.mango.core.bean.response.ServiceResult;
|
||||
import com.mango.core.room.ktv.KtvModel;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
import com.mango.core.utils.SharedPreferenceUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
public class KtvSearchSongVm extends BaseMsListViewModel<ActivityKtvSearchSongBinding, MusicInfo> {
|
||||
|
||||
private String searchKey;
|
||||
|
||||
public KtvSearchSongVm(ActivityKtvSearchSongBinding mBinding) {
|
||||
super(mBinding);
|
||||
}
|
||||
|
||||
public void setSearchKey(String searchKey) {
|
||||
this.searchKey = searchKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<ServiceResult<List<MusicInfo>>> getSingle() {
|
||||
return KtvModel.get().searchMusic(searchKey, page, pageSize);
|
||||
}
|
||||
|
||||
|
||||
public boolean addHistory(String searchKey) {
|
||||
if (TextUtils.isEmpty(searchKey)) return false;
|
||||
List<String> historyList = getHistoryList();
|
||||
if (!historyList.contains(searchKey)) {
|
||||
if (historyList.size() > 11) historyList.remove(11);
|
||||
historyList.add(0, searchKey);
|
||||
SharedPreferenceUtils.put("ktv_history", new Gson().toJson(historyList));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<String> getHistoryList() {
|
||||
String historys = (String) SharedPreferenceUtils.get("ktv_history", "");
|
||||
List<String> historyList = new ArrayList<>();
|
||||
if (!TextUtils.isEmpty(historys)) {
|
||||
historyList.addAll(new Gson().fromJson(historys, new TypeToken<List<String>>() {
|
||||
}.getType()));
|
||||
}
|
||||
return historyList;
|
||||
}
|
||||
}
|
@@ -1,106 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import android.view.View;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
|
||||
import com.mango.moshen.BR;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.base.BaseBindingActivity;
|
||||
import com.mango.moshen.bindadapter.BaseAdapter;
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||
import com.mango.moshen.databinding.ActivityKtvSelectSongBinding;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
import com.mango.core.room.ktv.event.MusicCountEvent;
|
||||
import com.mango.core.super_admin.SaConstant;
|
||||
import com.mango.core.super_admin.util.SuperAdminUtil;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.mango.xchat_android_library.rxbus.RxBus;
|
||||
import com.mango.xchat_android_library.utils.CommonUtils;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
||||
/**
|
||||
* <p> KTV点歌台</p>
|
||||
*
|
||||
*/
|
||||
|
||||
@ActLayoutRes(R.layout.activity_ktv_select_song)
|
||||
public class KtvSelectSongActivity extends BaseBindingActivity<ActivityKtvSelectSongBinding> implements BaseQuickAdapter.RequestLoadMoreListener, BaseQuickAdapter.OnItemClickListener {
|
||||
private KtvSelectSongVm vm;
|
||||
private BaseAdapter<MusicInfo> adapter;
|
||||
|
||||
public static void start(Context context, boolean isHint) {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
SingleToastUtil.showToast(SaConstant.TOAST_ERROR_TIPS);
|
||||
return;
|
||||
}
|
||||
if (CommonUtils.isFastDoubleClick(500)) return;
|
||||
if (!AvRoomDataManager.get().isOnMic(UserUtils.getUserUid()) && isHint) {
|
||||
new DialogManager(context).showOkDialog("只有麦上用户才可以点歌哦~");
|
||||
return;
|
||||
}
|
||||
Intent starter = new Intent(context, KtvSelectSongActivity.class);
|
||||
// starter.putExtra();
|
||||
context.startActivity(starter);
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
protected void init() {
|
||||
initTitleBar("点歌台");
|
||||
vm = new KtvSelectSongVm(mBinding);
|
||||
mBinding.setViewModel(vm);
|
||||
mBinding.setClick(this);
|
||||
adapter = new BaseAdapter<>(R.layout.list_item_ktv_select, BR.musicInfo);
|
||||
adapter.setOnLoadMoreListener(this, mBinding.recyclerView);
|
||||
mBinding.swipeRefresh.setEnabled(false);
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
mBinding.recyclerView.setAdapter(adapter);
|
||||
vm.loadData(this, false);
|
||||
adapter.setOnItemClickListener(this);
|
||||
mBinding.stvKtvSong.setText("已点" + KtvMusicManager.INSTANCE.getMusicList().size());
|
||||
RxBus.get().toFlowable(MusicCountEvent.class)
|
||||
.compose(bindToLifecycle())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(musicCountEvent -> mBinding.stvKtvSong.setText("已点" + musicCountEvent.getCount()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.container_search:
|
||||
KtvSearchSongActivity.start(context);
|
||||
break;
|
||||
case R.id.stv_ktv_song:
|
||||
KtvSongListActivity.start(context, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreRequested() {
|
||||
vm.loadData(this, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
if (CommonUtils.isFastDoubleClick(500)) return;
|
||||
if (!AvRoomDataManager.get().isOnMic(UserUtils.getUserUid())) {
|
||||
getDialogManager()
|
||||
.showOkDialog("只有麦上用户才可以点歌喔~");
|
||||
return;
|
||||
}
|
||||
KtvSelectSongDialog.newInstance(context, (MusicInfo) adapter.getData().get(position))
|
||||
|
||||
.openDialog();
|
||||
}
|
||||
}
|
@@ -1,91 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.treasure_box.widget.dialog.BaseBindingDialog;
|
||||
import com.mango.moshen.avroom.widget.MessageView;
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||
import com.mango.moshen.databinding.DialogKtvSelectSongBinding;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.manager.IMNetEaseManager;
|
||||
import com.mango.core.manager.AudioEngineManager;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
import com.mango.core.room.ktv.event.KtvEvent;
|
||||
import com.mango.core.utils.net.BeanObserver;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.mango.xchat_android_library.rxbus.RxBus;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_KTV_ADD;
|
||||
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_ktv_select_song)
|
||||
public class KtvSelectSongDialog extends BaseBindingDialog<DialogKtvSelectSongBinding> implements View.OnClickListener {
|
||||
private MusicInfo musicInfo;
|
||||
|
||||
public KtvSelectSongDialog(Context context, MusicInfo musicInfo) {
|
||||
super(context, R.style.MyAlertDialogStyle);
|
||||
this.musicInfo = musicInfo;
|
||||
}
|
||||
|
||||
public static KtvSelectSongDialog newInstance(Context context, MusicInfo musicInfo) {
|
||||
return new KtvSelectSongDialog(context, musicInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
binding.setMusicInfo(musicInfo);
|
||||
binding.setClick(this);
|
||||
|
||||
MessageView.SpannableBuilder builder = new MessageView.SpannableBuilder(binding.tvUploader)
|
||||
.append("感谢 ")
|
||||
.append(musicInfo.getUploader(), new ForegroundColorSpan(context.getResources().getColor(R.color.appColor)))
|
||||
.append(" 上传");
|
||||
binding.tvUploader.setText(builder.build());
|
||||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.tv_cancel:
|
||||
closeDialog();
|
||||
break;
|
||||
case R.id.tv_sure:
|
||||
if (!AudioEngineManager.get().isOpenKtv()){
|
||||
SingleToastUtil.showToast("管理已经已经关闭KTV模式哦~~");
|
||||
return;
|
||||
}
|
||||
if (!AvRoomDataManager.get().isOnMic(UserUtils.getUserUid())) {
|
||||
new DialogManager(context).showOkDialog("只有麦上用户才可以点歌哦~");
|
||||
return;
|
||||
}
|
||||
KtvMusicManager.INSTANCE.addMusic(musicInfo)
|
||||
.subscribe(new BeanObserver<String>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
SingleToastUtil.showToast(error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
closeDialog();
|
||||
SingleToastUtil.showToast("点歌成功~~");
|
||||
RxBus.get().post(KtvEvent.newInstance(KtvEvent.ADD_MUSIC_BY_USER, musicInfo));
|
||||
RxBus.get().post(KtvEvent.newInstance(KtvEvent.ADD_MUSIC, musicInfo));
|
||||
KtvHelper.sendChatRoomMusicMessage(CUSTOM_MSG_SUB_KTV_ADD, musicInfo)
|
||||
.subscribe(chatRoomMessage -> {
|
||||
IMNetEaseManager.get().addMessages(chatRoomMessage);
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
|
||||
import com.mango.moshen.base.BaseMsListViewModel;
|
||||
import com.mango.moshen.databinding.ActivityKtvSelectSongBinding;
|
||||
import com.mango.core.bean.response.ServiceResult;
|
||||
import com.mango.core.room.ktv.KtvModel;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
public class KtvSelectSongVm extends BaseMsListViewModel<ActivityKtvSelectSongBinding, MusicInfo> {
|
||||
|
||||
public KtvSelectSongVm(ActivityKtvSelectSongBinding mBinding) {
|
||||
super(mBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<ServiceResult<List<MusicInfo>>> getSingle() {
|
||||
return KtvModel.get().hotMusic(page, pageSize);
|
||||
}
|
||||
}
|
@@ -1,152 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_KTV_DELETE;
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_KTV_TOP;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
import com.mango.moshen.BR;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.base.BaseBindingActivity;
|
||||
import com.mango.moshen.base.TitleBar;
|
||||
import com.mango.moshen.bindadapter.BaseAdapter;
|
||||
import com.mango.moshen.databinding.ActivityKtvSongListBinding;
|
||||
import com.mango.core.manager.IMNetEaseManager;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
import com.mango.core.room.ktv.event.KtvEvent;
|
||||
import com.mango.core.super_admin.SaConstant;
|
||||
import com.mango.core.super_admin.util.SuperAdminUtil;
|
||||
import com.mango.xchat_android_library.annatation.ActLayoutRes;
|
||||
import com.mango.xchat_android_library.rxbus.RxBus;
|
||||
import com.mango.xchat_android_library.utils.CommonUtils;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* <p> KTV房间已点列表</p>
|
||||
*
|
||||
*/
|
||||
|
||||
@ActLayoutRes(R.layout.activity_ktv_song_list)
|
||||
public class KtvSongListActivity extends BaseBindingActivity<ActivityKtvSongListBinding> implements SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
private KtvSongListVm vm;
|
||||
private BaseAdapter<MusicInfo> adapter;
|
||||
private boolean hasSelectSong;
|
||||
|
||||
public static void start(Context context, boolean hasSelectSong) {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
SingleToastUtil.showToast(SaConstant.TOAST_ERROR_TIPS);
|
||||
return;
|
||||
}
|
||||
if (CommonUtils.isFastDoubleClick(500)) return;
|
||||
Intent starter = new Intent(context, KtvSongListActivity.class);
|
||||
//starter.putExtra();
|
||||
context.startActivity(starter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
initTitleBar("已点(0)");
|
||||
vm = new KtvSongListVm(mBinding);
|
||||
mBinding.setViewModel(vm);
|
||||
mBinding.setClick(this);
|
||||
vm.count.observe(this, count -> {
|
||||
if (count == null) {
|
||||
return;
|
||||
}
|
||||
setTitleBarText("已点(" + count + ")");
|
||||
});
|
||||
adapter = new KtvSongListAdapter(R.layout.list_item_ktv_song, BR.musicInfo, new int[]{R.id.stv_delete, R.id.stv_top});
|
||||
adapter.setEmptyView(KtvHelper.createKtvEmptyView(context,KtvHelper.NO_SONG ));
|
||||
mBinding.swipeRefresh.setOnRefreshListener(this);
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
mBinding.recyclerView.setAdapter(adapter);
|
||||
vm.loadData(this, false);
|
||||
adapter.setOnItemChildClickListener((adapter, view, position) -> {
|
||||
MusicInfo musicInfo = (MusicInfo) adapter.getItem(position);
|
||||
if (musicInfo == null) return;
|
||||
switch (view.getId()) {
|
||||
case R.id.stv_top:
|
||||
KtvMusicManager.INSTANCE.popMusic(musicInfo)
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(s -> {
|
||||
for (int i = position; i > 1; i--) {
|
||||
Collections.swap(adapter.getData(), i, i - 1);
|
||||
}
|
||||
KtvHelper.sendChatRoomMusicMessage(CUSTOM_MSG_SUB_KTV_TOP,musicInfo)
|
||||
.subscribe(chatRoomMessage -> IMNetEaseManager.get().addMessages(chatRoomMessage));
|
||||
});
|
||||
break;
|
||||
case R.id.stv_delete:
|
||||
KtvMusicManager.INSTANCE.deleteUserChooseMusic(musicInfo)
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(s -> {
|
||||
adapter.remove(position);
|
||||
vm.count.setValue(adapter.getItemCount());
|
||||
KtvHelper.sendChatRoomMusicMessage(CUSTOM_MSG_SUB_KTV_DELETE,musicInfo)
|
||||
.subscribe(chatRoomMessage -> IMNetEaseManager.get().addMessages(chatRoomMessage));
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
RxBus.get().toFlowable(KtvEvent.class)
|
||||
.compose(bindToLifecycle())
|
||||
.filter(ktvEvent -> ktvEvent.getType() == KtvEvent.ADD_MUSIC_BY_USER)
|
||||
.subscribe(ktvEvent -> vm.loadData(KtvSongListActivity.this, false));
|
||||
}
|
||||
|
||||
public void initTitleBar(String title) {
|
||||
mTitleBar = (TitleBar) findViewById(R.id.title_bar);
|
||||
if (mTitleBar != null) {
|
||||
mTitleBar.setTitle(title);
|
||||
mTitleBar.setImmersive(false);
|
||||
mTitleBar.setTitleColor(getResources().getColor(R.color.back_font));
|
||||
mTitleBar.setLeftImageResource(R.mipmap.common_ic_back);
|
||||
mTitleBar.setLeftClickListener(v -> onLeftClickListener());
|
||||
mTitleBar.addAction(new TitleBar.ImageAction(R.drawable.icon_ktv_select_song_right) {
|
||||
@Override
|
||||
public void performAction(View view) {
|
||||
KtvSelectSongActivity.start(context, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void setTitleBarText(String title) {
|
||||
mTitleBar = (TitleBar) findViewById(R.id.title_bar);
|
||||
if (mTitleBar != null) {
|
||||
mTitleBar.setTitle(title);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
vm.loadData(this, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.bindadapter.BaseAdapter;
|
||||
import com.mango.moshen.bindadapter.BindingViewHolder;
|
||||
import com.mango.moshen.ui.widget.LivingIconView;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
|
||||
public class KtvSongListAdapter extends BaseAdapter<MusicInfo> {
|
||||
|
||||
public KtvSongListAdapter(int layoutResId, int brid, @Nullable int[] clickIds) {
|
||||
super(layoutResId, brid, clickIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BindingViewHolder helper, MusicInfo item) {
|
||||
super.convert(helper, item);
|
||||
int position = helper.getLayoutPosition();
|
||||
boolean isManager = AvRoomDataManager.get().isRoomOwner() || AvRoomDataManager.get().isRoomAdmin();
|
||||
helper.setVisible(R.id.stv_top, position != 0 && position != 1 && isManager);
|
||||
helper.setVisible(R.id.stv_delete, position != 0 && (isManager || UserUtils.getUserUid() == item.getUid()));
|
||||
helper.setTextColor(R.id.tv_song_name, position == 0 ? 0xffff4362 : 0xff333333);
|
||||
helper.setVisible(R.id.tv_singing, position == 0);
|
||||
((LivingIconView) helper.getView(R.id.tv_singing)).stop();
|
||||
if (position == 0) {
|
||||
((LivingIconView) helper.getView(R.id.tv_singing)).start();
|
||||
}
|
||||
helper.addOnClickListener(R.id.stv_top)
|
||||
.addOnClickListener(R.id.stv_delete);
|
||||
}
|
||||
}
|
@@ -1,41 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
|
||||
import com.mango.moshen.base.BaseMsListViewModel;
|
||||
import com.mango.moshen.databinding.ActivityKtvSongListBinding;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.bean.response.ServiceResult;
|
||||
import com.mango.core.room.ktv.KtvModel;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
public class KtvSongListVm extends BaseMsListViewModel<ActivityKtvSongListBinding, MusicInfo> {
|
||||
|
||||
public MutableLiveData<Integer> count = new MutableLiveData<>();
|
||||
|
||||
public KtvSongListVm(ActivityKtvSongListBinding mBinding) {
|
||||
super(mBinding);
|
||||
pageSize = 50;
|
||||
count.setValue(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<ServiceResult<List<MusicInfo>>> getSingle() {
|
||||
return KtvModel.get().getRoomMusic(UserUtils.getCurrentRoomUid())
|
||||
.flatMap(result -> {
|
||||
KtvMusicManager.INSTANCE.setData(result.getData());
|
||||
List<MusicInfo> musicInfoList = result.getData().getUserChooseMusicVos();
|
||||
count.setValue(musicInfoList.size());
|
||||
return Single.just(new ServiceResult<List<MusicInfo>>()
|
||||
.setCode(result.getCode())
|
||||
.setMessage(result.getMessage())
|
||||
.setData(musicInfoList));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,541 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||
import com.mango.moshen.ui.utils.ImageLoadUtils;
|
||||
import com.mango.moshen.utils.UserUtils;
|
||||
import com.mango.core.bean.RoomQueueInfo;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.manager.IMNetEaseManager;
|
||||
import com.mango.core.manager.AudioEngineManager;
|
||||
import com.mango.core.room.ktv.bean.MusicInfo;
|
||||
import com.mango.core.room.ktv.event.KtvEvent;
|
||||
import com.mango.core.room.ktv.event.RemoteVideoEvent;
|
||||
import com.mango.core.statistic.StatisticManager;
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.mango.core.super_admin.SaConstant;
|
||||
import com.mango.core.super_admin.util.SuperAdminUtil;
|
||||
import com.mango.xchat_android_library.rxbus.RxBus;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.agora.ktvkit.VideoPlayerView;
|
||||
import io.agora.rtc.RtcEngine;
|
||||
import io.agora.rtc.video.VideoCanvas;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
import static com.mango.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_KTV_CLOSE;
|
||||
|
||||
public class KtvView extends CardView {
|
||||
|
||||
private Context context;
|
||||
public static final int KTV_ROOM_OWNER = 1;//房主
|
||||
public static final int KTV_ROOM_MANAGER = 2;//管理员
|
||||
public static final int KTV_ROOM_MV_BROADCASTER = 3;//mv主播
|
||||
public static final int KTV_ROOM_AUDIENCE = 4;//观众
|
||||
|
||||
@Nullable
|
||||
private View statusView;
|
||||
private CompositeDisposable disposables;
|
||||
private FrameLayout playContainer;
|
||||
private FrameLayout statusContainer;
|
||||
private VideoPlayerView xPlay;
|
||||
private boolean isShowNoSong;
|
||||
public static boolean isShowPrepare;
|
||||
private Disposable tipDisposable;
|
||||
private Disposable prepareDisposable;
|
||||
|
||||
public KtvView(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public KtvView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
this.context = context;
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
inflate(context, R.layout.layout_ktv_view, this);
|
||||
setRadius(ScreenUtil.dip2px(10));
|
||||
disposables = new CompositeDisposable();
|
||||
playContainer = findViewById(R.id.play_container);
|
||||
statusContainer = findViewById(R.id.status_container);
|
||||
this.setOnClickListener(listener);
|
||||
playContainer.setOnClickListener(listener);
|
||||
statusContainer.setOnClickListener(listener);
|
||||
showXPlay(AudioEngineManager.get().isPush());
|
||||
if (!AudioEngineManager.get().isLive() || KtvMusicManager.INSTANCE.getMusicList().size() == 0) {
|
||||
statusView = showNoSong();
|
||||
} else if (!AudioEngineManager.get().isPush()) {
|
||||
setupRemoteVideo(AudioEngineManager.get().getRemoteUid());
|
||||
}
|
||||
subscribeEvent();
|
||||
}
|
||||
|
||||
private Runnable runnable = this::resetStatusView;
|
||||
private OnClickListener listener = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (statusView != null) {
|
||||
resetStatusView();
|
||||
return;
|
||||
}
|
||||
statusView = getUserType() == KTV_ROOM_AUDIENCE ? showChooseSong() : showCommand();
|
||||
}
|
||||
};
|
||||
|
||||
private void subscribeEvent() {
|
||||
Disposable disposable1 = RxBus.get().toFlowable(RemoteVideoEvent.class)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(remoteVideoEvent -> setupRemoteVideo(remoteVideoEvent.getUid()));
|
||||
Disposable disposable2 = RxBus.get().toFlowable(KtvEvent.class)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::handleKtvEvent);
|
||||
disposables.addAll(disposable1, disposable2);
|
||||
}
|
||||
|
||||
|
||||
//处理KTV相关的各种事件
|
||||
private void handleKtvEvent(KtvEvent ktvEvent) {
|
||||
MusicInfo musicInfo = ktvEvent.getMusicInfo();
|
||||
switch (ktvEvent.getType()) {
|
||||
case KtvEvent.SWITCH_MUSIC:
|
||||
if (musicInfo != null) {
|
||||
statusView = showPrepare(musicInfo);
|
||||
}
|
||||
break;
|
||||
case KtvEvent.STOP:
|
||||
if (AudioEngineManager.get().isPush() && AudioEngineManager.get().isPlaying()) {
|
||||
AudioEngineManager.get().playOrPause();
|
||||
}
|
||||
break;
|
||||
case KtvEvent.CONTINUE:
|
||||
if (AudioEngineManager.get().isPush() && !AudioEngineManager.get().isPlaying()) {
|
||||
AudioEngineManager.get().playOrPause();
|
||||
}
|
||||
break;
|
||||
case KtvEvent.NO_MUSIC:
|
||||
statusView = showNoSong();
|
||||
break;
|
||||
case KtvEvent.MUSIC_UPDATE:
|
||||
if (KtvMusicManager.INSTANCE.getMusicList().size() > 0 && isShowNoSong) {
|
||||
resetStatusView();
|
||||
}
|
||||
if (KtvMusicManager.INSTANCE.getMusicList().size() == 0 && !isShowNoSong) {
|
||||
statusView = showNoSong();
|
||||
}
|
||||
break;
|
||||
case KtvEvent.ROOM_USER_MANAGER_STATUS:
|
||||
if (btnCloseNoSong != null) {
|
||||
initCloseBtn(btnCloseNoSong);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public synchronized void setupRemoteVideo(int uid) {
|
||||
if (UserUtils.getUserUid() == uid || AudioEngineManager.get().isPush()) return;
|
||||
if (!isShowPrepare) resetStatusView();
|
||||
playContainer.removeAllViews();
|
||||
SurfaceView surfaceView = RtcEngine.CreateRendererView(context.getApplicationContext());
|
||||
playContainer.addView(surfaceView);
|
||||
AudioEngineManager.get().setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_ADAPTIVE, uid), uid);
|
||||
}
|
||||
|
||||
|
||||
static class NoSongViewHolder {
|
||||
@BindView(R.id.tv_no_user)
|
||||
TextView tvNoUser;
|
||||
@BindView(R.id.tv_tips)
|
||||
TextView tvTips;
|
||||
@BindView(R.id.tv_choose_song)
|
||||
SuperTextView tvChooseSong;
|
||||
@BindView(R.id.ib_close)
|
||||
ImageButton ibClose;
|
||||
|
||||
NoSongViewHolder(View view) {
|
||||
ButterKnife.bind(this, view);
|
||||
}
|
||||
}
|
||||
|
||||
private String[] tips = new String[]{
|
||||
"点击“我要点歌”按钮可进行点歌哦~",
|
||||
"建议唱歌的用户上麦点歌,以免有声音延迟",
|
||||
"演唱时,佩戴耳机效果更佳哦~",
|
||||
"耳机离嘴唇一定距离可防止喷麦",
|
||||
"演唱时试试由腹部发声,会有意外收获"};
|
||||
|
||||
/**
|
||||
* 无人唱歌界面的关闭按钮
|
||||
*/
|
||||
private ImageButton btnCloseNoSong;
|
||||
|
||||
private View showNoSong() {
|
||||
isShowNoSong = true;
|
||||
isShowPrepare = false;
|
||||
playContainer.removeCallbacks(runnable);
|
||||
View view = inflate(context, R.layout.layout_ktv_no_song, null);
|
||||
NoSongViewHolder holder = new NoSongViewHolder(view);
|
||||
view.setOnClickListener(v -> {
|
||||
//吃掉父view点击事件
|
||||
});
|
||||
Logger.i("显示无人唱歌的ui");
|
||||
btnCloseNoSong = holder.ibClose;
|
||||
initCloseBtn(holder.ibClose);
|
||||
if (tipDisposable != null) tipDisposable.dispose();
|
||||
tipDisposable = Observable.interval(0, 5, TimeUnit.SECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> holder.tvTips.setText(tips[(int) (aLong % tips.length)]));
|
||||
holder.tvChooseSong.setOnClickListener(v -> KtvSelectSongActivity.start(context, true));
|
||||
showStatusView(view);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
static class CommandViewHolder {
|
||||
@BindView(R.id.ib_close)
|
||||
ImageButton ibClose;
|
||||
@BindView(R.id.tv_change_audio)
|
||||
SuperTextView tvChangeAudio;
|
||||
@BindView(R.id.tv_song_name)
|
||||
TextView tvSongName;
|
||||
@BindView(R.id.tv_commit_err)
|
||||
TextView tvCommitErr;
|
||||
@BindView(R.id.iv_play_or_pause)
|
||||
ImageView ivPlayOrPause;
|
||||
|
||||
@BindView(R.id.iv_switch_song)
|
||||
ImageView ivSwitchSong;
|
||||
@BindView(R.id.sb_person_voice)
|
||||
SeekBar sbPersonVoice;
|
||||
@BindView(R.id.sb_accompany_voice)
|
||||
SeekBar sbAccompanyVoice;
|
||||
@BindView(R.id.sb_song_current_position)
|
||||
SeekBar sbSongCurrentPosition;
|
||||
@BindView(R.id.group_seek_bar)
|
||||
Group group;
|
||||
@BindView(R.id.tv_surplus_time)
|
||||
TextView tvSurplusTime;
|
||||
CommandViewHolder(View view) {
|
||||
ButterKnife.bind(this, view);
|
||||
}
|
||||
}
|
||||
|
||||
private View commandView;
|
||||
|
||||
private Disposable commandDisposable;
|
||||
|
||||
private View showCommand() {
|
||||
playContainer.postDelayed(runnable, 3000);
|
||||
if (commandView == null) {
|
||||
commandView = inflate(context, R.layout.layout_ktv_command, null);
|
||||
}
|
||||
CommandViewHolder holder = new CommandViewHolder(commandView);
|
||||
if (getUserType() != KTV_ROOM_MV_BROADCASTER) {
|
||||
holder.group.setVisibility(GONE);
|
||||
} else {
|
||||
holder.group.setVisibility(VISIBLE);
|
||||
}
|
||||
holder.tvSongName.setText(KtvMusicManager.INSTANCE.getCurrMusic().getMusicName());
|
||||
initPlayBtn(holder);
|
||||
initCloseBtn(holder.ibClose);
|
||||
initChangeAudioBtn(holder.tvChangeAudio);
|
||||
holder.tvChangeAudio.setOnClickListener(v -> {
|
||||
AudioEngineManager.get().changeAudioStream();
|
||||
initChangeAudioBtn(holder.tvChangeAudio);
|
||||
resetStatusView();
|
||||
});
|
||||
holder.tvCommitErr.setOnClickListener(v ->
|
||||
KtvCommitErrorDialog.newInstance(context, KtvMusicManager.INSTANCE.getCurrMusic().getMusicId()).show());
|
||||
holder.ivPlayOrPause.setOnClickListener(v -> {
|
||||
if (AudioEngineManager.get().isPush()) {
|
||||
AudioEngineManager.get().playOrPause();
|
||||
}
|
||||
/* else { //暂时不需要
|
||||
KtvHelper.sendChatRoomMusicMessage(
|
||||
AudioEngineManager.get().isPlaying() ? CUSTOM_MSG_SUB_KTV_STOP : CUSTOM_MSG_SUB_KTV_CONTINUE,
|
||||
null)
|
||||
.subscribe();
|
||||
}*/
|
||||
initPlayBtn(holder);
|
||||
resetStatusView();
|
||||
});
|
||||
holder.ivSwitchSong.setOnClickListener(v -> {
|
||||
KtvMusicManager.INSTANCE.switchSong(true);
|
||||
resetStatusView();
|
||||
});
|
||||
holder.sbAccompanyVoice.setProgress((int) (AudioEngineManager.get().getAccompanyVoice()*100));
|
||||
holder.sbAccompanyVoice.setOnSeekBarChangeListener(
|
||||
(LambdaOnSeekBarChangeListener) (seekBar, progress, fromUser) ->
|
||||
AudioEngineManager.get().setAccompanyVoice(progress/100d));
|
||||
holder.sbPersonVoice.setProgress((int) (AudioEngineManager.get().getPersonVoice()*100));
|
||||
holder.sbPersonVoice.setOnSeekBarChangeListener(
|
||||
(LambdaOnSeekBarChangeListener) (seekBar, progress, fromUser) ->
|
||||
AudioEngineManager.get().setPersonVoice(progress/100d));
|
||||
releaseCommandDisposable();
|
||||
commandDisposable = Observable.interval(0, 1, TimeUnit.SECONDS, AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> setSeekDuration(holder));
|
||||
showStatusView(commandView);
|
||||
return commandView;
|
||||
}
|
||||
|
||||
private void releaseCommandDisposable() {
|
||||
if (commandDisposable != null && !commandDisposable.isDisposed()) {
|
||||
commandDisposable.dispose();
|
||||
commandDisposable = null;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private void setSeekDuration(CommandViewHolder holder) {
|
||||
double pos = AudioEngineManager.get().getPlayPos();
|
||||
holder.sbSongCurrentPosition.setProgress((int) (100 * pos));
|
||||
//禁止点击
|
||||
holder.sbSongCurrentPosition.setClickable(false);
|
||||
holder.sbSongCurrentPosition.setOnTouchListener(new OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
int duration = AudioEngineManager.get().getPlayDuration() / 1000;//单位秒
|
||||
duration = (int) (duration - duration * pos);//剩余的时间
|
||||
if (duration < 0) {
|
||||
duration = 0;
|
||||
}
|
||||
int min = duration / 60;
|
||||
int sec = duration % 60;
|
||||
String secStr = String.valueOf(sec);
|
||||
if (sec < 10) {
|
||||
secStr = "0" + secStr;
|
||||
}
|
||||
holder.tvSurplusTime.setText("-" + min + ":" + secStr);
|
||||
}
|
||||
|
||||
private void initPlayBtn(CommandViewHolder holder) {
|
||||
if (AudioEngineManager.get().isPlaying()) {
|
||||
holder.ivPlayOrPause.setImageResource(R.drawable.icon_ktv_pause);
|
||||
} else {
|
||||
holder.ivPlayOrPause.setImageResource(R.drawable.icon_ktv_play);
|
||||
}
|
||||
}
|
||||
|
||||
private void initChangeAudioBtn(SuperTextView textView) {
|
||||
if (!AudioEngineManager.get().isAccompany()) {
|
||||
textView.setTextColor(getResources().getColor(R.color.color_CCFF5B69));
|
||||
textView.setText("原唱");
|
||||
} else {
|
||||
textView.setTextColor(getResources().getColor(R.color.white_transparent_60));
|
||||
textView.setText("伴奏");
|
||||
}
|
||||
}
|
||||
|
||||
static class PrepareViewHolder {
|
||||
@BindView(R.id.ib_close)
|
||||
ImageButton ibClose;
|
||||
@BindView(R.id.iv_avatar)
|
||||
ImageView ivAvatar;
|
||||
@BindView(R.id.tv_no_user)
|
||||
TextView tvNoUser;
|
||||
@BindView(R.id.tv_song_name)
|
||||
TextView tvSongName;
|
||||
@BindView(R.id.tv_tips)
|
||||
SuperTextView tvTips;
|
||||
@BindView(R.id.iv_singer_avatar_bg)
|
||||
ImageView ivSingerAvatarBg;
|
||||
|
||||
PrepareViewHolder(View view) {
|
||||
ButterKnife.bind(this, view);
|
||||
}
|
||||
}
|
||||
|
||||
private View showPrepare(MusicInfo musicInfo) {
|
||||
isShowPrepare = true;
|
||||
isShowNoSong = false;
|
||||
View view = inflate(context, R.layout.layout_ktv_prepare, null);
|
||||
view.setOnClickListener(v -> {
|
||||
//吃掉父view点击事件
|
||||
});
|
||||
PrepareViewHolder holder = new PrepareViewHolder(view);
|
||||
RoomQueueInfo roomQueueInfo = AvRoomDataManager.get().getRoomQueueMemberInfoByAccount(String.valueOf(musicInfo.getUid()));
|
||||
if (roomQueueInfo != null && roomQueueInfo.mChatRoomMember != null) {
|
||||
ImageLoadUtils.loadAvatar(context, roomQueueInfo.mChatRoomMember.getAvatar(), holder.ivAvatar);
|
||||
ImageLoadUtils.loadImageWithBlur(context,
|
||||
roomQueueInfo.mChatRoomMember.getAvatar(), holder.ivSingerAvatarBg, 24, 10);
|
||||
}
|
||||
holder.tvNoUser.setText(musicInfo.getUserNick() + " 请准备");
|
||||
initCloseBtn(holder.ibClose);
|
||||
if (prepareDisposable != null) prepareDisposable.dispose();
|
||||
|
||||
boolean isPushUser = UserUtils.getUserUid() == musicInfo.getUid();
|
||||
showXPlay(isPushUser);
|
||||
Observable.intervalRange(0, 4, 0, 1, TimeUnit.SECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Long>() {
|
||||
@Override
|
||||
public void onNext(Long aLong) {
|
||||
holder.tvSongName.setText((3 - aLong) + "秒后开始演唱: " + musicInfo.getMusicName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
//准备中下麦处理
|
||||
if (isShowPrepare) {
|
||||
resetStatusView();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
prepareDisposable = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
showStatusView(view);
|
||||
return view;
|
||||
}
|
||||
|
||||
static class ChooseSongViewHolder {
|
||||
@BindView(R.id.tv_tips)
|
||||
TextView tvTips;
|
||||
@BindView(R.id.tv_choose_song)
|
||||
SuperTextView tvChooseSong;
|
||||
|
||||
ChooseSongViewHolder(View view) {
|
||||
ButterKnife.bind(this, view);
|
||||
}
|
||||
}
|
||||
|
||||
private View showChooseSong() {
|
||||
playContainer.postDelayed(runnable, 3000);
|
||||
View view = inflate(context, R.layout.layout_ktv_choose_song, null);
|
||||
ChooseSongViewHolder holder = new ChooseSongViewHolder(view);
|
||||
holder.tvTips.setText(KtvMusicManager.INSTANCE.getCurrMusic().getMusicName());
|
||||
holder.tvChooseSong.setOnClickListener(v -> KtvSelectSongActivity.start(context, true));
|
||||
showStatusView(view);
|
||||
return view;
|
||||
}
|
||||
|
||||
private void showStatusView(View view) {
|
||||
statusContainer.setVisibility(VISIBLE);
|
||||
statusContainer.removeAllViews();
|
||||
statusContainer.addView(view);
|
||||
}
|
||||
|
||||
private void resetStatusView() {
|
||||
if (statusView != null) {
|
||||
isShowNoSong = false;
|
||||
isShowPrepare = false;
|
||||
playContainer.removeCallbacks(runnable);
|
||||
statusContainer.setVisibility(GONE);
|
||||
statusView = null;
|
||||
}
|
||||
btnCloseNoSong = null;
|
||||
releaseCommandDisposable();
|
||||
}
|
||||
|
||||
private int getUserType() {
|
||||
MusicInfo currMusic = KtvMusicManager.INSTANCE.getCurrMusic();
|
||||
if (currMusic.getUid() == UserUtils.getUserUid()) {
|
||||
return KTV_ROOM_MV_BROADCASTER;
|
||||
}
|
||||
if (AvRoomDataManager.get().isRoomOwner()) {
|
||||
return KTV_ROOM_OWNER;
|
||||
}
|
||||
if (AvRoomDataManager.get().isRoomAdmin()) {
|
||||
return KTV_ROOM_MANAGER;
|
||||
}
|
||||
return KTV_ROOM_AUDIENCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果是房主或管理员,显示关闭ktv的按钮
|
||||
*
|
||||
* @param button 关闭ktv的按钮
|
||||
*/
|
||||
|
||||
private void initCloseBtn(ImageButton button) {
|
||||
if (AvRoomDataManager.get().isManager()) {
|
||||
button.setVisibility(VISIBLE);
|
||||
button.setOnClickListener(v -> {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
SingleToastUtil.showToast(SaConstant.TOAST_ERROR_TIPS);
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.roomcp_ktv_close_click, "关闭KTV");
|
||||
}
|
||||
new DialogManager(context).showOkCancelWithTitleDialog("关闭KTV后,所有歌曲将被删除!",
|
||||
() -> {
|
||||
RxBus.get().post(new KtvEvent(KtvEvent.CLOSE_KTV_MODEL));
|
||||
KtvHelper.sendChatRoomMusicMessage(CUSTOM_MSG_SUB_KTV_CLOSE, new MusicInfo())
|
||||
.subscribe(chatRoomMessage -> IMNetEaseManager.get().addMessages(chatRoomMessage));
|
||||
});
|
||||
});
|
||||
|
||||
} else {
|
||||
button.setVisibility(INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
if (disposables != null) disposables.dispose();
|
||||
if (tipDisposable != null) tipDisposable.dispose();
|
||||
if (prepareDisposable != null) prepareDisposable.dispose();
|
||||
}
|
||||
|
||||
private void showXPlay(boolean isShow) {
|
||||
/*if (isShow && AudioEngineManager.get().getKtvKit()!=null) {
|
||||
playContainer.removeAllViews();
|
||||
xPlay = new VideoPlayerView(context, AudioEngineManager.get().getKtvKit());
|
||||
xPlay.setZOrderMediaOverlay(true);
|
||||
playContainer.addView(xPlay);
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
public void updateCloseBtnNoSong() {
|
||||
if (btnCloseNoSong != null) {
|
||||
initCloseBtn(btnCloseNoSong);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
package com.mango.moshen.avroom.ktv;
|
||||
|
||||
import android.widget.SeekBar;
|
||||
|
||||
public interface LambdaOnSeekBarChangeListener extends SeekBar.OnSeekBarChangeListener {
|
||||
@Override
|
||||
default void onStartTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
|
||||
@Override
|
||||
default void onStopTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
}
|
@@ -70,7 +70,6 @@ import com.mango.moshen.avroom.ButtonItemFactory;
|
||||
import com.mango.moshen.avroom.activity.AVRoomActivity;
|
||||
import com.mango.moshen.avroom.adapter.UpMicAdapter;
|
||||
import com.mango.moshen.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.mango.moshen.avroom.ktv.KtvMusicManager;
|
||||
import com.mango.moshen.avroom.widget.ViewItem;
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||
import com.mango.moshen.ui.user.UserInfoActivity;
|
||||
@@ -1108,14 +1107,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
return;
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo.isOpenKTV()) {
|
||||
new DialogManager(context).showOkCancelDialog("KTV模式下下麦会移除您已点的所有歌曲,确定进行此操作?", false,
|
||||
() -> {
|
||||
handleDownMicro();
|
||||
KtvMusicManager.INSTANCE.deleteUserAllChooseMusic().subscribe();
|
||||
}
|
||||
);
|
||||
} else if (AvRoomDataManager.get().haveStartDragon) {
|
||||
if (AvRoomDataManager.get().haveStartDragon) {
|
||||
new DialogManager(context).showOkCancelDialog("你正在交友匹配中,此操作代表你放弃本局匹配展示,确定进行此操作?", false, new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.mango.moshen.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <android.support.design.widget.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar" />-->
|
||||
<com.mango.moshen.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/view_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
android:background="@color/white"/>
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_indicator"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@@ -1,179 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.mango.moshen.base.BaseMsListViewModel" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.mango.moshen.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="62dp"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/shape_f0f0f0_corner">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_search"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:drawableLeft="@drawable/ic_ktv_search"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:hint="输入歌名/歌手名"
|
||||
android:maxLength="10"
|
||||
android:maxLines="1"
|
||||
android:textCursorDrawable="@null"
|
||||
android:onClick="@{click}"
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textColorHint="@color/color_999999"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ib_clear_edt"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@null"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_ktv_clear" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_search"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:text="搜索"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:background="@color/line_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px" />
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_history"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="46dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="历史搜索"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_clear_history"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_ktv_clear_history"
|
||||
android:scaleType="fitCenter"
|
||||
android:padding="@dimen/dp_14"
|
||||
android:layout_width="49dp"
|
||||
android:layout_height="46dp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/fbl_history"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
app:alignContent="flex_start"
|
||||
app:flexWrap="wrap" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.mango.moshen.common.widget.StatusLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:refreshing="@{viewModel.loading}">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
date="@{viewModel.data}"
|
||||
error="@{viewModel.throwable}"
|
||||
isLode="@{viewModel.isLode}"
|
||||
newData="@{viewModel.loadData}"
|
||||
pageSize="@{viewModel.pageSize}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</com.mango.moshen.common.widget.StatusLayout>
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_song_count"
|
||||
android:text="已点0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginBottom="@dimen/dp_50"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
app:corner="100dp"
|
||||
app:solid="@color/color_FF5B69" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
@@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.mango.moshen.base.BaseMsListViewModel" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
</data>
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:background="@color/white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.mango.moshen.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/container_search"
|
||||
android:onClick="@{click}"
|
||||
android:background="@drawable/shape_f0f0f0_corner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:drawableLeft="@drawable/ic_ktv_search"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:text="输入歌名/歌手名"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/line_color" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:text="热门歌曲"
|
||||
android:drawableStart="@drawable/icon_ktv_hot_songs"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:refreshing="@{viewModel.loading}">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
date="@{viewModel.data}"
|
||||
error="@{viewModel.throwable}"
|
||||
isLode="@{viewModel.isLode}"
|
||||
newData="@{viewModel.loadData}"
|
||||
pageSize="@{viewModel.pageSize}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/stv_ktv_song"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="49dp"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:text="已点0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:corner="@dimen/dp_15"
|
||||
app:solid="@color/color_FF5B69"
|
||||
android:layout_gravity="bottom|right"
|
||||
/>
|
||||
</FrameLayout>
|
||||
</layout>
|
@@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.mango.moshen.avroom.ktv.KtvSongListVm" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:background="@color/white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.mango.moshen.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</com.mango.moshen.base.TitleBar>
|
||||
|
||||
<View
|
||||
android:background="@color/block_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_10" />
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:refreshing="@{viewModel.loading}">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
date="@{viewModel.data}"
|
||||
error="@{viewModel.throwable}"
|
||||
isLode="@{viewModel.isLode}"
|
||||
newData="@{viewModel.loadData}"
|
||||
pageSize="@{viewModel.pageSize}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</layout>
|
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
|
||||
<data>
|
||||
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:cardElevation="0dp"
|
||||
app:cardCornerRadius="@dimen/dp_8">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:text="歌曲报错"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_errs"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_sure"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:text="提交"
|
||||
app:corner="@dimen/dp_50"
|
||||
app:solid="@color/color_FFC4A7"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
@@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="musicInfo"
|
||||
type="com.mango.core.room.ktv.bean.MusicInfo" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<import type="com.mango.moshen.R.string" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="295dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="@dimen/dp_8">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:text="@{musicInfo.musicName}"
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="@dimen/sp_17"
|
||||
tools:text="往后余生" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{musicInfo.singer}"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="马良" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_uploader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:corner="100dp"
|
||||
app:solid="@color/color_f5f5f5"
|
||||
tools:text="感谢上传" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_25">
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:text="取消"
|
||||
android:textColor="@color/appColor"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:corner="100dp"
|
||||
app:solid="@color/color_f0f0f0" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_sure"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:text="点歌"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:corner="100dp"
|
||||
app:solid="@color/appColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
@@ -1,130 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/owner_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center"
|
||||
android:visibility="visible">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/micro_layout"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="73dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:background="#000">
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/iv_halo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<com.mango.moshen.common.widget.CircleImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
tools:background="#5F0F"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/up_image"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_room_up_micro"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/lock_image"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_room_lock_micro"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp">
|
||||
<ImageView
|
||||
android:id="@+id/mute_image"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@drawable/icon_room_mute_micro"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible" />
|
||||
<ImageView
|
||||
android:id="@+id/iv_singer"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:src="@drawable/icon_ktv_singer"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_14" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:src="@drawable/ic_room_leave"
|
||||
android:visibility="gone" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pk_mark"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="53dp"
|
||||
android:background="@drawable/shape_pk_mic_queue_mark_red"
|
||||
android:gravity="center"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="3dp"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="9dp"
|
||||
tools:text="红队"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nick"
|
||||
android:layout_below="@id/micro_layout"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="14dp"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:maxEms="6"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
tools:text="狐仙嘎嘎"
|
||||
tools:textColor="@color/white" />
|
||||
|
||||
</RelativeLayout>
|
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:text="歌词有错"
|
||||
android:background="@drawable/layer_list_bottom_gray_line"
|
||||
android:textColor="@color/color_333333"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:drawableEnd="@drawable/selector_mv_error"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:gravity="center_vertical">
|
||||
</TextView>
|
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<com.coorchice.library.SuperTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="28dp"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:text="最不好"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:corner="15dp"
|
||||
app:solid="@color/color_f5f5f5" />
|
||||
|
@@ -1,90 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mango.moshen.ui.widget.RectLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
app:hw_ratio="0.32">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/ktv_room_bg_1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="17dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sing_song"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="正在唱:最长的电影"
|
||||
android:lines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="9dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="地表最强演唱会地表最强演唱会地表最强演唱会地表最强演唱会地表最强演唱会"
|
||||
android:lines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_lock"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_room_lock"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_member_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="21dp"
|
||||
android:background="@drawable/shape_white_solid_round"
|
||||
android:paddingBottom="3dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingTop="3dp"
|
||||
android:text="100在线"
|
||||
android:textColor="#FF7E7E"
|
||||
android:textSize="11sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.mango.moshen.common.widget.CircleImageView
|
||||
android:id="@+id/civ_avatar"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_marginRight="17dp"
|
||||
android:src="@mipmap/app_logo"
|
||||
app:cborder_color="@color/color_40FFFFFF"
|
||||
app:cborder_width="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.mango.moshen.ui.widget.RectLayout>
|
@@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:layout_height="198dp"
|
||||
android:background="@color/black_transparent_60">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:text="我们不一样!"
|
||||
android:textColor="#80ffffff"
|
||||
android:textSize="13sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_choose_song"
|
||||
android:layout_width="138dp"
|
||||
android:layout_height="39dp"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:text="我要点歌"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
app:corner="@dimen/dp_20"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:solid="@color/white_transparent_20" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -1,209 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/black_transparent_60"
|
||||
tools:layout_height="198dp">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ib_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/ic_ktv_close"
|
||||
android:scaleType="fitCenter"
|
||||
android:padding="@dimen/dp_10"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_change_audio"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="25dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:gravity="center"
|
||||
android:text="原唱"
|
||||
android:textColor="@color/color_CCFF5B69"
|
||||
android:textSize="12sp"
|
||||
app:corner="@dimen/dp_15"
|
||||
app:solid="@color/white_transparent_15" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_song_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginStart="110dp"
|
||||
android:layout_marginEnd="110dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="我们不啊啊啊啊啊啊啊一样!"
|
||||
android:textColor="#99ffffff"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_switch_song"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="100dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@drawable/icon_ktv_swich_song"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play_or_pause"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_switch_song"
|
||||
app:layout_constraintRight_toLeftOf="@id/iv_switch_song"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:src="@drawable/icon_ktv_play" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_people_sound"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_switch_song"
|
||||
app:layout_constraintRight_toLeftOf="@id/iv_play_or_pause"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
app:cardCornerRadius="12.5dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardBackgroundColor="@color/white_transparent_15"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="25dp">
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_person_voice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/cv_people_sound"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cv_people_sound"
|
||||
app:layout_constraintStart_toStartOf="@id/cv_people_sound"
|
||||
android:gravity="center"
|
||||
android:text="人声"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="#99FEFEFE"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sb_person_voice"
|
||||
app:layout_constraintTop_toTopOf="@id/cv_people_sound"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cv_people_sound"
|
||||
app:layout_constraintStart_toStartOf="@id/cv_people_sound"
|
||||
app:layout_constraintEnd_toEndOf="@id/cv_people_sound"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:theme="@style/SeekBarStyle"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="35dp" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_accompany_sound"
|
||||
app:layout_constraintTop_toBottomOf="@id/cv_people_sound"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_toStartOf="@id/iv_play_or_pause"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cv_people_sound"
|
||||
app:layout_constraintRight_toRightOf="@id/cv_people_sound"
|
||||
app:cardCornerRadius="12.5dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardBackgroundColor="@color/white_transparent_15"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="25dp">
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_accompany_voice"
|
||||
app:layout_constraintStart_toStartOf="@id/cv_accompany_sound"
|
||||
app:layout_constraintTop_toTopOf="@id/cv_accompany_sound"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cv_accompany_sound"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="伴奏"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="#99FEFEFE"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sb_accompany_voice"
|
||||
app:layout_constraintStart_toStartOf="@id/cv_accompany_sound"
|
||||
app:layout_constraintEnd_toEndOf="@id/cv_accompany_sound"
|
||||
app:layout_constraintTop_toTopOf="@id/cv_accompany_sound"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cv_accompany_sound"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:theme="@style/SeekBarStyle"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="35dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_song_progress"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_switch_song"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp">
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sb_song_current_position"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:max="100"
|
||||
android:theme="@style/SeekNoBarStyle"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:thumb="@null" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_surplus_time"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="@color/color_FEFEFE"
|
||||
tools:text="-0:00"
|
||||
android:layout_marginEnd="15dp"
|
||||
tools:contentDescription="剩余时间" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_commit_err"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/icon_ktv_mv_report_error"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
app:layout_constraintRight_toLeftOf="@id/ib_close"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_seek_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="sb_accompany_voice,tv_accompany_voice,sb_person_voice,tv_person_voice,tv_change_audio,iv_play_or_pause,cv_people_sound,cv_accompany_sound,layout_song_progress" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:layout_height="198dp"
|
||||
android:background="@drawable/ktv_video_bg">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ib_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/ic_ktv_close"
|
||||
android:scaleType="fitCenter"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_no_user"
|
||||
android:layout_marginTop="42dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="当前无人点歌"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tips"
|
||||
android:layout_below="@id/tv_no_user"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:text="演唱时佩戴耳机效果更佳喔!"
|
||||
android:textColor="@color/white_transparent_80"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_choose_song"
|
||||
android:layout_below="@id/tv_tips"
|
||||
android:layout_width="138dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:text="我要点歌"
|
||||
android:textColor="@color/color_FF5B69"
|
||||
android:textSize="15sp"
|
||||
android:layout_centerHorizontal="true"
|
||||
app:corner="@dimen/dp_20"
|
||||
app:solid="@color/white" />
|
||||
|
||||
</RelativeLayout>
|
@@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:layout_height="198dp"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_singer_avatar_bg"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ktv_video_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<com.coorchice.library.SuperTextView
|
||||
app:corner="@dimen/dp_8"
|
||||
app:solid="#801A1A1A"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<ImageButton
|
||||
android:id="@+id/ib_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/ic_ktv_close"
|
||||
android:scaleType="fitCenter"
|
||||
android:padding="@dimen/dp_10"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_container"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@drawable/icon_ktv_avatar_bg"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="69dp"
|
||||
android:layout_height="69dp">
|
||||
|
||||
<com.mango.moshen.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_no_user"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:text="某某请准备"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/avatar_container" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_song_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:text="3秒后开始演唱:我们不一样!"
|
||||
android:textColor="@color/white_transparent_80"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_no_user" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:text="演唱时佩戴耳机效果更佳喔!"
|
||||
android:textColor="@color/white_transparent_80"
|
||||
android:textSize="12sp"
|
||||
app:corner="@dimen/dp_20"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_song_name"
|
||||
app:solid="@color/white_transparent_15" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:layout_height="198dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/play_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/ktv_video_bg" />
|
||||
<FrameLayout
|
||||
android:id="@+id/status_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</FrameLayout>
|
@@ -1,151 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/micro_layout"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
tools:background="#000">
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/iv_halo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<com.mango.moshen.common.widget.CircleImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
tools:background="#5F0F"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/up_image"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_room_up_micro" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/lock_image"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_room_lock_micro"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head_wear"
|
||||
tools:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="1.5dp"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp">
|
||||
<ImageView
|
||||
android:id="@+id/mute_image"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@drawable/icon_room_mute_micro"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible" />
|
||||
<ImageView
|
||||
android:id="@+id/iv_singer"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:src="@drawable/icon_ktv_singer"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_14" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pk_mark"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="48dp"
|
||||
android:background="@drawable/shape_pk_mic_queue_mark_red"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="9dp"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="3dp"
|
||||
tools:text="红队"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_below="@id/micro_layout"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:background="@drawable/icon_bg_number_default"
|
||||
android:gravity="center|center_vertical"
|
||||
android:textSize="10sp"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
tools:text="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="14dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
tools:text="狐仙嘎嘎"
|
||||
tools:textColor="@color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/nick"-->
|
||||
<!--android:layout_height="14dp"-->
|
||||
<!--android:layout_width="55dp"-->
|
||||
<!--android:paddingStart="@dimen/dp_3"-->
|
||||
<!--android:paddingEnd="@dimen/dp_3"-->
|
||||
<!--android:ellipsize="end"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:maxLines="1"-->
|
||||
<!--android:singleLine="true"-->
|
||||
<!--android:textColor="@color/white"-->
|
||||
<!--android:textSize="10sp"-->
|
||||
<!--tools:text="狐仙嘎嘎"-->
|
||||
<!--tools:textColor="@color/white" />-->
|
||||
|
||||
</RelativeLayout>
|
@@ -1,84 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="ktvRoomInfo"
|
||||
type="com.mango.core.room.ktv.bean.KtvRoomInfo" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="android.text.TextUtils" />
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_5"
|
||||
android:background="@drawable/shape_stroke_e6e6e6_5radius_white"
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_10">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_song_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:background="@drawable/ktv_music_name_bg"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:paddingLeft="@dimen/dp_5"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingTop="@dimen/dp_5"
|
||||
android:text="@{TextUtils.isEmpty(ktvRoomInfo.singingMusicName)?@string/ktv_no_song:(@string/ktv_singing + ktvRoomInfo.singingMusicName)}"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
avatarUrl="@{ktvRoomInfo.avatar}"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:src="@drawable/ic_ktv_tag" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:text="@{ktvRoomInfo.title}"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_person_mum"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:text="@{ktvRoomInfo.onlineNum+ @string/person}"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@@ -1,109 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="musicInfo"
|
||||
type="com.mango.core.room.ktv.bean.MusicInfo" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
imgUrl="@{musicInfo.cover}"
|
||||
isRound="@{true}" />
|
||||
<TextView
|
||||
android:id="@+id/tv_song_name"
|
||||
android:layout_toEndOf="@id/iv_avatar"
|
||||
android:maxWidth="130dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{musicInfo.musicName}"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_15"
|
||||
tools:text="hahahahhaahahahahahahahahadddd" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_distance"
|
||||
android:layout_toEndOf="@id/tv_song_name"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="-"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:layout_toEndOf="@id/tv_distance"
|
||||
android:layout_centerVertical="true"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:maxWidth="@dimen/dp_60"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:text="@{musicInfo.singer}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="周杰伦djjdjd" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_song_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:text="@{musicInfo.durationFormat}"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:text="062933" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/stv_select"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:text="点歌"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:textColor="@color/color_FF5B69"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:corner="50dp"
|
||||
app:stroke_color="@color/color_FF5B69"
|
||||
app:stroke_width="1dp" />
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginStart="71dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="#ffe5e5e5"
|
||||
android:layout_alignParentBottom="true" />
|
||||
</RelativeLayout>
|
||||
</layout>
|
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="musicInfo"
|
||||
type="com.mango.core.room.ktv.bean.MusicInfo" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="83dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
ktvRoundCover="@{musicInfo.cover}"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_width="112dp"
|
||||
android:layout_height="63dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_song_name"
|
||||
android:layout_toEndOf="@id/iv_cover"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{musicInfo.musicName}"
|
||||
android:textColor="#ff333333"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_16"
|
||||
tools:text="往后余生" />
|
||||
<TextView
|
||||
android:layout_below="@id/tv_song_name"
|
||||
android:layout_alignStart="@id/tv_song_name"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{musicInfo.singer}"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
tools:text="马良" />
|
||||
|
||||
<View
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="139dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@color/line_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px" />
|
||||
</RelativeLayout>
|
||||
</layout>
|
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="musicInfo"
|
||||
type="com.mango.core.room.ktv.bean.MusicInfo" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
imgUrl="@{musicInfo.cover}"
|
||||
isRound="@{true}" />
|
||||
<TextView
|
||||
android:id="@+id/tv_song_name"
|
||||
android:layout_toStartOf="@+id/stv_top"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@id/iv_cover"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{musicInfo.musicName + @string/sub + musicInfo.singer}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_song_author"
|
||||
android:visibility="gone"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="18dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@{musicInfo.userNick}"
|
||||
android:textColor="#999999"
|
||||
android:textSize="12sp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/stv_top"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="22dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_ktv_song_let_top"
|
||||
android:layout_toStartOf="@+id/stv_delete"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/dp_25" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/stv_delete"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@drawable/icon_clear_song" />
|
||||
|
||||
<com.mango.moshen.ui.widget.LivingIconView
|
||||
android:id="@+id/tv_singing"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@color/line_color"
|
||||
android:layout_alignParentBottom="true" />
|
||||
</RelativeLayout>
|
||||
</layout>
|
Reference in New Issue
Block a user