1.超管接口对接和家族公会UI修改

This commit is contained in:
huangjian
2021-09-01 19:02:38 +08:00
parent 2f0ca83ec7
commit 66d2df5fc3
28 changed files with 311 additions and 111 deletions

View File

@@ -63,7 +63,7 @@ public class RVDelegate<T> {
public void setNewData(List<T> data) { public void setNewData(List<T> data) {
adapter.setNewData(data); adapter.setNewData(data);
if (emptyView != null && ListUtils.isListEmpty(data)) { if (emptyView != null && adapter.getEmptyView() == null) {
adapter.setEmptyView(emptyView); adapter.setEmptyView(emptyView);
} }
adapter.disableLoadMoreIfNotFullPage(); adapter.disableLoadMoreIfNotFullPage();

View File

@@ -3,6 +3,7 @@ package com.yizhuan.erban.module_hall.hall.activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.text.TextUtils; import android.text.TextUtils;
@@ -29,7 +30,9 @@ public class HallNameSettingActivity extends BaseMvpActivity<IHallNameView, Hall
@BindView(R.id.et_hall_name) @BindView(R.id.et_hall_name)
LimitEditText etHallName; LimitEditText etHallName;
/**厅名限制字符数*/ /**
* 厅名限制字符数
*/
private final static int MAX_HALL_NAME_LIMIT = 15; private final static int MAX_HALL_NAME_LIMIT = 15;
public static void start(Context context) { public static void start(Context context) {
@@ -43,7 +46,7 @@ public class HallNameSettingActivity extends BaseMvpActivity<IHallNameView, Hall
setContentView(R.layout.activity_hall_name); setContentView(R.layout.activity_hall_name);
ButterKnife.bind(this); ButterKnife.bind(this);
initWhiteTitleBar("设置公会"); initWhiteTitleBar("设置房间");
setRightOption(); setRightOption();
@@ -56,10 +59,8 @@ public class HallNameSettingActivity extends BaseMvpActivity<IHallNameView, Hall
@OnClick({R.id.iv_edit_clear}) @OnClick({R.id.iv_edit_clear})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { if (view.getId() == R.id.iv_edit_clear) {
case R.id.iv_edit_clear: etHallName.setText("");
etHallName.setText("");
break;
} }
} }
@@ -74,14 +75,14 @@ public class HallNameSettingActivity extends BaseMvpActivity<IHallNameView, Hall
} }
private void commit(String hallName) { private void commit(String hallName) {
if (TextUtils.isEmpty(hallName)){ if (TextUtils.isEmpty(hallName)) {
SingleToastUtil.showToastShort("公会名不能为空"); SingleToastUtil.showToastShort("房间名不能为空");
return; return;
} }
if (hallName.length() > MAX_HALL_NAME_LIMIT) { if (hallName.length() > MAX_HALL_NAME_LIMIT) {
SingleToastUtil.showToastShort("公会名不能超过15个字"); SingleToastUtil.showToastShort("房间名不能超过15个字");
return; return;
} }

View File

@@ -81,6 +81,7 @@ public class ModuleClanActivity extends BaseActivity implements View.OnClickList
binding.ivBack.setOnClickListener(this); binding.ivBack.setOnClickListener(this);
binding.tvHallAdmin.setOnClickListener(this); binding.tvHallAdmin.setOnClickListener(this);
binding.tvHallIncome.setOnClickListener(this); binding.tvHallIncome.setOnClickListener(this);
binding.ivHallMemberSearch.setOnClickListener(this);
otherUid = getIntent().getLongExtra(KEY_OTHER_UID, AuthModel.get().getCurrentUid()); otherUid = getIntent().getLongExtra(KEY_OTHER_UID, AuthModel.get().getCurrentUid());
isSelfClan = otherUid == AuthModel.get().getCurrentUid(); isSelfClan = otherUid == AuthModel.get().getCurrentUid();
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this)); binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
@@ -129,6 +130,9 @@ public class ModuleClanActivity extends BaseActivity implements View.OnClickList
if (isSelfClan) { if (isSelfClan) {
HallDataManager.get().updateHallInfo(clanAndHallInfo); HallDataManager.get().updateHallInfo(clanAndHallInfo);
} }
if ((HallDataManager.get().isManager() && isSelfClan) || clanAndHallInfo.isManageHall()) {
binding.ivHallMemberSearch.setVisibility(View.VISIBLE);
}
clanInfo = clanAndHallInfo.getClan(); clanInfo = clanAndHallInfo.getClan();
if (clanInfo != null && clanInfo.getId() != 0) { if (clanInfo != null && clanInfo.getId() != 0) {
binding.clClan.setVisibility(View.VISIBLE); binding.clClan.setVisibility(View.VISIBLE);
@@ -248,11 +252,14 @@ public class ModuleClanActivity extends BaseActivity implements View.OnClickList
break; break;
case R.id.tv_hall_admin: case R.id.tv_hall_admin:
if (clanInfo != null) { if (clanInfo != null) {
SuperAdminManageActivity.start(this,clanInfo.getId()); SuperAdminManageActivity.start(this, clanInfo.getId());
} else { } else {
toast("数据加载中,请稍后..."); toast("数据加载中,请稍后...");
} }
break; break;
case R.id.iv_hall_member_search:
MemberSearchActivity.start(this);
break;
} }
} }

View File

@@ -69,7 +69,7 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
private ActivityModuleHallBinding binding; private ActivityModuleHallBinding binding;
public static void start(Context context, long hallId, long ownerUid,long otherUid) { public static void start(Context context, long hallId, long ownerUid, long otherUid) {
Intent intent = new Intent(context, ModuleHallActivity.class); Intent intent = new Intent(context, ModuleHallActivity.class);
intent.putExtra(KEY_HALL_ID, hallId); intent.putExtra(KEY_HALL_ID, hallId);
intent.putExtra(KEY_OWNER_UID, ownerUid); intent.putExtra(KEY_OWNER_UID, ownerUid);
@@ -80,7 +80,7 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
public static void start(Context context) { public static void start(Context context) {
StatisticManager.Instance().onEvent(BasicConfig.INSTANCE.getAppContext(), StatisticManager.Instance().onEvent(BasicConfig.INSTANCE.getAppContext(),
StatisticsProtocol.Event.MY_HALL_CLICK, "我的厅入口", null); StatisticsProtocol.Event.MY_HALL_CLICK, "我的厅入口", null);
start(context, HallModel.get().getHallId(), AuthModel.get().getCurrentUid(),AuthModel.get().getCurrentUid()); start(context, HallModel.get().getHallId(), AuthModel.get().getCurrentUid(), AuthModel.get().getCurrentUid());
} }
@Override @Override
@@ -94,7 +94,7 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
binding.ivSetting.setOnClickListener(this); binding.ivSetting.setOnClickListener(this);
hallId = getIntent().getLongExtra(KEY_HALL_ID, HallModel.get().getHallId()); hallId = getIntent().getLongExtra(KEY_HALL_ID, HallModel.get().getHallId());
ownerUid = getIntent().getLongExtra(KEY_OWNER_UID, AuthModel.get().getCurrentUid()); ownerUid = getIntent().getLongExtra(KEY_OWNER_UID, AuthModel.get().getCurrentUid());
otherUid = getIntent().getLongExtra(KEY_OTHER_UID, AuthModel.get().getCurrentUid()); otherUid = getIntent().getLongExtra(KEY_OTHER_UID, AuthModel.get().getCurrentUid());
isSelfHall = hallId == HallModel.get().getHallId(); isSelfHall = hallId == HallModel.get().getHallId();
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this)); binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
@@ -124,15 +124,10 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
mGroupMemberListAdapter.setOnLoadMoreListener(() -> loadMembers(false), binding.recyclerView); mGroupMemberListAdapter.setOnLoadMoreListener(() -> loadMembers(false), binding.recyclerView);
binding.recyclerView.setAdapter(mGroupMemberListAdapter); binding.recyclerView.setAdapter(mGroupMemberListAdapter);
setTvCount(0); setTvCount(0);
if (HallDataManager.get().isManager() && isSelfHall) {
getMvpPresenter().getHallAuths();
} else {
binding.ivHallMemberSearch.setVisibility(View.GONE);
}
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
binding.nsvHall.setNestedScrollingEnabled(false); binding.nsvHall.setNestedScrollingEnabled(false);
initClanAndHall(); initClanAndHall();
setMoreOption(HallDataManager.get().isManager() && isSelfHall);
} }
@SuppressLint({"CheckResult", "SetTextI18n"}) @SuppressLint({"CheckResult", "SetTextI18n"})
@@ -147,16 +142,11 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
.compose(bindToLifecycle()) .compose(bindToLifecycle())
.subscribe(clanAndHallInfo -> { .subscribe(clanAndHallInfo -> {
HallInfo hallInfo = clanAndHallInfo.getHall(); HallInfo hallInfo = clanAndHallInfo.getHall();
ClanInfo clanInfo = clanAndHallInfo.getClan(); setSettingOption((HallDataManager.get().isManager() && isSelfHall) || clanAndHallInfo.isManageHall());
/* if (clanInfo != null && clanInfo.getId() != 0) {
binding.tvOwnerClan.setVisibility(View.VISIBLE);
binding.tvOwnerClan.setOnClickListener(v -> ModuleClanActivity.start(context,otherUid));
}*/
setSettingOption(HallDataManager.get().getRoleType() != RoleType.OWNER || !isSelfHall);
if (hallInfo != null && hallInfo.getHallId() != 0) { if (hallInfo != null && hallInfo.getHallId() != 0) {
binding.clHall.setVisibility(View.VISIBLE); binding.clHall.setVisibility(View.VISIBLE);
binding.clHall.setOnClickListener(v -> UserInfoActivity.Companion.start(context, hallInfo.getOwnerUid())); binding.clHall.setOnClickListener(v -> UserInfoActivity.Companion.start(context, hallInfo.getOwnerUid()));
binding.tvHallId.setText("公会ID:" + hallInfo.getHallId() + ""); binding.tvHallId.setText("房间ID:" + hallInfo.getOwnerErbanNo());
binding.tvTitle.setText(hallInfo.getHallName()); binding.tvTitle.setText(hallInfo.getHallName());
GlideApp.with(binding.ivHallAvatar.getContext()) GlideApp.with(binding.ivHallAvatar.getContext())
@@ -184,21 +174,19 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
/** /**
* 设置权限, 房主才展示 * 设置权限, 房主才展示
* *
* @param gone true:隐藏 * @param visible true:显示
*/ */
private void setSettingOption(boolean gone) { private void setSettingOption(boolean visible) {
if (gone) { if (visible) {
binding.ivSetting.setVisibility(View.GONE); binding.ivHallMemberSearch.setVisibility(View.VISIBLE);
} else { getMvpPresenter().getHallAuths();
binding.ivSetting.setVisibility(View.VISIBLE);
}
}
private void setMoreOption(boolean hasOption) {
if (hasOption) {
binding.ivHallMemberMore.setVisibility(View.VISIBLE); binding.ivHallMemberMore.setVisibility(View.VISIBLE);
binding.ivSetting.setVisibility(View.VISIBLE);
binding.tvExit.setVisibility(View.GONE);
} else { } else {
binding.ivSetting.setVisibility(View.GONE);
binding.ivHallMemberMore.setVisibility(View.GONE); binding.ivHallMemberMore.setVisibility(View.GONE);
if (isSelfHall) binding.tvExit.setVisibility(View.VISIBLE);
} }
} }
@@ -366,11 +354,10 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
finish(); finish();
break; break;
case R.id.iv_setting: case R.id.iv_setting:
if (HallDataManager.get().getRoleType() == RoleType.OWNER) { HallNameSettingActivity.start(ModuleHallActivity.this);
showMenuDialog(view); break;
} else { case R.id.tv_exit:
showExitHallDialog(view); showExitDialog();
}
break; break;
} }
} }
@@ -397,34 +384,6 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
} }
} }
private void showMenuDialog(View attachView) {
List<AuthInfo> authInfoList = new ArrayList<>();
AuthInfo authInfo = new AuthInfo();
authInfo.setCode("hall_name_set");
authInfo.setName("设置房间名");
authInfo.setStatus(1);
authInfoList.add(authInfo);
HallMenuDialog dialog = new HallMenuDialog(this, attachView, authInfoList, false);
dialog.setOnMenuClickListener(this::jumpCode);
dialog.show();
}
private void showExitHallDialog(View attachView) {
List<AuthInfo> authInfoList = new ArrayList<>();
AuthInfo authInfo = new AuthInfo();
authInfo.setCode(AuthInfo.AUTH_APPLY_HALL_EXIT);
authInfo.setName("退出房间");
authInfo.setStatus(1);
authInfoList.add(authInfo);
HallMenuDialog dialog = new HallMenuDialog(this, attachView, authInfoList, false);
dialog.setOnMenuClickListener(this::jumpCode);
dialog.show();
}
private void jumpCode(String code) { private void jumpCode(String code) {
switch (code) { switch (code) {
case AuthInfo.AUTH_APPLY_HALL_EXIT: case AuthInfo.AUTH_APPLY_HALL_EXIT:

View File

@@ -1,5 +1,6 @@
package com.yizhuan.erban.module_hall.hall.activity package com.yizhuan.erban.module_hall.hall.activity
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
@@ -29,7 +30,7 @@ class SuperAdminAddActivity : BaseViewBindingActivity<ActivitySuperAdminAddBindi
private val adminAdapter = SearchAdminAdapter() private val adminAdapter = SearchAdminAdapter()
private lateinit var rvDelegate: RVDelegate<SuperAdminInfo> private lateinit var rvDelegate: RVDelegate<SuperAdminInfo>
private val clanId by lazy { intent.getLongExtra("clanId", 0) } private val clanId by lazy { intent.getLongExtra("clanId", 0) }
private var searchId = 0L
override fun init() { override fun init() {
rvDelegate = RVDelegate.Builder<SuperAdminInfo>() rvDelegate = RVDelegate.Builder<SuperAdminInfo>()
@@ -52,13 +53,8 @@ class SuperAdminAddActivity : BaseViewBindingActivity<ActivitySuperAdminAddBindi
if (id == null) { if (id == null) {
"请输入音游号!".toast() "请输入音游号!".toast()
} else { } else {
HallModel.get().searchSuperAdminInfo(id) searchId = id
.compose(bindToLifecycle()) loadData()
.subscribe({
rvDelegate.setNewData(listOf(it))
}, {
it.message.toast()
})
} }
} }
@@ -71,6 +67,23 @@ class SuperAdminAddActivity : BaseViewBindingActivity<ActivitySuperAdminAddBindi
} }
override fun onResume() {
super.onResume()
loadData()
}
@SuppressLint("CheckResult")
private fun loadData() {
if (searchId == 0L) return
HallModel.get().searchSuperAdminInfo(searchId)
.compose(bindToLifecycle())
.subscribe({
rvDelegate.setNewData(listOf(it))
}, {
it.message.toast()
})
}
override fun needSteepStateBar() = true override fun needSteepStateBar() = true
override fun setStatusBar() { override fun setStatusBar() {

View File

@@ -1,15 +1,26 @@
package com.yizhuan.erban.module_hall.hall.activity package com.yizhuan.erban.module_hall.hall.activity
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.widget.PopupWindow
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.netease.nim.uikit.StatusBarUtil import com.netease.nim.uikit.StatusBarUtil
import com.netease.nim.uikit.common.util.sys.ScreenUtil
import com.yizhuan.erban.R
import com.yizhuan.erban.base.BaseViewBindingActivity import com.yizhuan.erban.base.BaseViewBindingActivity
import com.yizhuan.erban.common.EmptyViewHelper import com.yizhuan.erban.common.EmptyViewHelper
import com.yizhuan.erban.databinding.ActivitySuperAdminManegeBinding import com.yizhuan.erban.databinding.ActivitySuperAdminManegeBinding
import com.yizhuan.erban.module_hall.hall.adapter.ManageSuperAdminAdapter import com.yizhuan.erban.module_hall.hall.adapter.ManageSuperAdminAdapter
import com.yizhuan.erban.ui.utils.RVDelegate import com.yizhuan.erban.ui.utils.RVDelegate
import com.yizhuan.xchat_android_core.module_hall.hall.HallModel
import com.yizhuan.xchat_android_core.module_hall.hall.bean.SuperAdminInfo import com.yizhuan.xchat_android_core.module_hall.hall.bean.SuperAdminInfo
import com.yizhuan.xchat_android_core.utils.toast
class SuperAdminManageActivity : BaseViewBindingActivity<ActivitySuperAdminManegeBinding>() { class SuperAdminManageActivity : BaseViewBindingActivity<ActivitySuperAdminManegeBinding>() {
@@ -28,6 +39,8 @@ class SuperAdminManageActivity : BaseViewBindingActivity<ActivitySuperAdminManeg
private val pageSize = 20 private val pageSize = 20
private val clanId by lazy { intent.getLongExtra("clanId", 0) } private val clanId by lazy { intent.getLongExtra("clanId", 0) }
private lateinit var popupWindow: PopupWindow
override fun init() { override fun init() {
initWhiteTitleBar("公会超管设置") initWhiteTitleBar("公会超管设置")
@@ -43,8 +56,65 @@ class SuperAdminManageActivity : BaseViewBindingActivity<ActivitySuperAdminManeg
SuperAdminAddActivity.start(this, clanId) SuperAdminAddActivity.start(this, clanId)
} }
adminAdapter.setOnItemChildClickListener { _, view, position ->
if (view.id == R.id.iv_more) {
showManagePopup(view, adminAdapter.getItem(position), position)
}
}
} }
@SuppressLint("CheckResult")
override fun onResume() {
super.onResume()
HallModel.get().getClanSuperAdminList(clanId)
.compose(bindToLifecycle())
.subscribe({
rvDelegate.setNewData(it)
}, {
rvDelegate.loadErr(true)
})
}
private fun showManagePopup(parent: View?, superAdminInfo: SuperAdminInfo?, position: Int) {
if (parent == null || superAdminInfo == null) return
val contentView: View
if (!this::popupWindow.isInitialized) {
contentView =
LayoutInflater.from(this).inflate(R.layout.popup_admin_more, null)
popupWindow =
PopupWindow(contentView, ScreenUtil.dip2px(100f), ScreenUtil.dip2px(63f))
popupWindow.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
popupWindow.isFocusable = true
} else {
contentView = popupWindow.contentView
}
contentView.findViewById<View>(R.id.tv_set_room).setOnClickListener {
SuperAdminRoomSetActivity.start(this, clanId, superAdminInfo.uid)
popupWindow.dismiss()
}
contentView.findViewById<View>(R.id.tv_remove).setOnClickListener {
popupWindow.dismiss()
HallModel.get().removeSuperAdmin(superAdminInfo.uid)
.compose(bindToLifecycle())
.subscribe({
adminAdapter.remove(position)
}, {
it.message.toast()
})
}
val vLoc = IntArray(2)
parent.getLocationInWindow(vLoc)
popupWindow.showAsDropDown(
parent,
0,
0,
Gravity.END
)
}
override fun needSteepStateBar() = true override fun needSteepStateBar() = true
override fun setStatusBar() { override fun setStatusBar() {

View File

@@ -74,6 +74,9 @@ public class GroupMemberListAdapter extends BaseQuickAdapter<MemberInfo, BaseVie
} else if (item.getRoleType() == RoleType.CLAN_HALL_OWNER) { } else if (item.getRoleType() == RoleType.CLAN_HALL_OWNER) {
holder.setVisible(R.id.iv_type, true); holder.setVisible(R.id.iv_type, true);
holder.setImageResource(R.id.iv_type, R.drawable.bg_clan_and_hall_owner); holder.setImageResource(R.id.iv_type, R.drawable.bg_clan_and_hall_owner);
} else if (item.getRoleType() == RoleType.CLAN_SUPER_ADMIN) {
holder.setVisible(R.id.iv_type, true);
holder.setImageResource(R.id.iv_type, R.drawable.bg_clan_super_admin);
} else { } else {
holder.setVisible(R.id.iv_type, false); holder.setVisible(R.id.iv_type, false);
} }

View File

@@ -2,6 +2,7 @@ package com.yizhuan.erban.module_hall.hall.adapter
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder import com.chad.library.adapter.base.BaseViewHolder
import com.netease.nim.uikit.common.util.sys.ScreenUtil
import com.yizhuan.erban.R import com.yizhuan.erban.R
import com.yizhuan.erban.ui.utils.ImageLoadUtils import com.yizhuan.erban.ui.utils.ImageLoadUtils
import com.yizhuan.xchat_android_core.module_hall.hall.bean.SuperAdminHall import com.yizhuan.xchat_android_core.module_hall.hall.bean.SuperAdminHall
@@ -11,7 +12,13 @@ class ManageRoomAdapter :
override fun convert(helper: BaseViewHolder, item: SuperAdminHall) { override fun convert(helper: BaseViewHolder, item: SuperAdminHall) {
ImageLoadUtils.loadAvatar(item.hallAvatar, helper.getView(R.id.iv_avatar)) ImageLoadUtils.loadRectImage(
mContext,
item.hallAvatar,
helper.getView(R.id.iv_room_avatar),
R.drawable.default_cover,
ScreenUtil.dip2px(5f)
)
helper.setText(R.id.tv_room_name, item.hallName)
} }
} }

View File

@@ -15,7 +15,11 @@ class ManageSuperAdminAdapter :
BaseQuickAdapter<SuperAdminInfo, BaseViewHolder>(R.layout.item_manage_super_admin) { BaseQuickAdapter<SuperAdminInfo, BaseViewHolder>(R.layout.item_manage_super_admin) {
override fun convert(helper: BaseViewHolder, item: SuperAdminInfo) { override fun convert(helper: BaseViewHolder, item: SuperAdminInfo) {
ImageLoadUtils.loadAvatar("", helper.getView(R.id.iv_avatar)) ImageLoadUtils.loadAvatar(item.avatar, helper.getView(R.id.iv_avatar))
helper.setText(R.id.tv_nickname,item.nick)
.setText(R.id.tv_id,"音游号:${item.erbanNo}")
.addOnClickListener(R.id.iv_more)
val rvRoom = helper.getView<RecyclerView>(R.id.rv_room) val rvRoom = helper.getView<RecyclerView>(R.id.rv_room)
if (rvRoom.adapter == null) { if (rvRoom.adapter == null) {
@@ -32,6 +36,6 @@ class ManageSuperAdminAdapter :
.setAdapter(ManageRoomAdapter()) .setAdapter(ManageRoomAdapter())
.build() .build()
} }
(rvRoom.adapter as BaseQuickAdapter<*, *>).setNewData(ArrayList()) (rvRoom.adapter as BaseQuickAdapter<SuperAdminHall, BaseViewHolder>).setNewData(item.roomList)
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="45"
android:endColor="@color/transparent"
android:startColor="@color/black"
android:type="linear"
android:useLevel="true" />
</shape>

View File

@@ -209,6 +209,14 @@
android:textColor="@color/text_normal_c6c6e9" android:textColor="@color/text_normal_c6c6e9"
android:textSize="15dp" /> android:textSize="15dp" />
<ImageView
android:id="@+id/iv_hall_member_search"
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="center"
android:src="@drawable/ic_hall_member_search"
android:visibility="gone" />
</LinearLayout> </LinearLayout>

View File

@@ -104,8 +104,7 @@
android:visibility="gone" android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/cl_hall" app:layout_constraintTop_toBottomOf="@id/cl_hall"
tools:itemCount="1" tools:itemCount="1"
tools:listitem="@layout/item_tab_small" tools:listitem="@layout/item_tab_small" />
tools:visibility="visible" />
<LinearLayout <LinearLayout
android:id="@+id/ll_member_list" android:id="@+id/ll_member_list"
@@ -143,15 +142,18 @@
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:scaleType="center" android:scaleType="center"
android:visibility="gone" android:src="@drawable/ic_hall_member_search"
android:src="@drawable/ic_hall_member_search" /> android:visibility="gone" />
<ImageView <TextView
android:id="@+id/iv_hall_member_more" android:id="@+id/iv_hall_member_more"
android:layout_width="30dp" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:scaleType="center" android:gravity="center"
android:src="@drawable/ic_hall_member_more" android:drawableEnd="@drawable/ic_hall_member_more"
android:text="管理"
android:textColor="@color/text_normal_c6c6e9"
android:textSize="12sp"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />
@@ -219,14 +221,14 @@
android:visibility="gone" /> android:visibility="gone" />
<TextView <TextView
android:id="@+id/tv_edit" android:id="@+id/tv_exit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:text="编辑" android:text="退出房间"
android:textColor="@color/color_999999" android:textColor="@color/white"
android:textSize="@dimen/sp_13" android:textSize="@dimen/sp_14"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>

View File

@@ -46,7 +46,7 @@
android:layout_weight="1" android:layout_weight="1"
android:background="@null" android:background="@null"
android:hint="请输入公会成员音游号" android:hint="请输入公会成员音游号"
android:inputType="text" android:inputType="number"
android:maxLength="20" android:maxLength="20"
android:maxLines="1" android:maxLines="1"
android:text="" android:text=""

View File

@@ -16,9 +16,17 @@
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:clipToPadding="false"
android:paddingBottom="65dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/title_bar" /> app:layout_constraintTop_toBottomOf="@id/title_bar" />
<View
android:layout_width="match_parent"
android:layout_height="88dp"
android:background="@drawable/shape_admin_bottom_bg"
app:layout_constraintBottom_toBottomOf="parent" />
<TextView <TextView
android:id="@+id/tv_add_super_admin" android:id="@+id/tv_add_super_admin"
android:layout_width="300dp" android:layout_width="300dp"

View File

@@ -16,9 +16,17 @@
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:clipToPadding="false"
android:paddingBottom="65dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/title_bar" /> app:layout_constraintTop_toBottomOf="@id/title_bar" />
<View
android:layout_width="match_parent"
android:layout_height="88dp"
android:background="@drawable/shape_admin_bottom_bg"
app:layout_constraintBottom_toBottomOf="parent" />
<TextView <TextView
android:id="@+id/tv_add_super_admin" android:id="@+id/tv_add_super_admin"
android:layout_width="300dp" android:layout_width="300dp"

View File

@@ -61,7 +61,7 @@
android:id="@+id/iv_more" android:id="@+id/iv_more"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:paddingTop="10dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:src="@drawable/ic_hall_manage_more" android:src="@drawable/ic_hall_manage_more"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@@ -73,17 +73,19 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="13dp" android:layout_marginTop="13dp"
android:text="管理的房间"
android:textColor="@color/text_normal_c6c6e9" android:textColor="@color/text_normal_c6c6e9"
android:textSize="14sp" android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_avatar" app:layout_constraintTop_toBottomOf="@id/iv_avatar" />
tools:text="管理的房间" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_room" android:id="@+id/rv_room"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="6dp" android:layout_marginBottom="6dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_manage_room" /> app:layout_constraintTop_toBottomOf="@id/tv_manage_room" />

View File

@@ -52,14 +52,16 @@
<TextView <TextView
android:id="@+id/tv_set" android:id="@+id/tv_set"
android:layout_width="90dp" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginEnd="15dp"
android:background="@drawable/bg_common_confirm" android:background="@drawable/bg_common_confirm"
android:gravity="center" android:gravity="center"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:text="设置为超管" android:text="设置为超管"
android:textColor="@color/text_title_white" android:textColor="@color/text_title_white"
android:textSize="14sp" android:textSize="14sp"
android:layout_marginEnd="15dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/ll_container"
android:layout_width="100dp"
android:layout_height="63dp"
android:background="@drawable/bg_message_popup"
android:orientation="vertical">
<TextView
android:id="@+id/tv_set_room"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:text="设置管理的房间"
android:textColor="@color/text_title_white"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_remove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="13dp"
android:text="移除超管身份"
android:textColor="@color/text_title_white"
android:textSize="12sp" />
</LinearLayout>

View File

@@ -301,13 +301,30 @@ public class HallModel extends BaseModel implements IHallModel {
.compose(RxHelper.handleCommon()); .compose(RxHelper.handleCommon());
} }
@Override @Override
public Single<String> setSuperAdmin(String roomUids ,long uid) { public Single<String> setSuperAdmin(String roomUids ,long uid) {
return api.setSuperAdmin(roomUids,uid) return api.setSuperAdmin(roomUids,uid)
.compose(RxHelper.handleStringData()); .compose(RxHelper.handleStringData());
} }
@Override
public Single<List<SuperAdminInfo>> getRoomSuperAdminList(long roomUid) {
return api.getRoomSuperAdminList(roomUid)
.compose(RxHelper.handleCommon());
}
@Override
public Single<List<SuperAdminInfo>> getClanSuperAdminList(long clanId) {
return api.getClanSuperAdminList(clanId)
.compose(RxHelper.handleCommon());
}
@Override
public Single<String> removeSuperAdmin(long uid) {
return api.removeSuperAdmin(uid)
.compose(RxHelper.handleStringData());
}
private interface Api { private interface Api {
/** /**
@@ -477,6 +494,12 @@ public class HallModel extends BaseModel implements IHallModel {
@GET("/hall/superManager/search") @GET("/hall/superManager/search")
Single<ServiceResult<SuperAdminInfo>> searchSuperAdminInfo(@Query("erbanNo") long erbanNo); Single<ServiceResult<SuperAdminInfo>> searchSuperAdminInfo(@Query("erbanNo") long erbanNo);
/**
* 移除超管
*/
@GET("/hall/superManager/remove")
Single<ServiceResult<String>> removeSuperAdmin(@Query("targetUid") long targetUid);
/** /**
* 设置超管信息 * 设置超管信息
* @param roomUids 设置的房间uid,都会隔开 * @param roomUids 设置的房间uid,都会隔开
@@ -486,5 +509,17 @@ public class HallModel extends BaseModel implements IHallModel {
@POST("/hall/superManager/setSuperManage") @POST("/hall/superManager/setSuperManage")
Single<ServiceResult<String>> setSuperAdmin(@Field("roomUids") String roomUids,@Field("uid") long uid); Single<ServiceResult<String>> setSuperAdmin(@Field("roomUids") String roomUids,@Field("uid") long uid);
/**
* 获取房间超管信息
*/
@GET("/hall/superManager/listSuperManageInClan")
Single<ServiceResult<List<SuperAdminInfo>>> getClanSuperAdminList(@Query("clanId") long clanId);
/**
* 获取公会超管信息
*/
@GET("/hall/superManager/listSuperManageInRoom")
Single<ServiceResult<List<SuperAdminInfo>>> getRoomSuperAdminList(@Query("roomUid") long roomUid);
} }
} }

View File

@@ -81,4 +81,10 @@ public interface IHallModel {
Single<SuperAdminInfo> searchSuperAdminInfo(long erbanNo); Single<SuperAdminInfo> searchSuperAdminInfo(long erbanNo);
Single<String> setSuperAdmin(String roomUids ,long uid); Single<String> setSuperAdmin(String roomUids ,long uid);
Single<List<SuperAdminInfo>> getRoomSuperAdminList(long roomUid);
Single<List<SuperAdminInfo>> getClanSuperAdminList(long clanId);
Single<String> removeSuperAdmin(long uid);
} }

View File

@@ -6,4 +6,5 @@ import lombok.Data;
public class ClanAndHallInfo { public class ClanAndHallInfo {
private ClanInfo clan; private ClanInfo clan;
private HallInfo hall; private HallInfo hall;
private boolean manageHall;
} }

View File

@@ -6,14 +6,29 @@ package com.yizhuan.xchat_android_core.module_hall.hall.bean;
*/ */
public interface RoleType { public interface RoleType {
/**厅主*/ /**
* 厅主
*/
int OWNER = 1; int OWNER = 1;
/**高管*/ /**
* 高管
*/
int ADMIN = 2; int ADMIN = 2;
/**普通成员*/ /**
* 普通成员
*/
int NORMAL = 3; int NORMAL = 3;
/**族长*/ /**
* 族长
*/
int CLAN_OWNER = 4; int CLAN_OWNER = 4;
/**族长,会长*/ /**
* 族长,会长
*/
int CLAN_HALL_OWNER = 5; int CLAN_HALL_OWNER = 5;
/**
* 超管
*/
int CLAN_SUPER_ADMIN = 6;
} }

View File

@@ -6,5 +6,6 @@ data class SuperAdminInfo(
val gender: Int = 0, val gender: Int = 0,
var hasSet: Boolean = false, var hasSet: Boolean = false,
val nick: String? = null, val nick: String? = null,
val uid: Long = 0 val uid: Long = 0,
val roomList: List<SuperAdminHall>? = null
) )

View File

@@ -34,18 +34,22 @@ public class ScreenUtil {
} }
public static int dip2px(float dipValue) { public static int dip2px(float dipValue) {
init(NimUIKit.getContext());
return (int) (dipValue * density + 0.5f); return (int) (dipValue * density + 0.5f);
} }
public static int px2dip(float pxValue) { public static int px2dip(float pxValue) {
init(NimUIKit.getContext());
return (int) (pxValue / density + 0.5f); return (int) (pxValue / density + 0.5f);
} }
public static int sp2px(float spValue) { public static int sp2px(float spValue) {
init(NimUIKit.getContext());
return (int) (spValue * scaleDensity + 0.5f); return (int) (spValue * scaleDensity + 0.5f);
} }
public static int getDialogWidth() { public static int getDialogWidth() {
init(NimUIKit.getContext());
dialogWidth = (int) (screenMin * RATIO); dialogWidth = (int) (screenMin * RATIO);
return dialogWidth; return dialogWidth;
} }
@@ -68,6 +72,7 @@ public class ScreenUtil {
} }
public static int getDisplayWidth() { public static int getDisplayWidth() {
init(NimUIKit.getContext());
if (screenWidth == 0) { if (screenWidth == 0) {
GetInfo(NimUIKit.getContext()); GetInfo(NimUIKit.getContext());
} }
@@ -75,6 +80,7 @@ public class ScreenUtil {
} }
public static int getDisplayHeight() { public static int getDisplayHeight() {
init(NimUIKit.getContext());
if (screenHeight == 0) { if (screenHeight == 0) {
GetInfo(NimUIKit.getContext()); GetInfo(NimUIKit.getContext());
} }
@@ -88,8 +94,8 @@ public class ScreenUtil {
DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics(); DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics();
screenWidth = dm.widthPixels; screenWidth = dm.widthPixels;
screenHeight = dm.heightPixels; screenHeight = dm.heightPixels;
screenMin = (screenWidth > screenHeight) ? screenHeight : screenWidth; screenMin = Math.min(screenWidth, screenHeight);
screenMax = (screenWidth < screenHeight) ? screenHeight : screenWidth; screenMax = Math.max(screenWidth, screenHeight);
density = dm.density; density = dm.density;
scaleDensity = dm.scaledDensity; scaleDensity = dm.scaledDensity;
xdpi = dm.xdpi; xdpi = dm.xdpi;