RTL适配:房间用户卡片底部操作按钮移动到上面的操作按钮区
This commit is contained in:
@@ -278,8 +278,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
|
||||
myUid = AuthModel.get().getCurrentUid();
|
||||
|
||||
addViewItems();
|
||||
addMainAndMicBottons();
|
||||
loadButtons();
|
||||
subscribe = IMNetEaseManager.get().getChatRoomEventObservable().subscribe(this::onReceiveRoomEvent);
|
||||
initAttentData();
|
||||
initDatingData();
|
||||
@@ -347,7 +346,6 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
private void setMicViewVisiable(boolean isVisiable) {
|
||||
findViewById(R.id.recycler_view_mic).setVisibility(isVisiable ? View.VISIBLE : View.GONE);
|
||||
findViewById(R.id.layout_grid_button).setVisibility(isVisiable ? View.GONE : View.VISIBLE);
|
||||
findViewById(R.id.ll_bottom_buttons).setVisibility(isVisiable ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
private void updateAttentView() {
|
||||
@@ -358,7 +356,18 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
isAttention ? R.drawable.icon_dialog_cancel_attent : R.drawable.icon_dialog_attent);
|
||||
}
|
||||
|
||||
private void addViewItems() {
|
||||
private void loadButtons() {
|
||||
if (buttons == null) {
|
||||
buttons = new ArrayList<>();
|
||||
}
|
||||
List<ViewItem> items = addMainAndMicBottons();
|
||||
if (items != null) {
|
||||
buttons.addAll(items);
|
||||
}
|
||||
addViewItems(items);
|
||||
}
|
||||
|
||||
private void addViewItems(List<ViewItem> buttons) {
|
||||
if (ListUtils.isListEmpty(buttons)) {
|
||||
findViewById(R.id.layout_grid_button).setVisibility(View.GONE);
|
||||
return;
|
||||
@@ -376,6 +385,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
item.getLayoutParams().width = itemWidth;
|
||||
TextView textView = item.findViewById(R.id.text);
|
||||
textView.setText(buttonItem.mText);
|
||||
textView.setGravity(Gravity.CENTER);
|
||||
ImageView imageView = item.findViewById(R.id.image);
|
||||
imageView.setImageResource(buttonItem.imgRes);
|
||||
//关注按钮的处理
|
||||
@@ -425,15 +435,11 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
/**
|
||||
* 添加主页麦位操作的button
|
||||
*/
|
||||
private void addMainAndMicBottons() {
|
||||
LinearLayout llBottomButtons = findViewById(R.id.ll_bottom_buttons);
|
||||
if (llBottomButtons == null) return;
|
||||
llBottomButtons.removeAllViews();
|
||||
private List<ViewItem> addMainAndMicBottons() {
|
||||
if (!isInRoom) {
|
||||
hideBottom();
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
List<TextView> bottomList = getMicRelativeButtons(String.valueOf(uid));
|
||||
List<ViewItem> bottomList = getMicRelativeButtons(String.valueOf(uid));
|
||||
//如果用户在麦上,而且登录用户是管理员,则显示此按钮
|
||||
if (AvRoomDataManager.get().isShowGiftValue()
|
||||
&& AvRoomDataManager.get().isManager()) {
|
||||
@@ -449,63 +455,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ListUtils.isListEmpty(bottomList)) {
|
||||
hideBottom();
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < bottomList.size(); i++) {
|
||||
TextView textView = bottomList.get(i);
|
||||
textView.setVisibility(View.INVISIBLE);
|
||||
llBottomButtons.addView(textView);
|
||||
}
|
||||
llBottomButtons.post(() -> {
|
||||
int parentWidth = llBottomButtons.getMeasuredWidth();
|
||||
int childCount = bottomList.size();
|
||||
if (bottomList.size() == 1) {
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(parentWidth,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
TextView textView = bottomList.get(0);
|
||||
textView.setVisibility(View.VISIBLE);
|
||||
textView.setLayoutParams(params);
|
||||
return;
|
||||
}
|
||||
int[] wrapWidth = new int[childCount];
|
||||
int childWidths = 0;
|
||||
for (int i = 0; i < bottomList.size(); i++) {
|
||||
TextView textView = bottomList.get(i);
|
||||
int width = textView.getMeasuredWidth();
|
||||
wrapWidth[i] = width;
|
||||
childWidths += width;
|
||||
}
|
||||
//空白是多少
|
||||
int paddingSpace = (parentWidth - childWidths) / (childCount * 2);
|
||||
//剩余是多少px
|
||||
int leftPx = (parentWidth - childWidths) - paddingSpace * (childCount * 2);
|
||||
leftPx = leftPx / childCount;
|
||||
//重新计算item的宽度
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
wrapWidth[i] = wrapWidth[i] + 2 * paddingSpace;
|
||||
}
|
||||
for (int i = 0; i < llBottomButtons.getChildCount(); i++) {
|
||||
View textView = llBottomButtons.getChildAt(i);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(wrapWidth[i] + leftPx,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
textView.setLayoutParams(params);
|
||||
textView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void hideBottom() {
|
||||
LinearLayout llBottomButtons = findViewById(R.id.ll_bottom_buttons);
|
||||
if (llBottomButtons != null) {
|
||||
llBottomButtons.setVisibility(View.GONE);
|
||||
}
|
||||
View lineBottom = findViewById(R.id.line_bottom);
|
||||
if (lineBottom != null) {
|
||||
lineBottom.setVisibility(View.GONE);
|
||||
}
|
||||
return bottomList;
|
||||
}
|
||||
|
||||
private void onReceiveRoomEvent(RoomEvent roomEvent) {
|
||||
@@ -786,7 +736,6 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
dismiss();
|
||||
break;
|
||||
case R.id.fl_avatar_layout:
|
||||
case R.id.user_info_page_btn:
|
||||
UserInfoActivity.Companion.start(context, uid);
|
||||
dismiss();
|
||||
break;
|
||||
@@ -846,8 +795,8 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
* 不去判断用户在不在房间
|
||||
* 麦位操作相关的一些操作,比如上下麦
|
||||
*/
|
||||
public List<TextView> getMicRelativeButtons(String account) {
|
||||
List<TextView> buttonItems = new ArrayList<>();
|
||||
public List<ViewItem> getMicRelativeButtons(String account) {
|
||||
List<ViewItem> buttonItems = new ArrayList<>();
|
||||
final RoomInfo currentRoom = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoom == null) return buttonItems;
|
||||
//根据账号查询在哪个坑位
|
||||
@@ -1063,7 +1012,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
* 如果是超管点开资料卡片,隐藏
|
||||
* 抱ta上麦
|
||||
*/
|
||||
private void handleInviteMicItem(List<TextView> buttonItems) {
|
||||
private void handleInviteMicItem(List<ViewItem> buttonItems) {
|
||||
if (!SuperAdminUtil.isSuperAdmin() &&
|
||||
!(AvRoomDataManager.get().isSingleRoom() && AvRoomDataManager.get().isOpenAnotherPKMode())) {
|
||||
buttonItems.add(createInviteMicItem());
|
||||
@@ -1080,39 +1029,40 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
return textView;
|
||||
}
|
||||
|
||||
private TextView createClearGiftValueItem() {
|
||||
TextView textView = getTextView(getString(R.string.ui_widget_userinfodialog_013));
|
||||
|
||||
textView.setOnClickListener(v -> {
|
||||
GiftValueModel.get().clearSingleMicValue(uid).subscribe(new DontWarnObserver<RoomGiftValue>() {
|
||||
@Override
|
||||
public void accept(RoomGiftValue roomGiftValue, String error) {
|
||||
super.accept(roomGiftValue, error);
|
||||
if (roomGiftValue == null) {
|
||||
return;
|
||||
private ViewItem createClearGiftValueItem() {
|
||||
return new ViewItem(getString(R.string.ui_widget_userinfodialog_013), R.drawable.user_card_ic_clean_gift_value, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
GiftValueModel.get().clearSingleMicValue(uid).subscribe(new DontWarnObserver<RoomGiftValue>() {
|
||||
@Override
|
||||
public void accept(RoomGiftValue roomGiftValue, String error) {
|
||||
super.accept(roomGiftValue, error);
|
||||
if (roomGiftValue == null) {
|
||||
return;
|
||||
}
|
||||
if (error != null) {
|
||||
SingleToastUtil.showToast(error);
|
||||
return;
|
||||
}
|
||||
SingleToastUtil.showToast(getString(R.string.ui_widget_userinfodialog_014));
|
||||
GiftValueMrg.get().updateRoomGiftValue(roomGiftValue, true);
|
||||
//通知房间其他用户更新
|
||||
GiftValueMrg.get().sendRoomGiftValueMsg(roomGiftValue);
|
||||
}
|
||||
if (error != null) {
|
||||
SingleToastUtil.showToast(error);
|
||||
return;
|
||||
}
|
||||
SingleToastUtil.showToast(getString(R.string.ui_widget_userinfodialog_014));
|
||||
GiftValueMrg.get().updateRoomGiftValue(roomGiftValue, true);
|
||||
//通知房间其他用户更新
|
||||
GiftValueMrg.get().sendRoomGiftValueMsg(roomGiftValue);
|
||||
}
|
||||
});
|
||||
dismiss();
|
||||
});
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
private TextView createDownMicItem() {
|
||||
TextView textView = getTextView(getString(R.string.ui_widget_userinfodialog_016));
|
||||
textView.setOnClickListener(v -> {
|
||||
showDownMicDialog();
|
||||
dismiss();
|
||||
private ViewItem createDownMicItem() {
|
||||
return new ViewItem(getString(R.string.ui_widget_userinfodialog_016), R.drawable.user_card_ic_down_mic_listen, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
showDownMicDialog();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1211,192 +1161,192 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
);
|
||||
}
|
||||
|
||||
private TextView createBanMicItem(int micPosition) {
|
||||
TextView textView = getTextView(getString(R.string.ui_widget_userinfodialog_019));
|
||||
textView.setOnClickListener(v -> {
|
||||
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
mSuperAdminModel.roomOperate(SuperAdminModel.CLOSE_MIC).subscribe();
|
||||
homePartyModel.closeMicroPhone(micPosition, roomInfo.getUid()).subscribe();
|
||||
dismiss();
|
||||
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
private TextView createOpenMicItem(int micPosition) {
|
||||
TextView textView = getTextView(getString(R.string.ui_widget_userinfodialog_021));
|
||||
textView.setOnClickListener(v -> {
|
||||
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
homePartyModel.openMicroPhone(micPosition, roomInfo.getUid()).subscribe();
|
||||
dismiss();
|
||||
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
private TextView createLockMicItem(int micPosition) {
|
||||
TextView textView = getTextView(getString(R.string.ui_widget_userinfodialog_022));
|
||||
textView.setOnClickListener(v -> {
|
||||
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isQueuingMicro()) {
|
||||
SingleToastUtil.showToast(getString(R.string.ui_widget_userinfodialog_024));
|
||||
return;
|
||||
}
|
||||
mSuperAdminModel.roomOperate(SuperAdminModel.LOCK_MIC).subscribe();
|
||||
|
||||
homePartyModel.lockMicroPhone(micPosition, roomInfo.getUid() + "",
|
||||
AuthModel.get().getTicket()).subscribe();
|
||||
dismiss();
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
private TextView createUnLockMicItem(int micPosition) {
|
||||
TextView textView = getTextView(getString(R.string.ui_widget_userinfodialog_025));
|
||||
textView.setOnClickListener(v -> {
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isQueuingMicro()) {
|
||||
SingleToastUtil.showToast(getString(R.string.ui_widget_userinfodialog_026));
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenPKMode()) {
|
||||
SingleToastUtil.showToast(getString(R.string.ui_widget_userinfodialog_027));
|
||||
return;
|
||||
}
|
||||
homePartyModel.unLockMicroPhone(micPosition, roomInfo.getUid() + "",
|
||||
AuthModel.get().getTicket()).subscribe();
|
||||
dismiss();
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
private TextView createGiveGiftMicItem() {
|
||||
TextView textView = getTextView(getString(R.string.give_gift));
|
||||
textView.setOnClickListener(view -> {
|
||||
GiftDialog dialog = new GiftDialog(context, uid, isInRoom, false, true);
|
||||
if (giftDialogBtnClickListener != null) {
|
||||
dialog.setGiftDialogBtnClickListener(giftDialogBtnClickListener);
|
||||
}
|
||||
dialog.show();
|
||||
dismiss();
|
||||
});
|
||||
return textView;
|
||||
|
||||
}
|
||||
|
||||
private TextView createInviteMicItem() {
|
||||
TextView textView = getTextView(getString(R.string.ui_widget_userinfodialog_028));
|
||||
textView.setOnClickListener(v -> {
|
||||
if (AvRoomDataManager.get().getChatRoomMember(String.valueOf(uid)) == null) {
|
||||
SingleToastUtil.showToast(context.getString(R.string.tips_member_not_in_room));
|
||||
private ViewItem createBanMicItem(int micPosition) {
|
||||
return new ViewItem(getString(R.string.ui_widget_userinfodialog_019), R.drawable.user_card_ic_close_mic, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
mSuperAdminModel.roomOperate(SuperAdminModel.CLOSE_MIC).subscribe();
|
||||
homePartyModel.closeMicroPhone(micPosition, roomInfo.getUid()).subscribe();
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
setMicViewVisiable(true);
|
||||
RecyclerView recyclerView = findViewById(R.id.recycler_view_mic);
|
||||
|
||||
UpMicAdapter adapter = new UpMicAdapter(context, uid,
|
||||
position -> {
|
||||
if (AvRoomDataManager.get().isLeaveMode() && uid == AvRoomDataManager.get().getRoomUid()) {
|
||||
SingleToastUtil.showToast(context.getString(R.string.tips_close_leave_mode_first));
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
if (isMySelf) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
//自己抱自己上麦
|
||||
AvRoomDataManager.get().haveStartDragon = false;
|
||||
homePartyModel.upMicroPhone(
|
||||
position - 1,
|
||||
String.valueOf(uid),
|
||||
String.valueOf(roomInfo.getRoomId()),
|
||||
true,
|
||||
new CallBack<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
GiftValueMrg.get().requestUpMic(position - 1, String.valueOf(uid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
|
||||
String nick = null;
|
||||
if (userInfo != null) {
|
||||
nick = userInfo.getNick();
|
||||
|
||||
if (userInfo.getDefUser() == UserInfo.USER_TYPE_ROBOT) {
|
||||
SingleToastUtil.showToast(context.getString(R.string.unable_to_up_mic_by_level));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BaseInfo baseInfo = new BaseInfo(uid, nick);
|
||||
IMNetEaseManager.get().inviteMicroPhoneBySdk(baseInfo, position - 1).subscribe();
|
||||
dismiss();
|
||||
});
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 4));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
private ViewItem createOpenMicItem(int micPosition) {
|
||||
return new ViewItem(getString(R.string.ui_widget_userinfodialog_021), R.drawable.user_card_ic_no_lock_mic, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
homePartyModel.openMicroPhone(micPosition, roomInfo.getUid()).subscribe();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ViewItem createLockMicItem(int micPosition) {
|
||||
return new ViewItem(getString(R.string.ui_widget_userinfodialog_022), R.drawable.user_card_ic_lock_mic, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isQueuingMicro()) {
|
||||
SingleToastUtil.showToast(getString(R.string.ui_widget_userinfodialog_024));
|
||||
return;
|
||||
}
|
||||
mSuperAdminModel.roomOperate(SuperAdminModel.LOCK_MIC).subscribe();
|
||||
|
||||
homePartyModel.lockMicroPhone(micPosition, roomInfo.getUid() + "",
|
||||
AuthModel.get().getTicket()).subscribe();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ViewItem createUnLockMicItem(int micPosition) {
|
||||
return new ViewItem(getString(R.string.ui_widget_userinfodialog_025), R.drawable.user_card_ic_no_lock_mic, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isQueuingMicro()) {
|
||||
SingleToastUtil.showToast(getString(R.string.ui_widget_userinfodialog_026));
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenPKMode()) {
|
||||
SingleToastUtil.showToast(getString(R.string.ui_widget_userinfodialog_027));
|
||||
return;
|
||||
}
|
||||
homePartyModel.unLockMicroPhone(micPosition, roomInfo.getUid() + "",
|
||||
AuthModel.get().getTicket()).subscribe();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ViewItem createGiveGiftMicItem() {
|
||||
return new ViewItem(getString(R.string.give_gift), R.drawable.icon_send_gift_ture, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
GiftDialog dialog = new GiftDialog(context, uid, isInRoom, false, true);
|
||||
if (giftDialogBtnClickListener != null) {
|
||||
dialog.setGiftDialogBtnClickListener(giftDialogBtnClickListener);
|
||||
}
|
||||
dialog.show();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ViewItem createInviteMicItem() {
|
||||
return new ViewItem(getString(R.string.ui_widget_userinfodialog_028), R.drawable.user_card_ic_open_mic, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
if (AvRoomDataManager.get().getChatRoomMember(String.valueOf(uid)) == null) {
|
||||
SingleToastUtil.showToast(context.getString(R.string.tips_member_not_in_room));
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
setMicViewVisiable(true);
|
||||
RecyclerView recyclerView = findViewById(R.id.recycler_view_mic);
|
||||
|
||||
UpMicAdapter adapter = new UpMicAdapter(context, uid,
|
||||
position -> {
|
||||
if (AvRoomDataManager.get().isLeaveMode() && uid == AvRoomDataManager.get().getRoomUid()) {
|
||||
SingleToastUtil.showToast(context.getString(R.string.tips_close_leave_mode_first));
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
if (isMySelf) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) {
|
||||
return;
|
||||
}
|
||||
//自己抱自己上麦
|
||||
AvRoomDataManager.get().haveStartDragon = false;
|
||||
homePartyModel.upMicroPhone(
|
||||
position - 1,
|
||||
String.valueOf(uid),
|
||||
String.valueOf(roomInfo.getRoomId()),
|
||||
true,
|
||||
new CallBack<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
GiftValueMrg.get().requestUpMic(position - 1, String.valueOf(uid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
|
||||
String nick = null;
|
||||
if (userInfo != null) {
|
||||
nick = userInfo.getNick();
|
||||
|
||||
if (userInfo.getDefUser() == UserInfo.USER_TYPE_ROBOT) {
|
||||
SingleToastUtil.showToast(context.getString(R.string.unable_to_up_mic_by_level));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BaseInfo baseInfo = new BaseInfo(uid, nick);
|
||||
IMNetEaseManager.get().inviteMicroPhoneBySdk(baseInfo, position - 1).subscribe();
|
||||
dismiss();
|
||||
});
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 4));
|
||||
recyclerView.setAdapter(adapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private TextView createKickMicItem() {
|
||||
TextView textView = getTextView(getString(R.string.ui_widget_userinfodialog_029));
|
||||
textView.setOnClickListener(v -> {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
mSuperAdminModel.roomOperate(SuperAdminModel.TAKE_OUT_MIC, uid).subscribe();
|
||||
kickDownMicCode();
|
||||
return;
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().isOnMic(uid)) {
|
||||
if (AvRoomDataManager.get().isGamePlaying(uid)) {
|
||||
new DialogManager(context).showOkCancelWithTitleDialog(getString(R.string.ui_widget_userinfodialog_031),
|
||||
(DialogManager.LambdaOkDialogListener) () -> {
|
||||
kickDownMicCode();
|
||||
dismiss();
|
||||
});
|
||||
private ViewItem createKickMicItem() {
|
||||
return new ViewItem(getString(R.string.ui_widget_userinfodialog_029), R.drawable.user_card_ic_close_mic, new ViewItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
mSuperAdminModel.roomOperate(SuperAdminModel.TAKE_OUT_MIC, uid).subscribe();
|
||||
kickDownMicCode();
|
||||
return;
|
||||
}
|
||||
|
||||
if (GiftValueDialogUiHelper.get().isNeedKickDownMicDialog()) {
|
||||
dismiss();
|
||||
GiftValueDialogUiHelper.get().showGiftValueDialog(context, null,
|
||||
GiftValueDialogUiHelper.TYPE_KICK_DOWN_MIC,
|
||||
this::kickDownMicCode);
|
||||
return;
|
||||
if (AvRoomDataManager.get().isOnMic(uid)) {
|
||||
if (AvRoomDataManager.get().isGamePlaying(uid)) {
|
||||
new DialogManager(context).showOkCancelWithTitleDialog(getString(R.string.ui_widget_userinfodialog_031),
|
||||
(DialogManager.LambdaOkDialogListener) () -> {
|
||||
kickDownMicCode();
|
||||
dismiss();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (GiftValueDialogUiHelper.get().isNeedKickDownMicDialog()) {
|
||||
dismiss();
|
||||
GiftValueDialogUiHelper.get().showGiftValueDialog(context, null,
|
||||
GiftValueDialogUiHelper.TYPE_KICK_DOWN_MIC,
|
||||
() -> kickDownMicCode());
|
||||
return;
|
||||
}
|
||||
kickDownMicCode();
|
||||
}
|
||||
kickDownMicCode();
|
||||
}
|
||||
});
|
||||
return textView;
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
|
||||
30
app/src/main/java/com/chwl/app/view/AutoMirroredImageView.kt
Normal file
30
app/src/main/java/com/chwl/app/view/AutoMirroredImageView.kt
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.chwl.app.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.util.AttributeSet
|
||||
import android.widget.ImageView
|
||||
|
||||
class AutoMirroredImageView : ImageView {
|
||||
constructor(context: Context?) : super(context)
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
override fun onDraw(canvas: Canvas?) {
|
||||
if (layoutDirection == LAYOUT_DIRECTION_RTL) {
|
||||
canvas?.scale(-1f, 1f, width / 2f, height / 2f)
|
||||
}
|
||||
super.onDraw(canvas)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 825 B |
BIN
app/src/main/res/drawable-xxhdpi/user_card_ic_close_mic.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/user_card_ic_close_mic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 933 B |
BIN
app/src/main/res/drawable-xxhdpi/user_card_ic_lock_mic.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/user_card_ic_lock_mic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 922 B |
BIN
app/src/main/res/drawable-xxhdpi/user_card_ic_no_lock_mic.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/user_card_ic_no_lock_mic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 854 B |
BIN
app/src/main/res/drawable-xxhdpi/user_card_ic_open_mic.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/user_card_ic_open_mic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 988 B |
@@ -359,31 +359,6 @@
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
app:flexWrap="wrap" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@color/line_color" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_bottom_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="43dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_info_page_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/transparent"
|
||||
android:gravity="center"
|
||||
android:text="@string/layout_dialog_user_info_09"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
Reference in New Issue
Block a user