1:添加练歌房,已点歌曲搜索(只能搜索用户id)、删除功能
This commit is contained in:
@@ -28,5 +28,7 @@ public class RequestContacts {
|
||||
void song(String roomId,String user_id,String song_code,String song_name,String singer,String poster,String duration);
|
||||
|
||||
void delSong(String roomId,String did);
|
||||
|
||||
void searchSong(String roomId,String search_user);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.xscm.modulemain.activity.room.fragment;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
@@ -60,9 +63,9 @@ public class MusicSongListFragment extends BaseMvpFragment<RequestPresenter, Fra
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
|
||||
if (roomInfoResp.getUser_info().getUser_id() == SpUtil.getUserId() && roomInfoResp.getUser_info().getPit_number() == 9) {
|
||||
status = 1;
|
||||
}
|
||||
// if (roomInfoResp.getUser_info().getUser_id() == SpUtil.getUserId() && roomInfoResp.getUser_info().getPit_number() == 9) {
|
||||
// status = 1;
|
||||
// }
|
||||
if (musicSongBeans != null) {
|
||||
for (MusicSongBean musicSongBean : musicSongBeans) {
|
||||
musicSongBean.setIs_hot(status);
|
||||
@@ -162,6 +165,27 @@ public class MusicSongListFragment extends BaseMvpFragment<RequestPresenter, Fra
|
||||
} else {
|
||||
MvpPre.songList(roomId, page + "");
|
||||
}
|
||||
|
||||
if (roomInfoResp.getUser_info().getUser_id() == SpUtil.getUserId() && roomInfoResp.getUser_info().getPit_number() == 9) {
|
||||
mBinding.l.setVisibility(VISIBLE);
|
||||
status = 1;
|
||||
}else {
|
||||
mBinding.l.setVisibility(GONE);
|
||||
}
|
||||
|
||||
mBinding.tvCancel.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
page=1;
|
||||
if (TextUtils.isEmpty(mBinding.editQuery.getText().toString().trim())){
|
||||
MvpPre.songList(roomId, page + "");
|
||||
}else {
|
||||
MvpPre.searchSong(roomId, mBinding.editQuery.getText().toString().trim());
|
||||
mBinding.editQuery.setText("");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -238,17 +262,17 @@ public class MusicSongListFragment extends BaseMvpFragment<RequestPresenter, Fra
|
||||
if (item.getIs_hot() == 1) {
|
||||
helper.setVisible(R.id.muis_sy, true);
|
||||
// helper.setVisible(R.id.muis_price, true);
|
||||
if (position == 0) {
|
||||
muisSy.setVisibility(View.INVISIBLE);
|
||||
muisPrice.setVisibility(View.INVISIBLE);
|
||||
// if (position == 0) {
|
||||
// muisSy.setVisibility(View.INVISIBLE);
|
||||
// muisPrice.setVisibility(View.INVISIBLE);
|
||||
// helper.setText(R.id.muis_price, "结束");
|
||||
//
|
||||
// muisSy.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
muisPrice.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
muisPrice.setVisibility(VISIBLE);
|
||||
helper.setText(R.id.muis_price, "置顶");
|
||||
muisSy.setVisibility(View.VISIBLE);
|
||||
}
|
||||
muisSy.setVisibility(VISIBLE);
|
||||
// }
|
||||
} else {
|
||||
muisSy.setVisibility(View.INVISIBLE);
|
||||
muisPrice.setVisibility(View.INVISIBLE);
|
||||
@@ -263,14 +287,14 @@ public class MusicSongListFragment extends BaseMvpFragment<RequestPresenter, Fra
|
||||
|
||||
@Override
|
||||
public boolean onItemLongClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
// if (position<0 || position >= adapter.getData().size()){
|
||||
// return false;
|
||||
// }
|
||||
// MusicSongBean musicSongBean= (MusicSongBean) adapter.getData().get(position);
|
||||
// if (musicSongBean.getIs_hot() == 1) {
|
||||
// showOptionsDialog(position);
|
||||
// return true;
|
||||
// }
|
||||
if (position<0 || position >= adapter.getData().size()){
|
||||
return false;
|
||||
}
|
||||
MusicSongBean musicSongBean= (MusicSongBean) adapter.getData().get(position);
|
||||
if (musicSongBean.getIs_hot() == 1) {
|
||||
showOptionsDialog(position);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -97,4 +97,23 @@ public class RequestPresenter extends BasePresenter<RequestContacts.View> implem
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void searchSong(String roomId, String search_user) {
|
||||
api.searchSong(roomId, search_user, new BaseObserver<List<MusicSongBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<MusicSongBean> musicSongBeans) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().songList(musicSongBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
android:background="@drawable/bg_r99_eff2f8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
@@ -40,26 +39,35 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="输入相关的主播名、房间名"
|
||||
android:hint="输入用户id"
|
||||
android:maxLength="10"
|
||||
android:singleLine="true"
|
||||
android:textColor="#333333"
|
||||
android:textColorHint="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:text="搜索"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <androidx.core.widget.NestedScrollView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent">-->
|
||||
<!-- <androidx.core.widget.NestedScrollView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent">-->
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
app:layout_constraintTop_toBottomOf="@+id/l"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="false">
|
||||
|
||||
@@ -67,10 +75,10 @@
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/dp_40"
|
||||
android:clipToPadding="false" />
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="@dimen/dp_140" />
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
<!-- </androidx.core.widget.NestedScrollView>-->
|
||||
<!-- </androidx.core.widget.NestedScrollView>-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
Reference in New Issue
Block a user