1:修改排行榜页面,

2:修改拍卖房刷新数据
3:修改交友房刷新数据
This commit is contained in:
2025-10-25 18:07:21 +08:00
parent 529aae1fcf
commit 8ebe1530ee
128 changed files with 3640 additions and 2099 deletions

View File

@@ -11,9 +11,9 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0.0.0",
"outputFile": "羽声_1.0.0.0_1.apk"
"versionCode": 2,
"versionName": "1.0.0.1",
"outputFile": "羽声_1.0.0.1_2.apk"
}
],
"elementType": "File",
@@ -22,14 +22,14 @@
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/羽声_1.0.0.0_1.dm"
"baselineProfiles/1/羽声_1.0.0.1_2.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/羽声_1.0.0.0_1.dm"
"baselineProfiles/0/羽声_1.0.0.1_2.dm"
]
}
],

View File

@@ -196,7 +196,7 @@
android:name=".wxapi.WXEntryActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="true"
android:taskAffinity="com.xscm.qxlive"
android:taskAffinity="com.qxcm.qxlive"
android:launchMode="singleTask">
</activity>
<!-- 微信支付回调Activity必须放在包名.wxapi路径下 -->

View File

@@ -1,4 +1,4 @@
package com.xscm.midi.wxapi;
package com.qxcm.qxlive.wxapi;
import android.app.Activity;
import android.os.Bundle;

View File

@@ -1,4 +1,4 @@
package com.xscm.midi.wxapi;
package com.qxcm.qxlive.wxapi;
import android.app.Activity;
import android.content.Intent;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -1,113 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorBackground">@color/background</item>
<item name="android:textColor">@color/color_1F1C1F</item>
<item name="android:textColorHint">@color/color_FF999999</item>
<item name="android:windowBackground">@color/color_F9FAFA</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowLightStatusBar">true</item>
</style>
<style name="main_SplashThemeImage" parent="AppTheme.NoActionBar">
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<!--StartActivity Style 冷启动效果-->
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowBackground">@mipmap/screen</item>
</style>
<!-- 在 styles.xml 中添加透明主题 -->
<style name="TransparentTheme" parent="AppTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
<style name="LauncherAppTheme" parent="AppTheme">
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
<style name="AppthemeActivity" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowEnableSplitTouch">false</item>
<item name="android:windowAllowReturnTransitionOverlap">false</item>
<item name="android:windowEnterTransition">@null</item>
<item name="android:windowExitTransition">@null</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowLightStatusBar">true</item>
</style>
<style name="dialog" parent="AppTheme">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:backgroundDimAmount">0.5</item>
<!--显示区域以外是否使用黑色半透明背景-->
<item name="android:backgroundDimEnabled">true</item>
</style>
<style name="dialog2" parent="AppTheme">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/transparent</item>
<!--显示区域以外是否使用黑色半透明背景-->
<item name="android:backgroundDimEnabled">false</item>
</style>
<style name="bottomToTopAnim" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/bottomview_anim_enter</item>
<item name="android:windowExitAnimation">@anim/bottomview_anim_exit</item>
</style>
<style name="bottomToTopAnim2" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/bottomview_anim_enter_2</item>
<item name="android:windowExitAnimation">@anim/bottomview_anim_exit_2</item>
</style>
<style name="leftToRightAnim" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/left_anim_enter</item>
<item name="android:windowExitAnimation">@anim/left_anim_exit</item>
</style>
<style name="animCenter" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/anim_center_enter</item>
<item name="android:windowExitAnimation">@anim/anim_center_exit</item>
</style>
<style name="groupLast" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:layout_marginLeft">15dp</item>
<item name="android:layout_marginRight">15dp</item>
<item name="android:background">@color/gray2</item>
</style>
<style name="line2" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:background">@color/gray2</item>
</style>
<style name="edit_profile_group" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">60dp</item>
<item name="android:paddingLeft">15dp</item>
<item name="android:paddingRight">15dp</item>
</style>
</resources>

View File

@@ -28,8 +28,8 @@ isBuildModule=false
#org.gradle.deamon=false
android.injected.testOnly=false
APP_VERSION_NAME=1.0.0.0
APP_VERSION_CODE=1
APP_VERSION_NAME=1.0.0.1
APP_VERSION_CODE=2
org.gradle.jvm.toolchain.useLegacyAdapters=false
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15

View File

@@ -4,19 +4,19 @@
<activity
android:name=".activity.SwitchAccountsActivity"
android:exported="true"
android:launchMode="singleTask"/>
/>
<activity
android:name=".activity.ImproveInfoActivity"
android:exported="true"
android:launchMode="singleTask"/>
/>
<activity
android:name=".activity.ForgetPasswordActivity"
android:exported="true"
android:launchMode="singleTask"/>
/>
<activity
android:name=".activity.LoginActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
</application>

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -114,12 +114,13 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
}
QXGiftDriftView qxGiftDriftView;
protected void doDone(){}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().getDecorView().setBackgroundResource(R.mipmap.log_bj);
setContentView(getLayoutId());
doDone();
// 隐藏标题栏
if (getSupportActionBar() != null) {
getSupportActionBar().hide();

View File

@@ -50,7 +50,10 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
protected abstract P bindPresenter();
@Override
protected void doDone() {
super.doDone();
}
@Override
protected void initView() {
@@ -75,7 +78,11 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
@Override
protected void onDestroy() {
if (MvpPre != null) {
MvpPre.detachView();
try {
MvpPre.detachView();
}catch (Exception e){
e.printStackTrace();
}
}
super.onDestroy();
}

View File

@@ -2,15 +2,21 @@ package com.xscm.moduleutil.base;
import static android.app.PendingIntent.getActivity;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.core.app.ActivityOptionsCompat;
import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.callback.NavCallback;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.bean.room.RoomInfoResp;
import com.xscm.moduleutil.bean.room.RoomOnline;
import com.xscm.moduleutil.bean.room.RoomOnlineBean;
@@ -254,41 +260,41 @@ public class RoomManager {
// 获取房间数据
// 等待一段时间确保退出完成
try {
Thread.sleep(300);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
navigateToRoom(context, roomId, password, null, false);
// try {
// Thread.sleep(50);
// } catch (InterruptedException e) {
// Thread.currentThread().interrupt();
// }
// navigateToRoom(context, roomId, password, null, false);
LogUtils.dTag("RoomActivity", "fetchAndJoinRoom:"+roomId.toString());
RetrofitClient.getInstance().roomGetIn(roomId, password, new BaseObserver<RoomInfoResp>() {
// RetrofitClient.getInstance().roomGetIn(roomId, password, new BaseObserver<RoomInfoResp>() {
//
// @Override
// public void onSubscribe(Disposable d) {
// }
//
// @Override
// public void onNext(RoomInfoResp resp) {
// String appId = CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId();
// String token = resp.getUser_info().getAgora_token(); // 如果启用了鉴权才需要
// String roomId = resp.getRoom_info().getRoom_id(); // 房间 ID
// String rtm_token=resp.getUser_info().getAgora_rtm_token();
// SpUtil.setRtmToken(rtm_token);
// int uid = SpUtil.getUserId(); // 0 表示由 Agora 自动生成 UID
// boolean enableMic = false; // 是否开启麦克风
// boolean enableJs=false; // 是否开启角色
// if (resp.getUser_info().getPit_number()!=0){
// enableJs=true;
// }
// LogUtils.e("token",token);
// LogUtils.e("roomId:",roomId);
//// 初始化 Agora 并加入房间
// AgoraManager.getInstance(context)
// .joinRoom(token, roomId, uid, enableMic,enableJs);
// cacheRoomData(roomId, resp);
// navigateToRoom(context, roomId, password, resp);
// }
// });
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(RoomInfoResp resp) {
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId();
String token = resp.getUser_info().getAgora_token(); // 如果启用了鉴权才需要
String roomId = resp.getRoom_info().getRoom_id(); // 房间 ID
String rtm_token = resp.getUser_info().getAgora_rtm_token();
SpUtil.setRtmToken(rtm_token);
int uid = SpUtil.getUserId(); // 0 表示由 Agora 自动生成 UID
boolean enableMic = false; // 是否开启麦克风
boolean enableJs = false; // 是否开启角色
if (resp.getUser_info().getPit_number() != 0) {
enableJs = true;
}
LogUtils.e("token", token);
LogUtils.e("roomId:", roomId);
// 初始化 Agora 并加入房间
AgoraManager.getInstance(context)
.joinRoom(token, roomId, uid, enableMic, enableJs);
cacheRoomData(roomId, resp);
navigateToRoom(context, roomId, password, resp, false);
}
});
}
/**
@@ -323,18 +329,21 @@ public class RoomManager {
* @param roomInfo 房间信息
*/
private void navigateToRoom(Context context, String roomId, String password, RoomInfoResp roomInfo, boolean isOnline) {
LogUtils.dTag("RoomActivity", "navigateToRoom"+roomInfo.toString());
try {
// 构建跳转参数
Bundle bundle = new Bundle();
bundle.putString("roomId", roomId);
bundle.putBoolean("isOnline", isOnline);
bundle.putSerializable("roomInfo", roomInfo);
if (!TextUtils.isEmpty(password)) {
bundle.putString("password", password);
}
if (roomInfo != null) {
// bundle.putSerializable("roomInfo", roomInfo);
if (roomInfo == null){
LogUtils.dTag("RoomActivity", "navigateToRoom:房间信息获取存在问题");
return;
}
// 使用ARouter跳转到房间页面

View File

@@ -90,7 +90,7 @@ public class RoomMessageEvent {
private String from_pit_number;
private String to_pit_number;
private String gift_num;
private int gift_num;
private RedPacketInfo redpacketInfo;
private String redpacket_id;

View File

@@ -1,6 +1,7 @@
package com.xscm.moduleutil.dialog;
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
import static com.tencent.qcloud.network.sonar.utils.Utils.isNetworkAvailable;
import android.app.Dialog;
import android.content.Context;
@@ -46,10 +47,26 @@ public class PolicyDialog extends Dialog {
ClickableSpan clickSpan = new ClickableSpan() {
@Override
public void onClick(@NonNull View widget) {
Intent intent = new Intent(getContext(), WebViewActivity.class);
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6");
intent.putExtra("title", "用户协议");
startActivity(intent);
// Intent intent = new Intent(getContext(), WebViewActivity.class);
// intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6");
// intent.putExtra("title", "用户协议");
// startActivity(intent);
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", "file:///android_asset/page_yongh.html").withString("title", "用户协议").navigation();
// 检查网络连接状态
if (isNetworkAvailable(getContext())) {
// 有网络时加载网络资源
Intent intent = new Intent(getContext(), WebViewActivity.class);
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6");
intent.putExtra("title", "用户协议");
startActivity(intent);
} else {
// 无网络时加载本地资源
ARouter.getInstance().build(ARouteConstants.H5)
.withString("url", "file:///android_asset/page_yongh.html")
.withString("title", "用户协议")
.navigation();
}
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6" ).withString("title", "用户协议").navigation();
}
@@ -63,11 +80,20 @@ public class PolicyDialog extends Dialog {
ClickableSpan ysClickSpan = new ClickableSpan() {
@Override
public void onClick(@NonNull View widget) {
Intent intent = new Intent(getContext(), WebViewActivity.class);
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4");
intent.putExtra("title", "隐私协议");
startActivity(intent);
// Intent intent = new Intent(getContext(), WebViewActivity.class);
// intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4");
// intent.putExtra("title", "隐私协议");
// startActivity(intent);
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", "file:///android_asset/page_show.html").withString("title", "隐私协议").navigation();
if (isNetworkAvailable(getContext())) {
Intent intent = new Intent(getContext(), WebViewActivity.class);
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4");
intent.putExtra("title", "隐私协议");
startActivity(intent);
}else {
ARouter.getInstance().build(ARouteConstants.H5).withString("url", "file:///android_asset/page_show.html").withString("title", "隐私协议").navigation();
}
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
}

View File

@@ -421,7 +421,7 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
xlhUser.setNickname(message.getText().getFromUserInfo().getNickname());
mBinding.gvXyz.setModel(xlhUser);
mBinding.qxDjs.setEndTime(endTime);
mBinding.tvNumber.setText("x"+(message.getText().getGift_num() != null ? message.getText().getGift_num() : "0"));
mBinding.tvNumber.setText("x"+(message.getText().getGift_num()));
isDrawing=false;
}
}

View File

@@ -632,11 +632,12 @@ public class RetrofitClient {
sApiServer.roomRanking(type).compose(new DefaultTransformer<>()).subscribe(observer);
} else if (ranking_type.equals("1") || ranking_type.equals("2")) {
sApiServer.wealthRanking(ranking_type, type).compose(new DefaultTransformer<>()).subscribe(observer);
} else if (ranking_type.equals("3")) {
sApiServer.guildRanking().compose(new DefaultTransformer<>()).subscribe(observer);
} else if (ranking_type.equals("4")) {
}else if (ranking_type.equals("3")) {
sApiServer.loveRanking(type).compose(new DefaultTransformer<>()).subscribe(observer);
}
else if (ranking_type.equals("4")) {
sApiServer.guildRanking().compose(new DefaultTransformer<>()).subscribe(observer);
}
}
public void dailyTasksBoxRecord(BaseObserver<List<GiftBoxRecordBean>> observer) {

View File

@@ -1,6 +1,7 @@
package com.xscm.moduleutil.utils.config;
public enum EnvironmentEnum {
// "https://vespa.qxyushen.top/",
PRODUCTION(//生产环境
"https://vespa.qxyushen.top/",
"KvNmqZc+VMzO4CfGMd5zmG6w6OFwpFO/19TwXUWfHDOBgmnl9DgIuE+kbrjNNnxqhtP3pH7bBrnSaSeFtunr72q6sgpLsfuswcUroMvz2slaTBcNzCaLi+GSnM3gB/GdO47mwLdk+iYBTvPUOCIuT608Z29z09w+vPeUDoMCHJBGXu6uh7Nj6PtV1dfGoUvByk1ZF0WYVjIqKDcb3tXY4jonFh3XAWhzMy8xKwN6F2nuK2IcdIwaSPsvuMZmhatP6f9kOE+vnfweyCHS3RxiG474WIoZGJM8omrl3/pOVqE=",

View File

@@ -118,6 +118,8 @@ public class GiftDisplayManager {
// 处理队列
processGiftQueue();
// 确保每次接收礼物后都处理队列
mainHandler.postDelayed(this::processGiftQueue, 50);
}
private GiftDisplayView findDisplayingViewForGift(GiftBean gift) {
@@ -141,11 +143,12 @@ public class GiftDisplayManager {
private void processGiftQueue() {
if (isProcessingQueue) {
Log.d("GiftDisplayManager", "Already processing queue, skip");
return;
}
isProcessingQueue = true;
Log.d("GiftDisplayManager", "Start processing queue, size: " + giftQueue.size());
// 循环处理队列直到队列为空或没有可用视图
while (!giftQueue.isEmpty()) {
GiftDisplayView availableView = findAvailableDisplayView();
@@ -195,7 +198,8 @@ public class GiftDisplayManager {
}
// 延迟一下再处理队列,确保视图状态完全重置
mainHandler.postDelayed(this::processGiftQueue, 100);
// 立即处理队列,而不是延迟
mainHandler.post(this::processGiftQueue);
}
public void clearAll() {

View File

@@ -0,0 +1,63 @@
package com.xscm.moduleutil.widget;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import androidx.appcompat.widget.AppCompatImageView;
import com.xscm.moduleutil.R;
/**
* com.xscm.moduleutil.widget
* qx
* 2025/10/24
* 自适应图片展示
*/
public class AdaptiveImageView extends AppCompatImageView {
public AdaptiveImageView(Context context) {
super(context);
}
public AdaptiveImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public AdaptiveImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Log.d("DebugImageView", "=== onMeasure START ===");
Log.d("DebugImageView", "widthMeasureSpec: " + MeasureSpec.toString(widthMeasureSpec));
Log.d("DebugImageView", "heightMeasureSpec: " + MeasureSpec.toString(heightMeasureSpec));
// 先调用父类测量
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Log.d("DebugImageView", "After super - Width: " + getMeasuredWidth() + ", Height: " + getMeasuredHeight());
Drawable drawable = getDrawable();
if (drawable != null) {
Log.d("DebugImageView", "Drawable - Width: " + drawable.getIntrinsicWidth() + ", Height: " + drawable.getIntrinsicHeight());
}
// 强制设置为最小尺寸,确保不会太小
int measuredWidth = getMeasuredWidth();
int measuredHeight = getMeasuredHeight();
int minSize = (int) getContext().getResources().getDimension(R.dimen.dp_40);
if (measuredWidth < minSize) {
measuredWidth = minSize;
}
if (measuredHeight < minSize) {
measuredHeight = minSize;
}
Log.d("DebugImageView", "Final - Width: " + measuredWidth + ", Height: " + measuredHeight);
Log.d("DebugImageView", "=== onMeasure END ===");
setMeasuredDimension(measuredWidth, measuredHeight);
}
}

View File

@@ -1080,11 +1080,12 @@ public class AvatarFrameView extends FrameLayout {
// 隐藏所有视图
// if (playerView != null) playerView.setVisibility(View.GONE);
if (svgaSurface != null) svgaSurface.setVisibility(View.GONE);
mBinding.playView.setVisibility(View.GONE);
// 停止播放器
if (mBinding != null && mBinding.playView != null) {
mBinding.playView.stopPlay();
mBinding.playView.setVisibility(View.GONE);
}
} catch (Exception e) {
LogUtils.e(TAG, "Error in clearPrevious: " + e.getMessage());

View File

@@ -214,8 +214,10 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
//自动调节麦位波纹
// if (!TextUtils.isEmpty(bean.getDress_picture())) {
mIvRipple.setScaleX(1.1f);
mIvRipple.setScaleY(1.1f);
if (mIvRipple != null) {
mIvRipple.setScaleX(1.1f);
mIvRipple.setScaleY(1.1f);
}
// } else {
// mIvRipple.setScaleX(0.9f);
// mIvRipple.setScaleY(0.9f);
@@ -256,6 +258,8 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
AgoraManager.getInstance(getContext()).addSoundLevelListener(new SoundLevelUpdateListener() {
@Override
public void onRemoteSoundLevelUpdate(String userId, int soundLevel) {
if (mIvRipple == null)
return;
if (userId.equals(pitBean.getUser_id())) {
if (soundLevel == 0) {
mIvRipple.post(() -> {
@@ -281,6 +285,8 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
@Override
public void onLocalSoundLevelUpdate(int volume) {
if (mIvRipple == null)
return;
if (volume == 0) {
mIvRipple.post(() -> {
mIvRipple.setVisibility(GONE);

View File

@@ -0,0 +1,297 @@
package com.xscm.moduleutil.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.bean.UserInfo;
import com.xscm.moduleutil.bean.room.RoomPitBean;
import com.xscm.moduleutil.utils.ImageUtils;
import com.xscm.moduleutil.utils.SpUtil;
/**
* @Author lxj$
* @Time 2025-8-6 17:27:29$ $
* @Description 二卡八视图控件$
*/
public class RoomSingSongWheat2View extends BaseWheatView {
public ImageView mIvTagBoss;
public TextView mTvTime;
public TextView tv_time_pk;
public boolean isClickListenerSet = false;
private boolean showBoss;//显示老板标识
public RoomSingSongWheat2View(Context context) {
this(context, null, 0);
}
public RoomSingSongWheat2View(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public RoomSingSongWheat2View(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void initPit(Context context, AttributeSet attrs) {
TypedArray typedArray = null;
try {
typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoomDefaultWheatView);
pitNumber = typedArray.getString(R.styleable.RoomDefaultWheatView_room_wheat_number);
} finally {
if (typedArray != null) {
typedArray.recycle();
}
}
mIvTagBoss = findViewById(R.id.iv_tag_boos);
mTvTime = findViewById(R.id.tv_time);
tv_time_pk = findViewById(R.id.tv_time_pk);
}
@Override
protected int getLayoutId() {
return R.layout.room_view_sing_wheat_2;
}
@Override
protected void setPitData(RoomPitBean bean) {
if (bean == null) return;
sex = bean.getSex();
pitBean = bean; // 统一使用参数 bean
if (isOn()) {
handleOnState(bean);
} else {
handleOffState(bean);
}
updateSexIcon();
// updateCharmViewVisibility(bean);
updatePkState(bean);
iv_on_line.setVisibility(GONE);
}
private void handleOnState(RoomPitBean bean) {
mTvName.setText(bean.getNickname());
ImageUtils.loadHeadCC(bean.getAvatar(), mRiv);
mCharmView.setVisibility(VISIBLE);
if (mIvFrame != null) {
if (TextUtils.isEmpty(bean.getDress())) {
mIvFrame.stopAll();
mIvFrame.setVisibility(INVISIBLE);
} else {
mIvFrame.setVisibility(VISIBLE);
mIvFrame.setSource(bean.getDress(), 3);
}
}
if (showBoss && TextUtils.equals(WHEAT_BOSS, pitNumber)) {
mIvTagBoss.setVisibility(GONE);
}
}
private void handleOffState(RoomPitBean bean) {
mTvName.setText(getPitNumberText());
mCharmView.setVisibility(GONE);
if (showBoss && TextUtils.equals(WHEAT_BOSS, pitNumber)) {
mIvTagBoss.setVisibility(VISIBLE);
int resId = bean.getIs_lock() == 1 ? R.mipmap.index_img_room_mask : R.drawable.room_ic_wheat_default;
mRiv.setImageResource(resId);
} else {
mRiv.setImageResource(bean.getIs_lock() == 1 ? R.mipmap.index_img_room_mask : R.drawable.room_ic_wheat_default);
}
if (isMute()) {
ImageUtils.loadRes(R.mipmap.room_microphone_off, mIvSex);
}
if (mIvFrame != null) {
mIvFrame.stopAll();
mIvFrame.setVisibility(INVISIBLE);
}
mIvFace.remove();
}
private String getPitNumberText() {
if ("-1".equals(pitNumber)) return "";
if ("9".equals(pitNumber)) return "主持位";
if ("10".equals(pitNumber)) return "嘉宾位";
return pitNumber + "号麦位";
}
private void updateSexIcon() {
if (showSexIcon) {
checkSex();
}
}
private void updateCharmViewVisibility(RoomPitBean bean) {
boolean isEmptyNickname = bean.getNickname() == null || bean.getNickname().isEmpty();
mCharmView.setVisibility(isEmptyNickname ? GONE : VISIBLE);
}
private void updatePkState(RoomPitBean bean) {
if (bean.is_pk()) {
String userId = bean.getUser_id();
if (userId != null && !userId.equals("0") && !userId.isEmpty()) {
tv_time_pk.setVisibility(VISIBLE);
setSex(bean.getCharm(), false);
mCharmView.setVisibility(GONE);
} else {
tv_time_pk.setVisibility(GONE);
}
} else {
tv_time_pk.setVisibility(GONE);
if (isOn()) {
mCharmView.setVisibility(VISIBLE);
} else {
mCharmView.setVisibility(GONE);
}
}
}
public void setSex(String value, boolean format) {
if (format) {
tv_time_pk.setText(value);
} else {
try {
long xd = Long.parseLong(value);
if (xd > 9999 || xd < -9999) {
tv_time_pk.setText(String.format("%.2fw", xd / 10000.0f));
} else {
tv_time_pk.setText(value);
}
} catch (Exception e) {
e.printStackTrace();
tv_time_pk.setText("0"); // 设置默认值防止UI异常
}
}
}
private boolean showSexIcon = false;
private String sex;
public boolean isMale() {
return "1".equals(sex);
}
public boolean isFemale() {
return "2".equals(sex);
}
public void setShowSexIcon(boolean show) {
showSexIcon = show;
}
public void checkSex() {
if (isOn()) {
mIvSex.setVisibility(VISIBLE);
if (!TextUtils.isEmpty(sex)) {
if (UserInfo.MALE.equals(sex)) {
mIvSex.setBackgroundResource(R.drawable.room_xq_wheat_male_mask);
if (mTvNo != null) mTvNo.setBackgroundResource(R.mipmap.ic_room_xq_wno_male);
} else {
mIvSex.setBackgroundResource(R.drawable.room_xq_wheat_female_mask);
if (mTvNo != null) mTvNo.setBackgroundResource(R.mipmap.ic_room_xq_wno_female);
}
} else {
mIvSex.setVisibility(GONE);
if (mTvNo != null) mTvNo.setBackgroundResource(getOriginNoImage());
}
} else {
mIvSex.setVisibility(GONE);
if (mTvNo != null) mTvNo.setBackgroundResource(getOriginNoImage());
}
}
/**
* 是否显示老板标识
*/
public void setIsBossShow(String is_boss_pit) {
showBoss = "1".equals(is_boss_pit);
}
/**
* 开启计时
*/
public void setTime(int time) {
if (time == 0) {
mTvTime.setText("");
mTvTime.setVisibility(INVISIBLE);
} else {
mTvTime.setText(String.format("%s'%s", time / 60, time % 60));
mTvTime.setVisibility(VISIBLE);
}
}
public void hideMaoziIcon() {
View maozi = findViewById(R.id.iv_maozi);
if (maozi != null) maozi.setVisibility(GONE);
}
// 添加内存释放方法
public void releaseResources() {
// 清理头像加载
if (mRiv != null) {
mRiv.setImageBitmap(null);
}
// 清理框架视图
if (mIvFrame != null) {
mIvFrame.release(); // 清理SVGA资源
}
// 清理表情视图
if (mIvFace != null) {
mIvFace.remove();
}
// 清理其他图片资源
if (mIvSex != null) {
mIvSex.setImageBitmap(null);
}
if (mIvTagBoss != null) {
mIvTagBoss.setImageBitmap(null);
}
}
@Override
protected void onDetachedFromWindow() {
// 视图从窗口分离时释放资源
releaseResources();
super.onDetachedFromWindow();
}
@Override
public void onRemoteSoundLevelUpdate(String userId, int soundLevel) {
// 暂无实现
}
@Override
public void onLocalSoundLevelUpdate(int volume) {
}
@Override
public void userJoined(int userId, int elapsd) {
// 暂无实现
}
@Override
public void userOffline(int userId, int reason) {
// 暂无实现
}
@Override
public void unRegister(Object obj) {
}
}

View File

@@ -1,5 +1,6 @@
package com.xscm.moduleutil.widget;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.View;
@@ -17,6 +18,8 @@ import com.xscm.moduleutil.utils.SpUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @Author lxj$
@@ -50,97 +53,30 @@ public class WheatLayoutSingManager {
this.container = container;
}
public void setWheatData(List<RoomPitBean> pitList) {
public void setWheatData(List<RoomPitBean> pitList, boolean isFirst) {
// 检查容器状态
if (container == null || !isContainerValid()) {
if (container == null) {
return;
}
this.pitList = pitList;
restoreMultiWheat();
}
public void setWheatDataPk(List<RoomPitBean> pitList, int layoutType) {
// 检查容器状态
if (container == null || !isContainerValid()) {
return;
}
this.pitList = pitList;
restoreMultiWheatPk(layoutType);
restoreMultiWheat(isFirst);
}
public void setOnWheatClickListener(@Nullable OnWheatClickListener listener) {
this.wheatClickListener = listener;
}
public void showSingleWheat(int pitNumber) {
public void restoreMultiWheat(boolean isFirst) {
// 检查容器状态
if (container == null || !isContainerValid()) {
return;
}
if (isSingleMode && this.currentSinglePit == pitNumber) return;
try {
container.removeAllViews();
} catch (Exception e) {
// 忽略异常,继续执行
return;
}
if (pitNumber < 1 || pitNumber > 10 || pitList == null || pitList.size() < 10)
return;
RoomPitBean bean = pitList.get(pitNumber - 1);
singleWheatView = new RoomSingSongWheatView(context);
singleWheatView.pitNumber = String.valueOf(pitNumber);
singleWheatView.setData(bean);
// 默认设置为 MATCH_PARENT也可以自定义
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
);
params.setMargins(20, 20, 20, 20);
singleWheatView.setLayoutParams(params);
GifAvatarOvalView avatarView = (GifAvatarOvalView) singleWheatView.mRiv;
avatarView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onWheatClick(singleWheatView, pitNumber);
}
restoreMultiWheat();
});
WheatCharmView charmView = singleWheatView.mCharmView;
charmView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onMeilingClick(singleWheatView, Integer.parseInt(singleWheatView.pitNumber));
}
});
// // 添加点击事件
singleWheatView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onMakeWheatClick(singleWheatView, pitNumber);
}
restoreMultiWheat();
});
container.addView(singleWheatView);
isSingleMode = true;
currentSinglePit = pitNumber;
}
public void restoreMultiWheat() {
// 检查容器状态
if (container == null || !isContainerValid()) {
if (container == null) {
return;
}
try {
container.removeAllViews();
if (multiWheatViews != null && multiWheatViews.size() != 10) {
container.removeAllViews();
}
} catch (Exception e) {
// 忽略异常,继续执行
return;
@@ -150,86 +86,131 @@ public class WheatLayoutSingManager {
return;
}
multiWheatViews.clear();
// multiWheatViews.clear();
int screenWidth = getScreenWidth();
int itemWidth = screenWidth / 4; // 每个控件宽度为屏幕宽度的 1/4
LinearLayout row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
if (multiWheatViews.size() == 10){
for (int i = 0; i < multiWheatViews.size(); i++){
multiWheatViews.get(i).setData(pitList.get(pitIndexMap[i] - 1));
}
}else {
for (int i = 0; i < 10; i++) {
int pitNumber = pitIndexMap[i];
if (isFirst){
RoomSingSongWheat2View wheatView = new RoomSingSongWheat2View( context);
wheatView.pitNumber = String.valueOf(pitNumber);
wheatView.setData(pitList.get(pitNumber - 1));
for (int i = 0; i < 10; i++) {
int pitNumber = pitIndexMap[i];
RoomSingSongWheatView wheatView = new RoomSingSongWheatView(context);
wheatView.pitNumber = String.valueOf(pitNumber);
wheatView.setData(pitList.get(pitNumber - 1));
multiWheatViews.add(wheatView);
LinearLayout.LayoutParams params;
LinearLayout.LayoutParams params;
if (i == 0) {
int fixedHeightInDp = 110; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
// 第一个控件:左边距 86dp右边距 100dp
params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
params.rightMargin = dpToPx(50);
} else if (i == 1) {
int fixedHeightInDp = 110; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
// 第二个控件:右边距 86dp
params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
} else {
int fixedHeightInDp = 90; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
params = new LinearLayout.LayoutParams(itemWidth - 30, fixedHeightInPx + 30);
// 其他控件保持原有逻辑
if (i == 0) {
int fixedHeightInDp = 110; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
// 第一个控件:左边距 86dp右边距 100dp
params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
params.rightMargin = dpToPx(50);
} else if (i == 1) {
int fixedHeightInDp = 110; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
// 第二个控件:右边距 86dp
params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
} else {
int fixedHeightInDp = 90; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
params = new LinearLayout.LayoutParams(itemWidth - 30, fixedHeightInPx + 30);
// 其他控件保持原有逻辑
params.setMargins(0, 0, 0, 0); // 不设右边距,由 row padding 控制
}
wheatView.setLayoutParams(params);
row.addView(wheatView);
// 第一行添加两个后换行
if (i == 1) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
} else if (i > 1 && (i - 2) % 4 == 3) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
}
}else {
RoomSingSongWheatView wheatView = new RoomSingSongWheatView(context);
wheatView.pitNumber = String.valueOf(pitNumber);
wheatView.setData(pitList.get(pitNumber - 1));
multiWheatViews.add(wheatView);
LinearLayout.LayoutParams params;
if (i == 0) {
int fixedHeightInDp = 110; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
// 第一个控件:左边距 86dp右边距 100dp
params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
params.rightMargin = dpToPx(50);
} else if (i == 1) {
int fixedHeightInDp = 110; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
// 第二个控件:右边距 86dp
params = new LinearLayout.LayoutParams(itemWidth, fixedHeightInPx);
} else {
int fixedHeightInDp = 90; // 固定高度为 100dp
int fixedHeightInPx = dpToPx(fixedHeightInDp); // 调用已有的 dpToPx 方法
params = new LinearLayout.LayoutParams(itemWidth - 30, fixedHeightInPx + 30);
// 其他控件保持原有逻辑
params.setMargins(0, 0, 0, 0); // 不设右边距,由 row padding 控制
}
wheatView.setLayoutParams(params);
GifAvatarOvalView avatarView = (GifAvatarOvalView) wheatView.mRiv;
avatarView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onWheatClick(wheatView, pitNumber);
}
});
WheatCharmView charmView = wheatView.mCharmView;
charmView.setOnClickListener(v -> {
if (wheatClickListener != null) {
ToastUtils.show("点击了麦位");
wheatClickListener.onMeilingClick(wheatView, pitNumber);
}
});
wheatView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onMeilingClick(wheatView, Integer.parseInt(wheatView.pitNumber));
}
});
row.addView(wheatView);
// 第一行添加两个后换行
if (i == 1) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
} else if (i > 1 && (i - 2) % 4 == 3) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
}
}
params.setMargins(0, 0, 0, 0); // 不设右边距,由 row padding 控制
}
wheatView.setLayoutParams(params);
GifAvatarOvalView avatarView = (GifAvatarOvalView) wheatView.mRiv;
avatarView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onWheatClick(wheatView, pitNumber);
}
});
WheatCharmView charmView = wheatView.mCharmView;
charmView.setOnClickListener(v -> {
if (wheatClickListener != null) {
ToastUtils.show("点击了麦位");
wheatClickListener.onMeilingClick(wheatView, pitNumber);
}
});
wheatView.setOnClickListener(v -> {
if (wheatClickListener != null) {
wheatClickListener.onMeilingClick(wheatView, Integer.parseInt(wheatView.pitNumber));
}
});
row.addView(wheatView);
// 第一行添加两个后换行
if (i == 1) {
// 添加最后一行可能存在的剩余 view
if (row.getChildCount() > 0) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
} else if (i > 1 && (i - 2) % 4 == 3) {
container.addView(row);
row = new LinearLayout(context);
row.setOrientation(LinearLayout.HORIZONTAL);
}
isSingleMode = false;
currentSinglePit = -1;
}
// 添加最后一行可能存在的剩余 view
if (row.getChildCount() > 0) {
container.addView(row);
}
isSingleMode = false;
currentSinglePit = -1;
}
public void restoreMultiWheatPk(int layoutType) {

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:duration="300" android:fromXDelta="-100.0%p" android:toXDelta="0.0" />
</set>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:duration="300" android:fromXDelta="0.0" android:toXDelta="-100.0%p" />
</set>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:duration="300" android:fromXDelta="100.0%p" android:toXDelta="0.0" />
</set>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:duration="300" android:fromXDelta="0.0" android:toXDelta="100.0%p" />
</set>

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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/bubble1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="@dimen/dp_256"
android:maxWidth="@dimen/dp_256"
android:padding="@dimen/dp_8"
android:background="@drawable/ease_row_pubilc_user_bg"
>
<!-- 网络背景图片 -->
<!-- <ImageView-->
<!-- android:id="@+id/network_background"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- tools:src="@mipmap/a1img_9"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"/>-->
<!-- 用户头像 -->
<com.xscm.moduleutil.widget.GifAvatarOvalView
android:id="@+id/avatar"
android:layout_width="@dimen/dp_28"
android:layout_height="@dimen/dp_28"
android:layout_marginEnd="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_3"
android:layout_marginBottom="@dimen/dp_3"
android:layout_marginStart="@dimen/dp_8"
app:riv_oval="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>
<!-- 用户名称 -->
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#CCA882"
android:textSize="@dimen/sp_12"
android:layout_marginStart="@dimen/dp_2"
tools:text="饶利"
app:layout_constraintStart_toEndOf="@+id/avatar"
app:layout_constraintTop_toTopOf="@+id/avatar"
android:visibility="gone"/>
<!-- 用户标签容器 -->
<LinearLayout
android:id="@+id/line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_2"
android:layout_marginTop="@dimen/dp_5"
android:orientation="horizontal"
app:layout_constraintStart_toEndOf="@+id/avatar"
app:layout_constraintTop_toBottomOf="@+id/tv_name"
android:visibility="gone"/>
<!-- 消息内容 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="left|center_vertical"
android:layout_marginStart="4dp"
android:layout_marginTop="2dp"
android:padding="@dimen/dp_3"
android:paddingEnd="@dimen/dp_10"
app:layout_constraintStart_toEndOf="@+id/avatar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/line">
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineHeight="@dimen/dp_20"
android:lineSpacingExtra="@dimen/dp_2"
android:paddingStart="@dimen/dp_8"
android:paddingEnd="@dimen/dp_8"
android:textColor="@color/white"
android:textSize="@dimen/sp_14"
tools:text="饶利: 潇洒亼◇生2.0"
tools:visibility="gone"/>
<ImageView
android:id="@+id/im_emj"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
android:layout_marginStart="@dimen/dp_2"
android:paddingStart="@dimen/dp_8"
android:paddingEnd="@dimen/dp_8"
android:scaleType="fitCenter"
tools:src="@mipmap/ic_launcher"
android:visibility="gone"
tools:visibility="visible"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -5,6 +5,9 @@
android:id="@+id/bubble"
android:layout_marginTop="@dimen/dp_3"
android:layout_marginBottom="@dimen/dp_3"
android:padding="@dimen/dp_8"
android:layout_marginStart="@dimen/dp_8"
android:background="@drawable/ease_row_pubilc_sys_bg"
>
<LinearLayout
@@ -20,9 +23,7 @@
android:textColor="@color/white"
android:paddingTop="@dimen/dp_5"
android:paddingBottom="@dimen/dp_5"
android:paddingStart="@dimen/dp_8"
android:paddingEnd="@dimen/dp_8"
android:background="@drawable/ease_row_pubilc_sys_bg"
android:text="我是房间公告"
android:textSize="@dimen/sp_14"/>
</LinearLayout>

View File

@@ -13,15 +13,15 @@
>
<!-- 网络背景图片 -->
<!-- <ImageView-->
<!-- android:id="@+id/network_background"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- tools:src="@mipmap/a1img_9"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"/>-->
<!-- <ImageView-->
<!-- android:id="@+id/network_background"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- tools:src="@mipmap/a1img_9"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"/>-->
<!-- 用户头像 -->
<com.xscm.moduleutil.widget.GifAvatarOvalView
@@ -86,17 +86,43 @@
tools:text="饶利: 潇洒亼◇生2.0"
tools:visibility="gone"/>
<ImageView
<com.xscm.moduleutil.widget.AdaptiveImageView
android:id="@+id/im_emj"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:layout_marginStart="@dimen/dp_2"
android:paddingStart="@dimen/dp_8"
android:paddingEnd="@dimen/dp_8"
android:scaleType="fitCenter"
tools:src="@mipmap/ic_launcher"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:visibility="gone"
tools:visibility="visible"/>
<!-- <ImageView-->
<!-- android:id="@+id/im_emj"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:layout_marginStart="@dimen/dp_2"-->
<!-- android:paddingStart="@dimen/dp_8"-->
<!-- android:paddingEnd="@dimen/dp_8"-->
<!-- tools:src="@mipmap/ic_launcher"-->
<!-- android:maxHeight="@dimen/dp_50"-->
<!-- android:maxWidth="@dimen/dp_50"-->
<!-- android:minWidth="@dimen/dp_40"-->
<!-- android:minHeight="@dimen/dp_40"-->
<!-- android:scaleType="centerCrop"-->
<!-- android:adjustViewBounds="true"-->
<!-- android:visibility="gone"-->
<!-- tools:visibility="visible"-->
<!-- app:layout_constraintWidth_default="wrap"-->
<!-- app:layout_constraintHeight_default="wrap"-->
<!-- app:layout_constraintWidth_min="@dimen/dp_40"-->
<!-- app:layout_constraintHeight_min="@dimen/dp_40"-->
<!-- app:layout_constraintWidth_max="@dimen/dp_50"-->
<!-- app:layout_constraintHeight_max="@dimen/dp_50"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"/>-->
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,491 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false">
<!--说话动态图-->
<com.xscm.moduleutil.widget.GifAvatarOvalView
android:id="@+id/riv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginEnd="@dimen/dp_12"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@mipmap/room_ic_wheat_default"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_sex"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@mipmap/common_ic_headportriat_base"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toTopOf="@id/riv"
tools:visibility="visible" />
<View
android:id="@+id/view2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toTopOf="@id/riv" />
<ImageView
android:id="@+id/iv_tag_boos"
android:layout_width="32dp"
android:layout_height="14dp"
android:src="@mipmap/room_ic_wheat_tag_boss"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/view2"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
tools:visibility="visible" />
<ImageView
android:id="@+id/iv_tag_type"
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_5"
android:src="@mipmap/zc"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv" />
<!-- <TextView-->
<!-- android:id="@+id/tv_time"-->
<!-- android:layout_width="@dimen/dp_35"-->
<!-- android:layout_height="17.5dp"-->
<!-- android:background="@drawable/room_bg_wheat_time"-->
<!-- android:gravity="center"-->
<!-- android:text="00:00"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_9"-->
<!-- android:visibility="gone"-->
<!-- android:layout_marginBottom="@dimen/dp_6"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<TextView
android:id="@+id/tv_time"
android:layout_width="@dimen/dp_35"
android:layout_height="17.5dp"
android:background="@mipmap/za_s"
android:gravity="center"
android:text="00:00"
android:textColor="@color/white"
android:textSize="@dimen/sp_9"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
tools:visibility="visible" />
<View
android:id="@+id/view_riv_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/cl_guide1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.2" />
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5"
android:singleLine="true"
android:layout_marginTop="@dimen/dp_6"
android:textColor="@color/white"
android:translationZ="@dimen/dp_10"
android:textSize="@dimen/sp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/riv"
tools:text="麦位1"
tools:textColor="@color/color_FF333333" />
<com.xscm.moduleutil.widget.WheatCharmView
android:id="@+id/charm_view"
android:layout_width="@dimen/dp_52"
android:layout_height="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_5"
android:clipChildren="false"
android:clipToPadding="false"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toBottomOf="@id/tv_name" />
<TextView
android:id="@+id/tv_time_pk"
android:layout_width="@dimen/dp_35"
android:layout_height="17.5dp"
android:background="@mipmap/za_s"
android:layout_marginBottom="@dimen/dp_5"
android:gravity="center"
android:text="00:00"
android:textColor="@color/white"
android:textSize="@dimen/sp_9"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toBottomOf="@id/tv_name"
tools:visibility="visible" />
<ImageView
android:id="@+id/iv_shutup"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="4dp"
android:src="@mipmap/room_ic_wheat_shutup"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintHeight_percent="0.05"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintWidth_percent="0.05"
tools:visibility="visible" />
<ImageView
android:id="@+id/iv_online"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@mipmap/room_ic_owner_offline"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.82"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_10"
app:loopCount="0"
tools:visibility="visible" />
<com.xscm.moduleutil.widget.ExpressionImgView
android:id="@+id/iv_face"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/riv"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="@id/riv"
app:layout_constraintTop_toTopOf="@id/riv"
app:layout_constraintVertical_bias="0.0" />
<ImageView
android:id="@+id/iv_gift"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:0.6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.7"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_maozi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_1"
android:scaleType="centerInside"
android:src="@mipmap/ic_room_huangguan"
android:visibility="gone"
app:layout_constraintStart_toStartOf="@id/iv_frame"
app:layout_constraintTop_toTopOf="@id/iv_frame"
tools:visibility="visible" />
<TextView
android:id="@+id/tv_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/ic_room_xq_wno_male"
android:gravity="center"
android:text="1"
android:textColor="#fff"
android:textSize="@dimen/sp_10"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/iv_frame"
app:layout_constraintEnd_toEndOf="@id/riv"
app:layout_constraintStart_toStartOf="@id/riv"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false">-->
<!-- <com.qxcm.moduleutil.widget.GifAvatarOvalView-->
<!-- android:id="@+id/riv"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:src="@mipmap/room_ic_wheat_default"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- tools:visibility="visible" />-->
<!-- &lt;!&ndash;说话动态图&ndash;&gt;-->
<!-- <com.opensource.svgaplayer.SVGAImageView-->
<!-- android:id="@+id/iv_ripple"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- app:autoPlay="false"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHeight_percent="0.8"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintWidth_percent="0.8"-->
<!-- app:loopCount="0"-->
<!-- app:source="ripple3695.svga"-->
<!-- tools:visibility="visible" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_sex"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:background="@mipmap/common_ic_headportriat_base"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintTop_toTopOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<!-- <View-->
<!-- android:id="@+id/view2"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintTop_toTopOf="@id/riv" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_tag_boos"-->
<!-- android:layout_width="32dp"-->
<!-- android:layout_height="14dp"-->
<!-- android:src="@mipmap/room_ic_wheat_tag_boss"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toTopOf="@id/view2"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_time"-->
<!-- android:layout_width="@dimen/dp_35"-->
<!-- android:layout_height="17.5dp"-->
<!-- android:background="@mipmap/za_s"-->
<!-- android:gravity="center"-->
<!-- android:text="00:00"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_9"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_online"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@mipmap/room_ic_owner_offline"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:loopCount="0"-->
<!-- tools:visibility="visible" />-->
<!-- <com.qxcm.moduleutil.widget.AvatarFrameView-->
<!-- android:id="@+id/iv_frame"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:contentDescription="@null"-->
<!-- android:scaleType="fitXY"-->
<!-- app:autoPlay="true"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHeight_percent="0.1"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:loopCount="0"-->
<!-- tools:visibility="visible" />-->
<!-- <View-->
<!-- android:id="@+id/view_riv_bottom"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- tools:visibility="visible" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_tag_type"-->
<!-- android:layout_width="@dimen/dp_30"-->
<!-- android:layout_height="@dimen/dp_20"-->
<!-- android:src="@mipmap/zc"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_name"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:paddingLeft="@dimen/dp_5"-->
<!-- android:paddingRight="@dimen/dp_5"-->
<!-- android:singleLine="true"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="@dimen/sp_9"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/riv"-->
<!-- tools:text="麦位1"-->
<!-- tools:textColor="@color/color_FF333333"-->
<!-- tools:visibility="visible" />-->
<!-- &lt;!&ndash; 心动&ndash;&gt;-->
<!-- <com.qxcm.moduleutil.widget.WheatCharmView-->
<!-- android:id="@+id/charm_view"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:clipChildren="false"-->
<!-- android:clipToPadding="false"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintEnd_toEndOf="@id/tv_name"-->
<!-- app:layout_constraintStart_toStartOf="@id/tv_name"-->
<!-- app:layout_constraintTop_toBottomOf="@id/tv_name"-->
<!-- tools:visibility="visible" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_shutup"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:layout_marginRight="5dp"-->
<!-- android:layout_marginBottom="4dp"-->
<!-- android:src="@mipmap/room_ic_wheat_shutup"-->
<!-- android:visibility="invisible"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintHeight_percent="0.018"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintWidth_percent="0.018"-->
<!-- tools:visibility="visible" />-->
<!-- <com.qxcm.moduleutil.widget.ExpressionImgView-->
<!-- android:id="@+id/iv_face"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/riv"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintHorizontal_bias="1.0"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- app:layout_constraintTop_toTopOf="@id/riv"-->
<!-- app:layout_constraintVertical_bias="0.0" />-->
<!-- <android.gesture.GestureOverlayView-->
<!-- android:id="@+id/game_imgview"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_gift"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="0dp"-->
<!-- android:visibility="visible"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintDimensionRatio="1:1"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintHeight_percent="0.2"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_maozi"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginLeft="@dimen/dp_10"-->
<!-- android:layout_marginTop="@dimen/dp_1"-->
<!-- android:scaleType="centerInside"-->
<!-- android:src="@mipmap/ic_room_huangguan"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintStart_toStartOf="@id/iv_frame"-->
<!-- app:layout_constraintTop_toTopOf="@id/iv_frame"-->
<!-- tools:visibility="visible" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_no"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@mipmap/ic_room_xq_wno_male"-->
<!-- android:gravity="center"-->
<!-- android:text="1"-->
<!-- android:textColor="#fff"-->
<!-- android:textSize="@dimen/sp_10"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/iv_frame"-->
<!-- app:layout_constraintEnd_toEndOf="@id/riv"-->
<!-- app:layout_constraintStart_toStartOf="@id/riv"-->
<!-- tools:visibility="visible" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
</layout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLiveAndroid" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -327,4 +327,25 @@
<color name="color6c49e25">#DAD1F8</color>
<color name="global">#ff5878</color>
<color name="background">@color/gray2</color>
<color name="textColor">#282828</color>
<color name="gray1">#969696</color>
<color name="gray2">#f5f5f5</color>
<color name="gray3">#c8c8c8</color>
<color name="gray4">#B4B4B4</color>
<color name="gray5">#dcdcdc</color>
<color name="yellow">#fffa37</color>
<color name="yellow2">#f0cd08</color>
<color name="yellow3">#FFF34D</color>
<color name="yellow4">#ffdd00</color>
<color name="textColor2">#646464</color>
<color name="red">#ff0000</color>
<color name="pk_red">#FF205E</color>
<color name="pk_blue">#169AFF</color>
<color name="black1">#e6323232</color>
<color name="blue1">#1FC8F8</color>
<color name="blue2">#4998F7</color>
<color name="blue3">#32A0FF</color>
</resources>

View File

@@ -67,12 +67,12 @@
</declare-styleable>
<!-- 界面切换动画 -->
<style name="AnimFade" parent="@android:style/Animation.Activity">
<item name="android:activityOpenEnterAnimation">@anim/fade_in</item>
<item name="android:activityOpenExitAnimation">@anim/fade_out</item>
<item name="android:activityCloseEnterAnimation">@anim/fade_in</item>
<item name="android:activityCloseExitAnimation">@anim/fade_out</item>
</style>
<!-- <style name="AnimFade" parent="@android:style/Animation.Activity">-->
<!-- <item name="android:activityOpenEnterAnimation">@anim/fade_in</item>-->
<!-- <item name="android:activityOpenExitAnimation">@anim/fade_out</item>-->
<!-- <item name="android:activityCloseEnterAnimation">@anim/fade_in</item>-->
<!-- <item name="android:activityCloseExitAnimation">@anim/fade_out</item>-->
<!-- </style>-->
<style name="defaultDialogStyle" parent="@android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
@@ -161,11 +161,11 @@
<item name="android:maxHeight">20dp</item>
</style>
<style name="LauncherAppTheme" parent="BaseAppTheme">
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
<!-- <style name="LauncherAppTheme" parent="BaseAppTheme">-->
<!-- <item name="android:navigationBarColor">@android:color/transparent</item>-->
<!-- <item name="android:statusBarColor">@android:color/transparent</item>-->
<!-- <item name="android:windowIsTranslucent">true</item>-->
<!-- </style>-->
<!-- 查看大图-->
<style name="big_pic_dialog" parent="Theme.AppCompat.Dialog">
<!--设置背景颜色-->
@@ -272,7 +272,7 @@
<style name="CustomTabTextAppearance" parent="TextAppearance.Design.Tab">
<item name="android:textSize">@dimen/sp_12</item>
<item name="android:textColor">#F1ECFF</item>
<item name="android:textColor">#fffF</item>
<item name="textAllCaps">false</item>
</style>
<style name="CustomTextAppearanceTab" parent="TextAppearance.Design.Tab">

View File

@@ -1,31 +1,127 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLiveAndroid" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<!-- 你的基础主题(保持不变) -->
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorBackground">@color/background</item>
<item name="android:textColor">@color/color_1F1C1F</item>
<item name="android:textColorHint">@color/color_FF999999</item>
<item name="android:windowBackground">@color/color_F9FAFA</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowDisablePreview">true</item>
<!-- 新增:全局禁用跳转动画 -->
<item name="android:windowAnimationStyle">@style/NoAnimationStyle</item>
</style>
<style name="AppTheme_MAIN" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimary</item>
<item name="colorAccent">@color/colorPrimary</item>
<!-- 定义具体的无动画属性 -->
<style name="NoAnimationStyle" parent="@android:style/Animation.Activity">
<item name="android:activityOpenEnterAnimation">@anim/a_slide_right_in</item>
<item name="android:activityOpenExitAnimation">@anim/a_slide_left_out</item>
<item name="android:activityCloseEnterAnimation">@anim/a_slide_left_in</item>
<item name="android:activityCloseExitAnimation">@anim/a_slide_right_out</item>
<item name="android:taskOpenEnterAnimation">@anim/a_slide_right_in</item>
<item name="android:taskOpenExitAnimation">@anim/a_slide_left_out</item>
<item name="android:taskCloseEnterAnimation">@anim/a_slide_left_in</item>
<item name="android:taskCloseExitAnimation">@anim/a_slide_right_out</item>
<item name="android:windowEnterAnimation">@anim/a_slide_right_in</item>
<item name="android:windowExitAnimation">@anim/a_slide_left_out</item>
</style>
<style name="main_SplashThemeImage" parent="AppTheme.NoActionBar">
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<!--StartActivity Style 冷启动效果-->
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<!-- 给status栏设置透明颜色 -->
<item name="android:statusBarColor">@android:color/transparent</item>
<!-- true: status栏的图标和文字为黑色false: sstatus栏的图标和文字为白色 -->
<item name="android:windowTranslucentStatus">false</item>
<item name="actionSheetStyle">@style/ActionSheetStyleiOS7</item>
<item name="android:windowBackground">@mipmap/screen</item>
</style>
<!-- 在 styles.xml 中添加透明主题 -->
<style name="TransparentTheme" parent="AppTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
<style name="LauncherAppTheme" parent="AppTheme">
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
<style name="dialog" parent="AppTheme">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:backgroundDimAmount">0.5</item>
<!--显示区域以外是否使用黑色半透明背景-->
<item name="android:backgroundDimEnabled">true</item>
</style>
<style name="dialog2" parent="AppTheme">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/transparent</item>
<!--显示区域以外是否使用黑色半透明背景-->
<item name="android:backgroundDimEnabled">false</item>
</style>
<style name="bottomToTopAnim" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/bottomview_anim_enter</item>
<item name="android:windowExitAnimation">@anim/bottomview_anim_exit</item>
</style>
<style name="bottomToTopAnim2" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/bottomview_anim_enter_2</item>
<item name="android:windowExitAnimation">@anim/bottomview_anim_exit_2</item>
</style>
<style name="leftToRightAnim" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/left_anim_enter</item>
<item name="android:windowExitAnimation">@anim/left_anim_exit</item>
</style>
<!-- <style name="animCenter" parent="android:Animation">-->
<!-- <item name="android:windowEnterAnimation">@anim/anim_center_enter</item>-->
<!-- <item name="android:windowExitAnimation">@anim/anim_center_exit</item>-->
<!-- </style>-->
<style name="groupLast" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:layout_marginLeft">15dp</item>
<item name="android:layout_marginRight">15dp</item>
<item name="android:background">@color/gray2</item>
</style>
<style name="line2" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:background">@color/gray2</item>
</style>
<style name="edit_profile_group" parent="AppTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">60dp</item>
<item name="android:paddingLeft">15dp</item>
<item name="android:paddingRight">15dp</item>
</style>
</resources>

View File

@@ -10,18 +10,18 @@
<activity
android:name=".activity.DynamicDetailActivity"
android:exported="false"
android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden|adjustResize"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.DynamicListActivity"
android:exported="false"
android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden|adjustResize"/>
<activity
android:name=".activity.ReleaseActivity"
android:exported="false"
android:launchMode="singleTask"/>
/>
</application>
</manifest>

View File

@@ -114,8 +114,8 @@ public class ExpandColumnAdapter extends BaseQuickAdapter<ExpandColumnBean, Base
ImageView imageView = new ImageView(mContext);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
mContext.getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
mContext.getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
mContext.getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
mContext.getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
);
params.setMargins(0, 0, mContext.getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView.setLayoutParams(params);

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -1,25 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Theme.QxLive.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.QxLive.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.QxLive.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -1,16 +0,0 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

View File

@@ -46,6 +46,7 @@ import com.example.moduleroom.fragment.*
import com.example.moduleroom.presenter.RoomPresenter
import com.example.moduleroom.service.ForegroundService
import com.example.moduleroom.service.RoomPlayService
import com.google.common.collect.Sets.SetView
import com.hjq.toast.ToastUtils
import com.liulishuo.okdownload.OkDownloadProvider
import com.orhanobut.logger.Logger
@@ -90,7 +91,10 @@ import com.xscm.moduleutil.widget.*
import com.xscm.moduleutil.widget.ViewUtils.OnViewCreatedListener
import com.xscm.moduleutil.widget.floatingView.Floa
import io.agora.musiccontentcenter.Music
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@@ -116,20 +120,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
private var mRoomUserBean: RoomUserBean? = null
private var mPitList: List<RoomPitBean> = ArrayList()
@JvmField
@Autowired
var password: String? = null
@JvmField
@Autowired
var roomId: String? = null
@JvmField
@Autowired
var mRoomInfoResp: RoomInfoResp? = null
@JvmField
@Autowired
var taskId: String? = null
var likeUserAdapter: LikeUserAdapter<RoomOnlineBean>? = null
@@ -176,7 +172,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
fun addActiveDialogFragment(dialogFragment: Fragment) {
activeDialogFragments.add(dialogFragment)
}
override fun doDone() {
isOnline = intent.getBooleanExtra("isOnline", false)
password = intent.getStringExtra("password")
roomId = intent.getStringExtra("roomId")
mRoomInfoResp = intent.getSerializableExtra("roomInfo") as RoomInfoResp?
LogUtils.dTag("RoomActivity", "doDone"+mRoomInfoResp.toString())
}
private fun resumeRoomFromMinimize() {
@@ -354,7 +356,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
/** 最小化 */
private fun showExitRoomDialog() {
if (mRoomInfoResp!!.room_info.type_id.equals("6")) {
if (mRoomInfoResp?.room_info?.type_id.equals("6")) {
val bottomSheet = ExitRoomBottomSheet.newInstance(false, true, true);
bottomSheet.setOnOptionSelectedListener(object : OnOptionSelectedListener {
override fun onMinimize() {
@@ -368,8 +370,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
// 调用退出房间方法
MessageListenerSingleton.quitGroup(roomId);
quit();
if (mRoomInfoResp!!.getRoom_info()
.getLabel_id() != null && mRoomInfoResp!!.getRoom_info().getLabel_id()
if (mRoomInfoResp?.getRoom_info()?.getLabel_id() != null && mRoomInfoResp?.getRoom_info()?.getLabel_id()
.equals("5")
) {
jiaR();
@@ -489,7 +490,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
isSave = false
sDestroied = false
isMinimized = false
overridePendingTransition(0, 0) // 关闭转场动画
// overridePendingTransition(0, 0) // 关闭转场动画
startKeepLiveService() //保活
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
@@ -500,12 +501,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
checkAndRestoreMinimizeState()
// 获取传递的房间数据
// 在子线程中执行网络请求
performNetworkRequestsAsync()
roomFragment = RoomFragment.newInstance()
supportFragmentManager
.beginTransaction()
.replace(R.id.vp_room_pager, roomFragment!!)
.commitAllowingStateLoss()
// performNetworkRequestsAsync()
// roomFragment = RoomFragment.newInstance()
// supportFragmentManager
// .beginTransaction()
// .replace(R.id.vp_room_pager, roomFragment!!)
// .commitAllowingStateLoss()
// 使用新的 OnBackPressedDispatcher API 来处理返回事件
if (onBackPressedDispatcher != null) {
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
@@ -516,6 +518,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
})
}
// 获取Application实例并设置监听器
val app = application as CommonAppContext
appStateListener = AppStateManager.getInstance()
@@ -526,7 +529,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
appStateListener?.onRoomActivityCreated(this)
}
MessageListenerSingleton.getInstance().joinGroup(roomId)
// 处理房间数据
// handleRoomData();
SpUtil.saveMyRoomId(roomId)
@@ -583,6 +586,113 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {}
}
private fun setview(resp: RoomInfoResp?) {
if (resp == null)
return
this.mRoomInfoResp = resp
val roomBean = resp.room_info
this.mRoomBean = roomBean
this.mRoomUserBean = resp.user_info
this.mRoomOwnerBean = resp.room_owner
this.mPitList = mRoomBean!!.pit_list
CommonAppContext.getInstance().isPlaying = true
CommonAppContext.getInstance().playId = roomId
CommonAppContext.getInstance().playName = mRoomBean!!.room_name
CommonAppContext.getInstance().playCover = resp.room_info.room_cover
CommonAppContext.getInstance().showSelf = resp.is_show_self == 1
ImageUtils.loadHeadCC(resp.room_info.room_cover, mBinding!!.roomTop.avatar)
mBinding!!.roomTop.name.text = roomBean.room_name
mBinding!!.roomTop.idVal.text = "ID:" + roomBean.room_number
if (mRoomUserBean?.getIs_room_owner() == 1) {
mBinding!!.roomTop.btnFollow.visibility = View.GONE
} else {
mBinding!!.roomTop.btnFollow.visibility = View.VISIBLE
if (resp.isCollect) {
mBinding!!.roomTop.btnFollow.background =
resources.getDrawable(com.xscm.moduleutil.R.mipmap.collected)
mBinding!!.roomTop.btnFollow.text = ""
}
}
number = roomBean.online_number
mBinding!!.roomTop.tvNum.text = number.toString() + ""
val userIds = StringBuilder()
for (i in mRoomInfoResp!!.room_info.pit_list.indices) {
val userId = mRoomInfoResp!!.room_info.pit_list[i].user_id
if (userId != null && userId != "0" && !userId.isEmpty()) {
if (userIds.length > 0) {
userIds.append(",")
}
userIds.append(userId)
}
}
initPublicScreenFragment()
// 确保Fragment已完全初始化后再调用getUpRoomInfo
if (publicScreenFragment != null && publicScreenFragment!!.isAdded && publicScreenFragment!!.view != null) {
publicScreenFragment!!.getUpRoomInfo(resp)
}
if (!isFinishing && !isDestroyed) {
resetFragment()
upHeight()
} else {
Log.e("Fragment", "Fragment transaction skipped due to state loss.")
}
if (mRoomUserBean?.getIs_collect() == 1) {
mBinding!!.roomTop.btnFollow.background =
resources.getDrawable(com.xscm.moduleutil.R.mipmap.yishouc)
mBinding!!.roomTop.btnFollow.text = ""
} else {
ThemeableDrawableUtils.setThemeableRoundedBackground(
mBinding!!.roomTop.btnFollow,
ColorManager.getInstance().primaryColorInt,
53
)
mBinding!!.roomTop.btnFollow.setTextColor(ColorManager.getInstance().buttonColorInt)
mBinding!!.roomTop.btnFollow.text = "收藏"
}
if ((roomBean.type_id == "3" || roomBean.type_id == "1" || roomBean.type_id == "4") && roomBean.label_id == "2") {
AgoraManager.getInstance(this).isBjMusic = false
} else {
AgoraManager.getInstance(this).isBjMusic = true
}
AgoraManager.stopMuisc()
initializeAudio()
toutiao()
upRoomInfo(resp)
instView()
if (mRoomInfoResp!!.user_info.pit_number == 9 && mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId()
.toString() + ""
) {
mBinding!!.roomTop.rl.visibility = View.VISIBLE
ivSoundEffects(true)
} else {
mBinding!!.roomTop.rl.visibility = View.GONE
ivSoundEffects(false)
}
if (mRoomInfoResp!!.room_info.type_id == "7" || mRoomInfoResp!!.room_info.type_id == "2") {
mBinding!!.rlMore.visibility = View.GONE
mBinding!!.rlMisc.visibility = View.GONE
}
setupEffectView()
// 使用Handler延迟执行确保Fragment视图已完全创建
Handler(Looper.getMainLooper()).post {
if (publicScreenFragment != null && publicScreenFragment!!.isAdded && publicScreenFragment!!.view != null) {
publicScreenFragment!!.getUpRoomInfo(resp)
}
}
}
private fun checkAndRestoreMinimizeState() {
val prefs = getSharedPreferences("room_minimize_state", Context.MODE_PRIVATE)
var isMinimized = prefs.getBoolean("is_minimized", false)
@@ -1185,17 +1295,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
})
mBinding!!.roomTop.root.isClickable = false
mBinding!!.roomTop.root.setOnClickListener {
// ToastUtils.showShort("点击了房间,事件穿透");
}
// mBinding!!.clXsb.setOnClickListener {
// val fragment = HourlyChartDialog.newInstance()
// fragment.show(supportFragmentManager,"HourlyChartDialog")
// if (fragment != null) {
// addActiveDialogFragment(fragment) // 添加到管理列表
// }
// }
setview(mRoomInfoResp)
}
@@ -1222,7 +1322,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
fun roomInfoEvent(messageEvent: RoomMessageEvent?) {
if (messageEvent == null) return
if (roomFragment == null) {
roomFragment = RoomFragment.newInstance()
roomFragment = RoomFragment.newInstance(mRoomInfoResp)
supportFragmentManager
.beginTransaction()
.replace(R.id.vp_room_pager, roomFragment!!)
@@ -1239,15 +1339,29 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
.dropLastWhile { it.isEmpty() }.toTypedArray()
)
QXGiftPlayerManager.getInstance(this).displayFullEffectView1(playQueue)
if (messageEvent!!.text.giftInfo!=null) {
var giftBean = messageEvent.text.giftInfo
giftBean.nickname= messageEvent.text.fromUserInfo.nickname
giftBean.userAvatar=messageEvent.text.fromUserInfo.avatar
giftBean.senderName=messageEvent.text.toUserInfo.nickname
giftBean.senderAvatarUrl=messageEvent.text.toUserInfo.avatar
giftBean.number=messageEvent.text.gift_num.toInt()
giftManager.receiveGift(giftBean)
}
// if(messageEvent?.text?.toUserInfos!=null){
// for (i in messageEvent.text.toUserInfos.indices){
// var giftBean = messageEvent.text.giftInfo
// giftBean.nickname= messageEvent.text.fromUserInfo.nickname
// giftBean.userAvatar=messageEvent.text.fromUserInfo.avatar
// giftBean.senderName=messageEvent.text.toUserInfos.get(i).nickname
// giftBean.senderAvatarUrl=messageEvent.text.toUserInfos.get(i).avatar
//
// giftBean.number=messageEvent.text.gift_num.toInt()
// giftManager.receiveGift(giftBean)
// }
// }else {
if (messageEvent!!.text.giftInfo != null) {
var giftBean = messageEvent.text.giftInfo
giftBean.nickname = messageEvent.text.fromUserInfo.nickname
giftBean.userAvatar = messageEvent.text.fromUserInfo.avatar
LogUtils.e("1005", messageEvent.text.toUserInfo?.nickname)
giftBean.senderName = messageEvent.text.toUserInfo?.nickname
giftBean.senderAvatarUrl = messageEvent.text.toUserInfo?.avatar
giftBean.number = messageEvent.text.gift_num.toInt()
giftManager.receiveGift(giftBean)
}
// }
hand1005(messageEvent, text)
} else if (msgType == 123) {
EventBus.getDefault().post(RoomSettingEvent())
@@ -1787,7 +1901,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
private fun handleMsgType1003(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return
if (roomFragment == null) {
roomFragment = RoomFragment.newInstance()
roomFragment = RoomFragment.newInstance(mRoomInfoResp)
supportFragmentManager
.beginTransaction()
.replace(R.id.vp_room_pager, roomFragment!!)
@@ -2648,13 +2762,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
RoomManager.getInstance().exitRoom(roomId)
// 清理资源
cleanupResources()
if (type == 1) {
// 导航到首页
navigateToMainPage()
} else if (type == 2) {
// 返回上一个页面
finish()
}
// if (type == 1) {
// // 导航到首页
// navigateToMainPage()
// } else if (type == 2) {
// // 返回上一个页面
// finish()
// }
finish()
}
@@ -2685,14 +2799,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
return false
}
private fun navigateToMainPage() {
ARouter.getInstance()
.build(ARouteConstants.ME)
.navigation()
// 添加转场动画
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
}
private fun quitUpRoom() {
// 清理最小化状态
@@ -3582,7 +3688,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onResume() {
super.onResume()
if (true)
return
LogUtils.e("RoomActivity", "onResume")
CommonAppContext.getInstance().isShow = true
CommonAppContext.getInstance().isPlaying = true
@@ -3892,7 +3999,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val labelId = mRoomInfoResp!!.room_info.label_id
CommonAppContext.getInstance().lable_id = typeId
if (roomFragment == null) {
roomFragment = RoomFragment.newInstance()
roomFragment = RoomFragment.newInstance(mRoomInfoResp)
supportFragmentManager
.beginTransaction()
.replace(R.id.vp_room_pager, roomFragment!!)
@@ -4081,8 +4188,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
).show()
}
override fun onDestroy() {
LogUtils.e("RoomActivity", "onDestroy")
override fun finish() {
LogUtils.e("RoomActivity", "finish")
// 只有在真正退出房间时才清理最小化状态
if (!isMinimized) {
clearMinimizeState()
@@ -4094,63 +4201,64 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
giftManager.clearAll()
mBinding!!.giftContainer.removeAllViews()
// 确保父类的 onDestroy 被调用
super.onDestroy()
super.finish()
}
fun cleanupResources() {
sDestroied = true
overridePendingTransition(0, 0)
try {
// 1. 清理 EventBus 注册
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this)
}
Observable.create<Boolean> {
try {
// 1. 清理 EventBus 注册
if (EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().unregister(this)
}
// 2. 清理 Handler 回调
if (roomSwitchHandler != null) {
roomSwitchHandler.removeCallbacksAndMessages(null)
}
// 2. 清理 Handler 回调
if (roomSwitchHandler != null) {
roomSwitchHandler.removeCallbacksAndMessages(null)
}
// 3. 清理 CountDownTimer
releaseCountDownTimer()
releaseCountDownTimer1()
if (giftCountTimer != null) {
giftCountTimer!!.cancel()
giftCountTimer = null
}
// 3. 清理 CountDownTimer
releaseCountDownTimer()
releaseCountDownTimer1()
if (giftCountTimer != null) {
giftCountTimer!!.cancel()
giftCountTimer = null
}
// 4. 清理 SVGA 资源
clearSVGAResources()
// 4. 清理 SVGA 资源
clearSVGAResources()
// 5. 清理自定义悬浮窗
if (customMusicFloatingView != null) {
customMusicFloatingView!!.destroy()
customMusicFloatingView = null
}
// 5. 清理自定义悬浮窗
if (customMusicFloatingView != null) {
customMusicFloatingView!!.destroy()
customMusicFloatingView = null
}
// 6. 清理 Agora 资源
// 6. 清理 Agora 资源
// if (AgoraManager.getInstance(this) != null) {
// AgoraManager.getInstance(this).cleanup();
// }
// 清理所有弹框
dismissAllDialogs()
// 7. 清理 Fragment
cleanupFragments()
dismissAllDialogs()
// 7. 清理 Fragment
cleanupFragments()
// 8. 清理监听器
if (mBinding != null) {
// 移除所有 OnClickListener 防止内存泄漏
clearClickListeners()
}
ThreadUtils.cancel()
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
stopkeepLiveService() //停止service
CommonAppContext.getInstance().onlineMap.clear()
// 8. 清理监听器
if (mBinding != null) {
// 移除所有 OnClickListener 防止内存泄漏
clearClickListeners()
}
ThreadUtils.cancel()
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
stopkeepLiveService() //停止service
CommonAppContext.getInstance().onlineMap.clear()
// ImageUtils.clearDiskCache(this)
} catch (e: Exception) {
LogUtils.e("cleanupResources error: " + e.message)
}
} catch (e: Exception) {
LogUtils.e("cleanupResources error: " + e.message)
}
}.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe()
}
/**

View File

@@ -43,6 +43,7 @@ import com.xscm.moduleutil.bean.room.EMMessageInfo;
import com.xscm.moduleutil.utils.ColorManager;
import com.xscm.moduleutil.utils.ImageUtils;
import com.xscm.moduleutil.utils.logger.Logger;
import com.xscm.moduleutil.widget.AdaptiveImageView;
import com.xscm.moduleutil.widget.GifAvatarOvalView;
import com.xscm.moduleutil.widget.img.BubbleBackgroundHelper;
@@ -74,7 +75,7 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
super(null);
addItemType(1, com.xscm.moduleutil.R.layout.ease_row_received_message_system);//系统消息、官方公告
addItemType(2, com.xscm.moduleutil.R.layout.ease_row_received_message_user_send);//用户发送的消息
addItemType(3, com.xscm.moduleutil.R.layout.ease_row_received_message_user_send);//加入房间 、赠送礼物、上下麦、禁言 2025年6月12日15:42:08让和聊天显示的是同一个额布局后面需要修改
addItemType(3, com.xscm.moduleutil.R.layout.ease_row_received_message_giftr_send);//加入房间 、赠送礼物、上下麦、禁言 2025年6月12日15:42:08让和聊天显示的是同一个额布局后面需要修改
// addItemType(3, com.qxcm.moduleutil.R.layout.ease_row_received_message_join_room);//加入房间 、赠送礼物、上下麦、禁言
addItemType(4, com.xscm.moduleutil.R.layout.ease_row_received_message_new_user);//新用户注册
addItemType(5, com.xscm.moduleutil.R.layout.ease_row_received_message_wagging);//摇签
@@ -197,8 +198,7 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
@Override
protected void convert(BaseViewHolder helper, EMMessageInfo item) {
RoomMessageEvent emMessage = item.getEmMessage();
//
TextView tv_content = helper.getView(R.id.tv_content);
// 重置 ImageView 状态,防止复用导致的图片错乱
switch (helper.getItemViewType()) {
case 1:
@@ -209,7 +209,10 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
// tv_content.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
break;
case 2:
helper.getView(com.xscm.moduleutil.R.id.im_emj).setVisibility(View.VISIBLE);
AdaptiveImageView emojiImageView = helper.getView(com.xscm.moduleutil.R.id.im_emj);
emojiImageView.setTag("");
Glide.with(mContext).clear(emojiImageView);
emojiImageView.setVisibility(View.VISIBLE);
helper.getView(com.xscm.moduleutil.R.id.tv_content).setVisibility(View.GONE);
@@ -227,8 +230,8 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
if (url.contains("http")) {
ImageView imageView = new ImageView(helper.itemView.getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
);
params.setMargins(0, 0, helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView.setLayoutParams(params);
@@ -240,12 +243,8 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
}
if (emMessage.getText().getFromUserInfo().getChat_bubble() != null && !emMessage.getText().getFromUserInfo().getChat_bubble().isEmpty()) {
// helper.getView(com.xscm.moduleutil.R.id.bubble).setBackgroundResource(com.xscm.moduleutil.R.mipmap.qipaokang);
// ImageUtils.loadHeadCC(emMessage.getText().getFromUserInfo().getChat_bubble(), helper.getView(com.xscm.moduleutil.R.id.network_background));
// 使用 Glide 加载图片并设置名称
String imageUrl = emMessage.getText().getFromUserInfo().getChat_bubble();
Glide.with(mContext)
.load(imageUrl)
.into(new SimpleTarget<Drawable>() {
@@ -271,83 +270,115 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
helper.getView(com.xscm.moduleutil.R.id.bubble).setBackgroundResource(com.xscm.moduleutil.R.drawable.ease_row_pubilc_user_bg);
}
if (emMessage.getText().getEmoji() != null) {
if (Objects.equals(emMessage.getText().getEmoji().getAnimate_image(), "") || emMessage.getText().getEmoji().getAnimate_image().isEmpty()) {
ImageUtils.loadHeadCC(emMessage.getText().getEmoji().getImage(), helper.getView(com.xscm.moduleutil.R.id.im_emj));
// 为每个加载任务设置唯一标识
String uniqueId = emMessage.getRoomId() + "_" + helper.getLayoutPosition();
emojiImageView.setTag(uniqueId);
if (Objects.equals(emMessage.getText().getEmoji().getAnimate_image(), "") ||
emMessage.getText().getEmoji().getAnimate_image().isEmpty()) {
// 检查视图是否仍属于当前数据项
if (uniqueId.equals(emojiImageView.getTag())) {
ImageUtils.loadHeadCC(emMessage.getText().getEmoji().getImage(), emojiImageView);
}
return;
}
if (helper.getView(com.xscm.moduleutil.R.id.im_emj).getTag() != null && helper.getView(com.xscm.moduleutil.R.id.im_emj).getTag().equals(emMessage.getText().getEmoji().getAnimate_image())) {
return; // 已经加载过,不需要重新加载
}
// 使用 RequestListener 监听加载完成
Glide.with(mContext)
.load(emMessage.getText().getEmoji().getAnimate_image())
.listener(new RequestListener<Drawable>() {
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
// 加载完成后执行
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// 清除 Glide 缓存
// Glide.get(mContext).clearDiskCache();
// 更换图片
Glide.with(mContext)
.load(emMessage.getText().getEmoji().getImage())
.into((ImageView) helper.getView(com.xscm.moduleutil.R.id.im_emj));
}
}, 1500);
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target,
DataSource dataSource, boolean isFirstResource) {
// 检查视图是否仍属于当前数据项
if (uniqueId.equals(emojiImageView.getTag())) {
// 加载完成后执行
new Handler().postDelayed(() -> {
// 再次检查视图状态
if (uniqueId.equals(emojiImageView.getTag())) {
Glide.with(mContext)
.load(emMessage.getText().getEmoji().getImage())
.into(emojiImageView);
}
}, 1500);
}
return false;
}
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target,
boolean isFirstResource) {
return false;
}
})
.into((ImageView) helper.getView(com.xscm.moduleutil.R.id.im_emj));
// 设置标签,避免重复加载
helper.getView(com.xscm.moduleutil.R.id.im_emj).setTag(emMessage.getText().getEmoji().getAnimate_image());
.into(emojiImageView);
} else {
helper.getView(com.xscm.moduleutil.R.id.tv_content).setVisibility(View.VISIBLE);
helper.getView(com.xscm.moduleutil.R.id.im_emj).setVisibility(View.GONE);
emojiImageView.setVisibility(View.GONE);
}
break;
case 3:
if (emMessage.getText().getFromUserInfo() != null && emMessage.getText().getFromUserInfo().getChat_bubble() != null && !emMessage.getText().getFromUserInfo().getChat_bubble().isEmpty()) {
helper.getView(com.xscm.moduleutil.R.id.bubble).setBackgroundResource(com.xscm.moduleutil.R.mipmap.qipaokang);
} else {
helper.getView(com.xscm.moduleutil.R.id.bubble).setBackgroundResource(com.xscm.moduleutil.R.drawable.ease_row_pubilc_user_bg);
}
if (emMessage.getText().getFromUserInfo() != null && emMessage.getText().getFromUserInfo().getAvatar() != null) {
ImageUtils.loadHeadCC(emMessage.getText().getFromUserInfo().getAvatar(), helper.getView(com.xscm.moduleutil.R.id.avatar));
}
helper.setText(com.xscm.moduleutil.R.id.tv_name, emMessage.getText().getFromUserInfo().getNickname());
// if (emMessage.getText().getFromUserInfo().getChat_bubble() != null && !emMessage.getText().getFromUserInfo().getChat_bubble().isEmpty()) {
//// helper.getView(com.xscm.moduleutil.R.id.bubble).setBackgroundResource(com.xscm.moduleutil.R.mipmap.qipaokang);
//// ImageUtils.loadHeadCC(emMessage.getText().getFromUserInfo().getChat_bubble(), helper.getView(com.xscm.moduleutil.R.id.network_background));
//
// // 使用 Glide 加载图片并设置名称
// String imageUrl = emMessage.getText().getFromUserInfo().getChat_bubble();
//
// Glide.with(mContext)
// .load(imageUrl)
// .into(new SimpleTarget<Drawable>() {
// @Override
// public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
// // 将资源转换为 Bitmap
// if (resource instanceof BitmapDrawable) {
// Bitmap bitmap = ((BitmapDrawable) resource).getBitmap();
// // 创建新的文件名
// Drawable fakeNinePatch = new FakeNinePatchDrawable(bitmap, 0.4f, 0.4f, 0.6f, 0.5f);
//
// // 保存图片到本地
// helper.getView(com.xscm.moduleutil.R.id.bubble).setBackground(fakeNinePatch);
// }
// }
//
// @Override
// public void onLoadFailed(@Nullable Drawable errorDrawable) {
// // 加载失败处理
// }
// });
// } else {
helper.getView(com.xscm.moduleutil.R.id.bubble1).setBackgroundResource(com.xscm.moduleutil.R.drawable.ease_row_pubilc_user_bg);
// }
// if (emMessage.getText().getFromUserInfo() != null && emMessage.getText().getFromUserInfo().getAvatar() != null) {
// ImageUtils.loadHeadCC(emMessage.getText().getFromUserInfo().getAvatar(), helper.getView(com.xscm.moduleutil.R.id.avatar));
// }
// helper.setText(com.xscm.moduleutil.R.id.tv_name, emMessage.getText().getFromUserInfo().getNickname());
// helper.setText(com.xscm.moduleutil.R.id.tv_content, emMessage.getText().getText());
helper.setText(com.xscm.moduleutil.R.id.tv_content, getSpannable(emMessage));
List<String> images1 = emMessage.getText().getFromUserInfo().getIcon();
LinearLayout ll_images1 = helper.getView(com.xscm.moduleutil.R.id.line);
ll_images1.removeAllViews();
// tv_content.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
if (images1 == null) {
return;
}
for (String url : images1) {
if (url.contains("http")) {
ImageView imageView = new ImageView(helper.itemView.getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
);
params.setMargins(0, 0, helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView.setLayoutParams(params);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
// 使用 Glide 加载图片
ImageUtils.loadHeadCC(url, imageView);
ll_images1.addView(imageView);
}
}
// List<String> images1 = emMessage.getText().getFromUserInfo().getIcon();
// LinearLayout ll_images1 = helper.getView(com.xscm.moduleutil.R.id.line);
// ll_images1.removeAllViews();
// if (images1 == null) {
// return;
// }
// for (String url : images1) {
// if (url.contains("http")) {
// ImageView imageView = new ImageView(helper.itemView.getContext());
// LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
// helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
// helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
// );
// params.setMargins(0, 0, helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
// imageView.setLayoutParams(params);
// imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
// // 使用 Glide 加载图片
// ImageUtils.loadHeadCC(url, imageView);
// ll_images1.addView(imageView);
// }
// }
break;
// case 4:
@@ -546,28 +577,29 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
@Override
public void onViewRecycled(@NonNull BaseViewHolder holder) {
Logger.e("onViewRecycled", "onViewRecycled");
ImageView ivEmoji = holder.getView(com.xscm.moduleutil.R.id.iv_expression);
// AdaptiveImageView imEmj = (AdaptiveImageView)holder.getView(com.xscm.moduleutil.R.id.im_emj);
GifAvatarOvalView avatarOvalView = holder.getView(com.xscm.moduleutil.R.id.avatar);
// ImageView ivGrade = holder.getView(com.qxcm.moduleutil.R.id.iv_grade);
ImageView ivNobility = holder.getView(com.xscm.moduleutil.R.id.iv_nobility);
ImageView ivCharm = holder.getView(com.xscm.moduleutil.R.id.iv_charm);
// ImageView ivTitle = holder.getView(com.qxcm.moduleutil.R.id.iv_title_label);
if (mContext instanceof Activity && (((Activity) mContext).isFinishing() || ((Activity) mContext).isDestroyed())) {
return;
}
try {
// 清理表情图片
if (holder.getView(com.xscm.moduleutil.R.id.im_emj) != null) {
ImageView imEmj = (ImageView) holder.getView(com.xscm.moduleutil.R.id.im_emj);
imEmj.setTag(null);
imEmj.setImageDrawable(null);
Glide.with(imEmj.getContext()).clear(imEmj);
}
// 清理其他图片
if (avatarOvalView != null) {
avatarOvalView.setImageDrawable(null);
Glide.with(avatarOvalView.getContext()).clear(avatarOvalView);
}
if (ivEmoji != null) {
ivEmoji.setImageDrawable(null);
Glide.with(ivEmoji.getContext()).clear(ivEmoji);
}
// if (ivGrade != null) {
// ivGrade.setImageDrawable(null);
// Glide.with(ivGrade.getContext()).clear(ivGrade);
// }
if (ivNobility != null) {
ivNobility.setImageDrawable(null);
Glide.with(ivNobility.getContext()).clear(ivNobility);
@@ -576,17 +608,13 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
ivCharm.setImageDrawable(null);
Glide.with(ivCharm.getContext()).clear(ivCharm);
}
// if (ivTitle != null) {
// ivTitle.setImageDrawable(null);
// Glide.with(ivTitle.getContext()).clear(ivTitle);
// }
} catch (Exception e) {
e.printStackTrace();
}
super.onViewRecycled(holder);
}
/**
* 清除数据
*

View File

@@ -65,8 +65,8 @@ public class RankingAutcionAdapter extends BaseQuickAdapter<RoomAuction.AuctionL
if (url.contains("http")) {
ImageView imageView1 = new ImageView(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
);
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView1.setLayoutParams(params);

View File

@@ -68,8 +68,8 @@ public class RankingCharmListAdapter extends BaseQuickAdapter<CharmRankingResp,
if (url.contains("http")) {
ImageView imageView1 = new ImageView(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
);
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView1.setLayoutParams(params);

View File

@@ -43,8 +43,8 @@ public class RoomCharmAdapter extends BaseQuickAdapter<RoomUserCharmListBean, Ba
if (url.contains("http")) {
ImageView imageView1 = new ImageView(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
);
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView1.setLayoutParams(params);

View File

@@ -98,8 +98,8 @@ public class RoomOnlineAdapter extends BaseMultiItemQuickAdapter<RoomOnlineBean,
if (url.contains("http")) {
ImageView imageView1 = new ImageView(helper.itemView.getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_14)
);
params.setMargins(0, 0, helper.itemView.getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView1.setLayoutParams(params);

View File

@@ -89,8 +89,8 @@ public class BidListDialogFragment extends BaseMvpDialogFragment<BidListPresente
if (url.contains("http")) {
ImageView imageView1 = new ImageView(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
);
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView1.setLayoutParams(params);
@@ -119,8 +119,8 @@ public class BidListDialogFragment extends BaseMvpDialogFragment<BidListPresente
if (url.contains("http")) {
ImageView imageView1 = new ImageView(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
);
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView1.setLayoutParams(params);
@@ -149,8 +149,8 @@ public class BidListDialogFragment extends BaseMvpDialogFragment<BidListPresente
if (url.contains("http")) {
ImageView imageView1 = new ImageView(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_57),
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
);
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
imageView1.setLayoutParams(params);

Some files were not shown because too many files have changed in this diff Show More