1.超管接口对接和家族公会UI修改
This commit is contained in:
@@ -63,7 +63,7 @@ public class RVDelegate<T> {
|
||||
|
||||
public void setNewData(List<T> data) {
|
||||
adapter.setNewData(data);
|
||||
if (emptyView != null && ListUtils.isListEmpty(data)) {
|
||||
if (emptyView != null && adapter.getEmptyView() == null) {
|
||||
adapter.setEmptyView(emptyView);
|
||||
}
|
||||
adapter.disableLoadMoreIfNotFullPage();
|
||||
|
@@ -3,6 +3,7 @@ package com.yizhuan.erban.module_hall.hall.activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import android.text.TextUtils;
|
||||
@@ -29,7 +30,9 @@ public class HallNameSettingActivity extends BaseMvpActivity<IHallNameView, Hall
|
||||
|
||||
@BindView(R.id.et_hall_name)
|
||||
LimitEditText etHallName;
|
||||
/**厅名限制字符数*/
|
||||
/**
|
||||
* 厅名限制字符数
|
||||
*/
|
||||
private final static int MAX_HALL_NAME_LIMIT = 15;
|
||||
|
||||
public static void start(Context context) {
|
||||
@@ -43,7 +46,7 @@ public class HallNameSettingActivity extends BaseMvpActivity<IHallNameView, Hall
|
||||
setContentView(R.layout.activity_hall_name);
|
||||
ButterKnife.bind(this);
|
||||
|
||||
initWhiteTitleBar("设置公会名");
|
||||
initWhiteTitleBar("设置房间名");
|
||||
|
||||
setRightOption();
|
||||
|
||||
@@ -56,10 +59,8 @@ public class HallNameSettingActivity extends BaseMvpActivity<IHallNameView, Hall
|
||||
|
||||
@OnClick({R.id.iv_edit_clear})
|
||||
public void onViewClicked(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.iv_edit_clear:
|
||||
etHallName.setText("");
|
||||
break;
|
||||
if (view.getId() == R.id.iv_edit_clear) {
|
||||
etHallName.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,14 +75,14 @@ public class HallNameSettingActivity extends BaseMvpActivity<IHallNameView, Hall
|
||||
}
|
||||
|
||||
private void commit(String hallName) {
|
||||
if (TextUtils.isEmpty(hallName)){
|
||||
SingleToastUtil.showToastShort("公会名不能为空");
|
||||
if (TextUtils.isEmpty(hallName)) {
|
||||
SingleToastUtil.showToastShort("房间名不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (hallName.length() > MAX_HALL_NAME_LIMIT) {
|
||||
SingleToastUtil.showToastShort("公会名不能超过15个字");
|
||||
SingleToastUtil.showToastShort("房间名不能超过15个字");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -81,6 +81,7 @@ public class ModuleClanActivity extends BaseActivity implements View.OnClickList
|
||||
binding.ivBack.setOnClickListener(this);
|
||||
binding.tvHallAdmin.setOnClickListener(this);
|
||||
binding.tvHallIncome.setOnClickListener(this);
|
||||
binding.ivHallMemberSearch.setOnClickListener(this);
|
||||
otherUid = getIntent().getLongExtra(KEY_OTHER_UID, AuthModel.get().getCurrentUid());
|
||||
isSelfClan = otherUid == AuthModel.get().getCurrentUid();
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
@@ -129,6 +130,9 @@ public class ModuleClanActivity extends BaseActivity implements View.OnClickList
|
||||
if (isSelfClan) {
|
||||
HallDataManager.get().updateHallInfo(clanAndHallInfo);
|
||||
}
|
||||
if ((HallDataManager.get().isManager() && isSelfClan) || clanAndHallInfo.isManageHall()) {
|
||||
binding.ivHallMemberSearch.setVisibility(View.VISIBLE);
|
||||
}
|
||||
clanInfo = clanAndHallInfo.getClan();
|
||||
if (clanInfo != null && clanInfo.getId() != 0) {
|
||||
binding.clClan.setVisibility(View.VISIBLE);
|
||||
@@ -248,11 +252,14 @@ public class ModuleClanActivity extends BaseActivity implements View.OnClickList
|
||||
break;
|
||||
case R.id.tv_hall_admin:
|
||||
if (clanInfo != null) {
|
||||
SuperAdminManageActivity.start(this,clanInfo.getId());
|
||||
SuperAdminManageActivity.start(this, clanInfo.getId());
|
||||
} else {
|
||||
toast("数据加载中,请稍后...");
|
||||
}
|
||||
break;
|
||||
case R.id.iv_hall_member_search:
|
||||
MemberSearchActivity.start(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -69,7 +69,7 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
|
||||
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.putExtra(KEY_HALL_ID, hallId);
|
||||
intent.putExtra(KEY_OWNER_UID, ownerUid);
|
||||
@@ -80,7 +80,7 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
public static void start(Context context) {
|
||||
StatisticManager.Instance().onEvent(BasicConfig.INSTANCE.getAppContext(),
|
||||
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
|
||||
@@ -94,7 +94,7 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
binding.ivSetting.setOnClickListener(this);
|
||||
hallId = getIntent().getLongExtra(KEY_HALL_ID, HallModel.get().getHallId());
|
||||
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();
|
||||
binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
@@ -124,15 +124,10 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
mGroupMemberListAdapter.setOnLoadMoreListener(() -> loadMembers(false), binding.recyclerView);
|
||||
binding.recyclerView.setAdapter(mGroupMemberListAdapter);
|
||||
setTvCount(0);
|
||||
if (HallDataManager.get().isManager() && isSelfHall) {
|
||||
getMvpPresenter().getHallAuths();
|
||||
} else {
|
||||
binding.ivHallMemberSearch.setVisibility(View.GONE);
|
||||
}
|
||||
EventBus.getDefault().register(this);
|
||||
binding.nsvHall.setNestedScrollingEnabled(false);
|
||||
initClanAndHall();
|
||||
setMoreOption(HallDataManager.get().isManager() && isSelfHall);
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint({"CheckResult", "SetTextI18n"})
|
||||
@@ -147,16 +142,11 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(clanAndHallInfo -> {
|
||||
HallInfo hallInfo = clanAndHallInfo.getHall();
|
||||
ClanInfo clanInfo = clanAndHallInfo.getClan();
|
||||
/* 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);
|
||||
setSettingOption((HallDataManager.get().isManager() && isSelfHall) || clanAndHallInfo.isManageHall());
|
||||
if (hallInfo != null && hallInfo.getHallId() != 0) {
|
||||
binding.clHall.setVisibility(View.VISIBLE);
|
||||
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());
|
||||
|
||||
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) {
|
||||
if (gone) {
|
||||
binding.ivSetting.setVisibility(View.GONE);
|
||||
} else {
|
||||
binding.ivSetting.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setMoreOption(boolean hasOption) {
|
||||
if (hasOption) {
|
||||
private void setSettingOption(boolean visible) {
|
||||
if (visible) {
|
||||
binding.ivHallMemberSearch.setVisibility(View.VISIBLE);
|
||||
getMvpPresenter().getHallAuths();
|
||||
binding.ivHallMemberMore.setVisibility(View.VISIBLE);
|
||||
binding.ivSetting.setVisibility(View.VISIBLE);
|
||||
binding.tvExit.setVisibility(View.GONE);
|
||||
} else {
|
||||
binding.ivSetting.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();
|
||||
break;
|
||||
case R.id.iv_setting:
|
||||
if (HallDataManager.get().getRoleType() == RoleType.OWNER) {
|
||||
showMenuDialog(view);
|
||||
} else {
|
||||
showExitHallDialog(view);
|
||||
}
|
||||
HallNameSettingActivity.start(ModuleHallActivity.this);
|
||||
break;
|
||||
case R.id.tv_exit:
|
||||
showExitDialog();
|
||||
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) {
|
||||
switch (code) {
|
||||
case AuthInfo.AUTH_APPLY_HALL_EXIT:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.yizhuan.erban.module_hall.hall.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@@ -29,7 +30,7 @@ class SuperAdminAddActivity : BaseViewBindingActivity<ActivitySuperAdminAddBindi
|
||||
private val adminAdapter = SearchAdminAdapter()
|
||||
private lateinit var rvDelegate: RVDelegate<SuperAdminInfo>
|
||||
private val clanId by lazy { intent.getLongExtra("clanId", 0) }
|
||||
|
||||
private var searchId = 0L
|
||||
override fun init() {
|
||||
|
||||
rvDelegate = RVDelegate.Builder<SuperAdminInfo>()
|
||||
@@ -52,13 +53,8 @@ class SuperAdminAddActivity : BaseViewBindingActivity<ActivitySuperAdminAddBindi
|
||||
if (id == null) {
|
||||
"请输入音游号!".toast()
|
||||
} else {
|
||||
HallModel.get().searchSuperAdminInfo(id)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
rvDelegate.setNewData(listOf(it))
|
||||
}, {
|
||||
it.message.toast()
|
||||
})
|
||||
searchId = id
|
||||
loadData()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 setStatusBar() {
|
||||
|
@@ -1,15 +1,26 @@
|
||||
package com.yizhuan.erban.module_hall.hall.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
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 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.common.EmptyViewHelper
|
||||
import com.yizhuan.erban.databinding.ActivitySuperAdminManegeBinding
|
||||
import com.yizhuan.erban.module_hall.hall.adapter.ManageSuperAdminAdapter
|
||||
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.utils.toast
|
||||
|
||||
class SuperAdminManageActivity : BaseViewBindingActivity<ActivitySuperAdminManegeBinding>() {
|
||||
|
||||
@@ -28,6 +39,8 @@ class SuperAdminManageActivity : BaseViewBindingActivity<ActivitySuperAdminManeg
|
||||
private val pageSize = 20
|
||||
private val clanId by lazy { intent.getLongExtra("clanId", 0) }
|
||||
|
||||
private lateinit var popupWindow: PopupWindow
|
||||
|
||||
override fun init() {
|
||||
|
||||
initWhiteTitleBar("公会超管设置")
|
||||
@@ -43,8 +56,65 @@ class SuperAdminManageActivity : BaseViewBindingActivity<ActivitySuperAdminManeg
|
||||
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 setStatusBar() {
|
||||
|
@@ -74,6 +74,9 @@ public class GroupMemberListAdapter extends BaseQuickAdapter<MemberInfo, BaseVie
|
||||
} else if (item.getRoleType() == RoleType.CLAN_HALL_OWNER) {
|
||||
holder.setVisible(R.id.iv_type, true);
|
||||
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 {
|
||||
holder.setVisible(R.id.iv_type, false);
|
||||
}
|
||||
|
@@ -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.BaseViewHolder
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.module_hall.hall.bean.SuperAdminHall
|
||||
@@ -11,7 +12,13 @@ class ManageRoomAdapter :
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
@@ -15,7 +15,11 @@ class ManageSuperAdminAdapter :
|
||||
BaseQuickAdapter<SuperAdminInfo, BaseViewHolder>(R.layout.item_manage_super_admin) {
|
||||
|
||||
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)
|
||||
if (rvRoom.adapter == null) {
|
||||
@@ -32,6 +36,6 @@ class ManageSuperAdminAdapter :
|
||||
.setAdapter(ManageRoomAdapter())
|
||||
.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 |
@@ -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>
|
@@ -209,6 +209,14 @@
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
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>
|
||||
|
||||
|
||||
|
@@ -104,8 +104,7 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/cl_hall"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/item_tab_small"
|
||||
tools:visibility="visible" />
|
||||
tools:listitem="@layout/item_tab_small" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_member_list"
|
||||
@@ -143,15 +142,18 @@
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
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:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_hall_member_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:drawableEnd="@drawable/ic_hall_member_more"
|
||||
android:text="管理"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
@@ -219,14 +221,14 @@
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_edit"
|
||||
android:id="@+id/tv_exit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="编辑"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:text="退出房间"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@@ -46,7 +46,7 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="请输入公会成员音游号"
|
||||
android:inputType="text"
|
||||
android:inputType="number"
|
||||
android:maxLength="20"
|
||||
android:maxLines="1"
|
||||
android:text=""
|
||||
|
@@ -16,9 +16,17 @@
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="65dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
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
|
||||
android:id="@+id/tv_add_super_admin"
|
||||
android:layout_width="300dp"
|
||||
|
@@ -16,9 +16,17 @@
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="65dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
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
|
||||
android:id="@+id/tv_add_super_admin"
|
||||
android:layout_width="300dp"
|
||||
|
@@ -61,7 +61,7 @@
|
||||
android:id="@+id/iv_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@drawable/ic_hall_manage_more"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -73,17 +73,19 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:text="管理的房间"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_avatar"
|
||||
tools:text="管理的房间" />
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_avatar" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_room"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_manage_room" />
|
||||
|
@@ -52,14 +52,16 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_set"
|
||||
android:layout_width="90dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
android:gravity="center"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:text="设置为超管"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginEnd="15dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
32
app/src/module_labour_union/res/layout/popup_admin_more.xml
Normal file
32
app/src/module_labour_union/res/layout/popup_admin_more.xml
Normal 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>
|
@@ -301,13 +301,30 @@ public class HallModel extends BaseModel implements IHallModel {
|
||||
.compose(RxHelper.handleCommon());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Single<String> setSuperAdmin(String roomUids ,long uid) {
|
||||
return api.setSuperAdmin(roomUids,uid)
|
||||
.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 {
|
||||
/**
|
||||
@@ -477,6 +494,12 @@ public class HallModel extends BaseModel implements IHallModel {
|
||||
@GET("/hall/superManager/search")
|
||||
Single<ServiceResult<SuperAdminInfo>> searchSuperAdminInfo(@Query("erbanNo") long erbanNo);
|
||||
|
||||
/**
|
||||
* 移除超管
|
||||
*/
|
||||
@GET("/hall/superManager/remove")
|
||||
Single<ServiceResult<String>> removeSuperAdmin(@Query("targetUid") long targetUid);
|
||||
|
||||
/**
|
||||
* 设置超管信息
|
||||
* @param roomUids 设置的房间uid,都会隔开
|
||||
@@ -486,5 +509,17 @@ public class HallModel extends BaseModel implements IHallModel {
|
||||
@POST("/hall/superManager/setSuperManage")
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
@@ -81,4 +81,10 @@ public interface IHallModel {
|
||||
Single<SuperAdminInfo> searchSuperAdminInfo(long erbanNo);
|
||||
|
||||
Single<String> setSuperAdmin(String roomUids ,long uid);
|
||||
|
||||
Single<List<SuperAdminInfo>> getRoomSuperAdminList(long roomUid);
|
||||
|
||||
Single<List<SuperAdminInfo>> getClanSuperAdminList(long clanId);
|
||||
|
||||
Single<String> removeSuperAdmin(long uid);
|
||||
}
|
||||
|
@@ -6,4 +6,5 @@ import lombok.Data;
|
||||
public class ClanAndHallInfo {
|
||||
private ClanInfo clan;
|
||||
private HallInfo hall;
|
||||
private boolean manageHall;
|
||||
}
|
||||
|
@@ -6,14 +6,29 @@ package com.yizhuan.xchat_android_core.module_hall.hall.bean;
|
||||
*/
|
||||
|
||||
public interface RoleType {
|
||||
/**厅主*/
|
||||
/**
|
||||
* 厅主
|
||||
*/
|
||||
int OWNER = 1;
|
||||
/**高管*/
|
||||
/**
|
||||
* 高管
|
||||
*/
|
||||
int ADMIN = 2;
|
||||
/**普通成员*/
|
||||
/**
|
||||
* 普通成员
|
||||
*/
|
||||
int NORMAL = 3;
|
||||
/**族长*/
|
||||
/**
|
||||
* 族长
|
||||
*/
|
||||
int CLAN_OWNER = 4;
|
||||
/**族长,会长*/
|
||||
/**
|
||||
* 族长,会长
|
||||
*/
|
||||
int CLAN_HALL_OWNER = 5;
|
||||
/**
|
||||
* 超管
|
||||
*/
|
||||
int CLAN_SUPER_ADMIN = 6;
|
||||
|
||||
}
|
||||
|
@@ -6,5 +6,6 @@ data class SuperAdminInfo(
|
||||
val gender: Int = 0,
|
||||
var hasSet: Boolean = false,
|
||||
val nick: String? = null,
|
||||
val uid: Long = 0
|
||||
val uid: Long = 0,
|
||||
val roomList: List<SuperAdminHall>? = null
|
||||
)
|
@@ -34,18 +34,22 @@ public class ScreenUtil {
|
||||
}
|
||||
|
||||
public static int dip2px(float dipValue) {
|
||||
init(NimUIKit.getContext());
|
||||
return (int) (dipValue * density + 0.5f);
|
||||
}
|
||||
|
||||
public static int px2dip(float pxValue) {
|
||||
init(NimUIKit.getContext());
|
||||
return (int) (pxValue / density + 0.5f);
|
||||
}
|
||||
|
||||
public static int sp2px(float spValue) {
|
||||
init(NimUIKit.getContext());
|
||||
return (int) (spValue * scaleDensity + 0.5f);
|
||||
}
|
||||
|
||||
public static int getDialogWidth() {
|
||||
init(NimUIKit.getContext());
|
||||
dialogWidth = (int) (screenMin * RATIO);
|
||||
return dialogWidth;
|
||||
}
|
||||
@@ -68,6 +72,7 @@ public class ScreenUtil {
|
||||
}
|
||||
|
||||
public static int getDisplayWidth() {
|
||||
init(NimUIKit.getContext());
|
||||
if (screenWidth == 0) {
|
||||
GetInfo(NimUIKit.getContext());
|
||||
}
|
||||
@@ -75,6 +80,7 @@ public class ScreenUtil {
|
||||
}
|
||||
|
||||
public static int getDisplayHeight() {
|
||||
init(NimUIKit.getContext());
|
||||
if (screenHeight == 0) {
|
||||
GetInfo(NimUIKit.getContext());
|
||||
}
|
||||
@@ -88,8 +94,8 @@ public class ScreenUtil {
|
||||
DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics();
|
||||
screenWidth = dm.widthPixels;
|
||||
screenHeight = dm.heightPixels;
|
||||
screenMin = (screenWidth > screenHeight) ? screenHeight : screenWidth;
|
||||
screenMax = (screenWidth < screenHeight) ? screenHeight : screenWidth;
|
||||
screenMin = Math.min(screenWidth, screenHeight);
|
||||
screenMax = Math.max(screenWidth, screenHeight);
|
||||
density = dm.density;
|
||||
scaleDensity = dm.scaledDensity;
|
||||
xdpi = dm.xdpi;
|
||||
|
Reference in New Issue
Block a user