公会邀请成员接口增加hallId参数
This commit is contained in:
@@ -3,11 +3,8 @@ package com.yizhuan.erban.application;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.yizhuan.erban.location.LocationManager;
|
||||
import com.yizhuan.erban.module_hall.secretcode.PwdCodeMgr;
|
||||
import com.yizhuan.erban.radish.signin.SignDialogTimeManager;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
|
||||
/**
|
||||
|
@@ -26,14 +26,14 @@ import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
* @author chenran
|
||||
* @date 2017/10/3
|
||||
*/
|
||||
public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo,SearchAdapter.ViewHolder> {
|
||||
public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapter.ViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private int searchType;
|
||||
private int fromType;
|
||||
|
||||
|
||||
public SearchAdapter(Context context, int searchType,int fromType) {
|
||||
public SearchAdapter(Context context, int searchType, int fromType) {
|
||||
super(R.layout.list_item_search);
|
||||
this.context = context;
|
||||
this.searchType = searchType;
|
||||
@@ -48,16 +48,16 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo,SearchAdapter
|
||||
protected void convert(ViewHolder holder, SearchRoomInfo item) {
|
||||
holder.ivLive.setVisibility(View.GONE);
|
||||
holder.tvOnlineNum.setVisibility(View.GONE);
|
||||
if (searchType == SearchDetailFragment.TYPE_SEARCH_USER){
|
||||
holder.userName.setText(item.getNick() != null ? item.getNick().replaceAll(RegexUtil.getNotPrintableStringReg(), "?"):"");
|
||||
holder.ivLive.setVisibility(item.getRoomUid() == 0?View.GONE:View.VISIBLE);
|
||||
if (searchType == SearchDetailFragment.TYPE_SEARCH_USER) {
|
||||
holder.userName.setText(item.getNick() != null ? item.getNick().replaceAll(RegexUtil.getNotPrintableStringReg(), "?") : "");
|
||||
holder.ivLive.setVisibility(item.getRoomUid() == 0 ? View.GONE : View.VISIBLE);
|
||||
holder.container.setOnClickListener(v -> {
|
||||
UserInfoActivity.Companion.start(context, item.getUid());
|
||||
});
|
||||
}else {
|
||||
holder.userName.setText(item.getTitle() != null ? item.getTitle().replaceAll(RegexUtil.getNotPrintableStringReg(), "?"):"");
|
||||
} else {
|
||||
holder.userName.setText(item.getTitle() != null ? item.getTitle().replaceAll(RegexUtil.getNotPrintableStringReg(), "?") : "");
|
||||
holder.tvOnlineNum.setVisibility(View.VISIBLE);
|
||||
holder.tvOnlineNum.setText(item.getOnlineNum()+"");
|
||||
holder.tvOnlineNum.setText(item.getOnlineNum() + "");
|
||||
holder.container.setOnClickListener(v -> {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_SEARCH_INTO_RESULT_ROOM_CLICK, "搜索_进入结果房间");
|
||||
AVRoomActivity.start(mContext, item.getUid());
|
||||
|
@@ -48,6 +48,7 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
public static final int TYPE_SEARCH_USER = 2;
|
||||
private RecyclerView recyclerView;
|
||||
private SearchAdapter searchAdapter;
|
||||
private long hallId;
|
||||
private int mType;
|
||||
private int fromType;
|
||||
|
||||
@@ -59,10 +60,11 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public static SearchDetailFragment newInstance(int type,int fromType) {
|
||||
public static SearchDetailFragment newInstance(long hallId, int type, int fromType) {
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("hallId", hallId);
|
||||
args.putInt("type", type);
|
||||
args.putInt("fromType",fromType);
|
||||
args.putInt("fromType", fromType);
|
||||
SearchDetailFragment fragment = new SearchDetailFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
@@ -95,19 +97,20 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
if (getArguments() != null) {
|
||||
mType = getArguments().getInt("type");
|
||||
fromType = getArguments().getInt("fromType");
|
||||
hallId = getArguments().getLong("hallId");
|
||||
}
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData(){
|
||||
private void initData() {
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
searchAdapter = new SearchAdapter(mContext, mType,fromType);
|
||||
searchAdapter = new SearchAdapter(mContext, mType, fromType);
|
||||
searchAdapter.setType(fromType);
|
||||
searchAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
SearchRoomInfo item = (SearchRoomInfo) adapter.getData().get(position);
|
||||
showSureDialog(item.getUid() + "",item.getAvatar(), item.getNick());
|
||||
showSureDialog(item.getUid() + "", item.getAvatar(), item.getNick());
|
||||
}
|
||||
});
|
||||
recyclerView.setAdapter(searchAdapter);
|
||||
@@ -134,7 +137,7 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
HallModel.get().inviteMember(targetUid)
|
||||
HallModel.get().inviteMember(hallId, targetUid)
|
||||
.compose(RxHelper.bindActivity((HallSearchActivity) getActivity()))
|
||||
.subscribe(new BeanObserver<String>() {
|
||||
@Override
|
||||
@@ -152,12 +155,12 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
}
|
||||
}
|
||||
|
||||
public void search(String str,int type){
|
||||
getMvpPresenter().searchRooms(str,type);
|
||||
public void search(String str, int type) {
|
||||
getMvpPresenter().searchRooms(str, type);
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
if (searchAdapter == null){
|
||||
public void clear() {
|
||||
if (searchAdapter == null) {
|
||||
return;
|
||||
}
|
||||
searchAdapter.setNewData(null);
|
||||
|
@@ -59,6 +59,7 @@ public class SearchHallActivity extends BaseMvpActivity<ISearchView, SearchPrese
|
||||
private ViewPager viewPager;
|
||||
private LinearLayout llSearchDetail;
|
||||
protected int type = AbstractSelectFriendAction.TYPE_NORMAL;
|
||||
private long hallId;
|
||||
private int secondOperator = -1;
|
||||
|
||||
private SearchDetailFragment userFrg ;
|
||||
@@ -79,11 +80,8 @@ public class SearchHallActivity extends BaseMvpActivity<ISearchView, SearchPrese
|
||||
|
||||
private void initView() {
|
||||
type = getIntent().getIntExtra(AbstractSelectFriendAction.KEY_TYPE, AbstractSelectFriendAction.TYPE_NORMAL);
|
||||
hallId = getIntent().getLongExtra("hallId",0);
|
||||
secondOperator = getIntent().getIntExtra(SelectFriendActivity.KEY_SECOND_OPERATOR,-1);
|
||||
switch (type) {
|
||||
|
||||
}
|
||||
|
||||
searchEdit = findViewById(R.id.search_edit);
|
||||
searchEdit.addTextChangedListener(textWatcher);
|
||||
searchEdit.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
|
||||
@@ -123,7 +121,7 @@ public class SearchHallActivity extends BaseMvpActivity<ISearchView, SearchPrese
|
||||
mTabInfoList.add(getString(R.string.search_user_tab));
|
||||
|
||||
List<Fragment> mTabs = new ArrayList<>();
|
||||
userFrg = SearchDetailFragment.newInstance(SearchDetailFragment.TYPE_SEARCH_USER,AbstractSelectFriendAction.TYPE_MODULE_HALL);
|
||||
userFrg = SearchDetailFragment.newInstance(hallId,SearchDetailFragment.TYPE_SEARCH_USER,AbstractSelectFriendAction.TYPE_MODULE_HALL);
|
||||
mTabs.add(userFrg);
|
||||
ContactsIndicatorAdapter topMagicIndicatorAdapter = new ContactsIndicatorAdapter(this, mTabInfoList,0);
|
||||
topMagicIndicatorAdapter.setOnItemSelectListener(this);
|
||||
|
@@ -14,9 +14,10 @@ import com.yizhuan.erban.ui.search.SearchHallActivity;
|
||||
|
||||
public class HallSearchActivity extends SearchHallActivity {
|
||||
|
||||
public static void start(Context context, int type) {
|
||||
public static void start(Context context,long hallId, int type) {
|
||||
Intent intent = new Intent(context, HallSearchActivity.class);
|
||||
intent.putExtra(AbstractSelectFriendAction.KEY_TYPE, type);
|
||||
intent.putExtra("hallId", hallId);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
@@ -407,7 +407,7 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
break;
|
||||
|
||||
case AuthInfo.AUTH_MEMBER_JOIN_MANAGER:
|
||||
HallSearchActivity.start(context, AbstractSelectFriendAction.TYPE_MODULE_HALL);
|
||||
HallSearchActivity.start(context,hallId, AbstractSelectFriendAction.TYPE_MODULE_HALL);
|
||||
break;
|
||||
|
||||
case AuthInfo.AUTH_MEMBER_EXIT_MANAGER:
|
||||
|
@@ -13,6 +13,7 @@ import com.yizhuan.erban.friend.action.AbstractSelectFriendAction;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.HallSearchActivity;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity;
|
||||
import com.yizhuan.erban.other.activity.SplashActivity;
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel;
|
||||
import com.yizhuan.xchat_android_core.utils.ActivityUtil;
|
||||
import com.yizhuan.erban.utils.SpannableBuilder;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -268,7 +269,7 @@ public class PwdCodeMgr {
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_HALL_ADDMEMBERS_USERID_CLICK, "添加成员-音游ID");
|
||||
dialog.dismiss();
|
||||
HallSearchActivity.start(context, AbstractSelectFriendAction.TYPE_MODULE_HALL);
|
||||
HallSearchActivity.start(context, HallModel.get().getHallId(), AbstractSelectFriendAction.TYPE_MODULE_HALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -249,8 +249,8 @@ public class HallModel extends BaseModel implements IHallModel {
|
||||
* 高管邀请成员加入
|
||||
*/
|
||||
@Override
|
||||
public Single<String> inviteMember(long targetUid) {
|
||||
return api.invite(AuthModel.get().getCurrentUid(), targetUid)
|
||||
public Single<String> inviteMember(long hallId, long targetUid) {
|
||||
return api.invite(hallId, AuthModel.get().getCurrentUid(), targetUid)
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
.flatMap(result -> {
|
||||
if (result.isSuccess()) {
|
||||
@@ -449,7 +449,8 @@ public class HallModel extends BaseModel implements IHallModel {
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/hall/invite")
|
||||
Single<ServiceResult<Void>> invite(@Field("uid") long uid,
|
||||
Single<ServiceResult<Void>> invite(@Field("hallId") long hallId,
|
||||
@Field("uid") long uid,
|
||||
@Field("targetUid") long targetUid);
|
||||
|
||||
/**
|
||||
|
@@ -66,7 +66,7 @@ public interface IHallModel {
|
||||
/**
|
||||
* 高管邀请成员加入
|
||||
*/
|
||||
Single<String> inviteMember(long targetUid);
|
||||
Single<String> inviteMember(long hallId,long targetUid);
|
||||
|
||||
Single<OwnerHallInfo> getOwnerHallInfo(long targetUid);
|
||||
|
||||
|
Reference in New Issue
Block a user