直播间UI调整,修改悬浮

This commit is contained in:
18401019693 2022-10-26 15:28:03 +08:00
parent af7a8965a7
commit 787d50c5b4
11 changed files with 52 additions and 89 deletions

View File

@ -1,5 +1,6 @@
package com.yunbao.common.manager;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.text.TextUtils;
@ -7,6 +8,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.lzf.easyfloat.EasyFloat;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.DataUserInfoEvent;
import com.yunbao.common.http.HttpCallback;
@ -15,6 +17,7 @@ import com.yunbao.common.manager.base.BaseCacheManager;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.views.floatingview.APPEasyFloat;
import org.greenrobot.eventbus.EventBus;
@ -287,23 +290,26 @@ public class IMLoginManager extends BaseCacheManager {
/**
* 退出登录
*/
public void logout() {
public void logout(Activity activity) {
//删除用户登录信息
deleteByKey(KEY_USER_INFO);
deleteByKey(isNewUserGif);
deleteByKey(isNewUserOne);
//清理指导员信息
NoviceInstructorManager.get(context).deleteOfLogin();
NoviceInstructorManager.get(activity).deleteOfLogin();
//用户对象置空
userInfo = null;
manager = null;
//删除私聊对话
// IMCenter.getInstance().clearConversations(null, Conversation.ConversationType.PRIVATE);
RongcloudIMManager.logoutIM();
MessageIMManager.get(context).logout();
MessageIMManager.get(activity).logout();
put(IS_HINT, 0);
APPEasyFloat.getInstance().dismiss(activity);
if (EasyFloat.isShow("LiveFloatView")) {
EasyFloat.dismiss("LiveFloatView", true);
}
}
/**

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -628,22 +628,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveRoomViewHolder.initHourRankList();
}
mLiveRoomViewHolder.startAnchorLight();
//心愿单
LiveHttpUtil.getWishList(mLiveUid, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (info.length > 0) {
String json = info[0];
WishlistModel model = GsonUtils.fromJson(json, WishlistModel.class);
if (mLiveRoomViewHolder != null && model != null) {
mLiveRoomViewHolder.initWishList(model.getWishlist());
}
}
}
@Override
public void onFinish() {
}
});
}
if (mLiveAnchorViewHolder == null) {
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);

View File

@ -387,32 +387,9 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
LiveRoomViewHolder.insertChat(lvBean2, 1);
}
}, 10000);//3秒后执行Runnable中的run方法
getNewPeopleInfo(false);
}
public void getNewPeopleInfo(boolean show) {
API.get().pdLiveApi(mContext)
.getNewPeopleInfo()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(stringResponseModel -> {
NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo();
if (peopleInfo.getIsShow()) {
liveNewPeople.setVisibility(View.VISIBLE);
if (peopleInfo.getLink().startsWith("http")) {
newPeopleUrl = peopleInfo.getLink() + "?";
} else {
newPeopleUrl = CommonAppConfig.HOST + "/" + peopleInfo.getLink();
}
setUserPreferentialRedDot(peopleInfo.getShowRed() == 1);
if (show) {
openNewPeopleDialog();
}
} else {
liveNewPeople.setVisibility(View.GONE);
}
}, Throwable::printStackTrace).isDisposed();
}
@Override
public void onClick(View v) {
@ -448,7 +425,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
*/
public void openNewPeopleDialog() {
if (newPeopleUrl == null) {
getNewPeopleInfo(true);
// getNewPeopleInfo(true);
return;
}
Bundle bundle = new Bundle();

View File

@ -1463,6 +1463,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* @param giftCount 礼物数量
*/
public void updataWishList(String giftId, int giftCount) {
if (!(mContext instanceof LiveAudienceActivity)){
for (WishlistItemModel model : wishlist) {
if (TextUtils.equals(giftId, model.getLid())) {
int number = Integer.parseInt(model.getWishlistProgress()) + giftCount;
@ -1475,6 +1476,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
initWishList(wishlist);
}
}
//点击头像
private void clickAvatar() {
livePKUserListBean = new LivePKUserListBean();

View File

@ -117,7 +117,7 @@
</LinearLayout>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignParentBottom="true">
@ -237,7 +237,7 @@
android:src="@mipmap/icon_live_red_pack"
android:visibility="gone" />
<!--聊天-->
<LinearLayout
android:id="@+id/message_layout"
android:layout_width="84dp"
@ -288,13 +288,12 @@
</LinearLayout>
<!--消息中心-->
<RelativeLayout
android:id="@+id/msg_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/message_layout">
android:layout_marginStart="9dp">
<RelativeLayout
android:id="@+id/rt_msg"
@ -341,42 +340,25 @@
android:visibility="invisible" />
</RelativeLayout>
<!--普通工具合集-->
<ImageView
android:id="@+id/total_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/msg_view"
android:layout_marginStart="13dp"
android:padding="5dp"
android:src="@mipmap/live_icon_more" />
<ImageView
android:id="@+id/gift_image"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"
android:layout_marginBottom="5dp"
android:src="@mipmap/live_lw" />
<ImageView
android:id="@+id/live_new_people1"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/gift_image"
android:padding="4dp"
android:src="@mipmap/live_icon_newpeople_en"
android:visibility="gone" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<!--新人特惠-->
<RelativeLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/gift_image"
android:layout_marginEnd="13dp"
android:visibility="gone"
android:padding="4dp">
<ImageView
@ -397,7 +379,17 @@
android:background="@drawable/background_ff5075"
android:visibility="invisible" />
</RelativeLayout>
</RelativeLayout>
<!--礼物-->
<ImageView
android:id="@+id/gift_image"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="5dp"
android:src="@mipmap/live_lw" />
</LinearLayout>
<com.opensource.svgaplayer.SVGAImageView

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -181,7 +181,7 @@ public class EntryActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_entry);
if (getIntent().getBooleanExtra("forwardEntry", false)) {
IMLoginManager.get(this).logout();
IMLoginManager.get(this).logout(this);
ToastUtil.show(R.string.login_invalid);
}
Get_hash_key();

View File

@ -38,7 +38,7 @@ public class LoginInvalidActivity extends AbsActivity implements View.OnClickLis
public void onClick(View v) {
EventBus.getDefault().post(new LoginInvalidEvent());
CommonAppConfig.getInstance().clearLoginInfo();
IMLoginManager.get(this).logout();
IMLoginManager.get(this).logout(this);
LoginActivity.forward();
finish();
}

View File

@ -1191,7 +1191,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void userSignOut(RongIMConnectionStatusEvent model) {
IMLoginManager.get(mContext).logout();
IMLoginManager.get(mContext).logout(this);
CommonAppConfig.getInstance().clearLoginInfo();
LoginActivity.forward();
}

View File

@ -312,7 +312,7 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
* 退出登录
*/
private void logout() {
IMLoginManager.get(this).logout();
IMLoginManager.get(this).logout(this);
CommonAppConfig.getInstance().clearLoginInfo();
RCRTCEngine.getInstance().unInit();
RongIMClient.getInstance().logout();