1:修改获取网络数据的解析方式

2:修改拍卖房的规则
This commit is contained in:
2025-09-24 15:59:41 +08:00
parent 5f573e607d
commit 407b21c33f
23 changed files with 1790 additions and 344 deletions

View File

@@ -11,9 +11,9 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 102, "versionCode": 158,
"versionName": "1.0.0", "versionName": "1.0.5",
"outputFile": "秘地_1.0.0_102.apk" "outputFile": "秘地_1.0.5_158.apk"
} }
], ],
"elementType": "File", "elementType": "File",
@@ -22,14 +22,14 @@
"minApi": 28, "minApi": 28,
"maxApi": 30, "maxApi": 30,
"baselineProfiles": [ "baselineProfiles": [
"baselineProfiles/1/秘地_1.0.0_102.dm" "baselineProfiles/1/秘地_1.0.5_158.dm"
] ]
}, },
{ {
"minApi": 31, "minApi": 31,
"maxApi": 2147483647, "maxApi": 2147483647,
"baselineProfiles": [ "baselineProfiles": [
"baselineProfiles/0/秘地_1.0.0_102.dm" "baselineProfiles/0/秘地_1.0.5_158.dm"
] ]
} }
], ],

View File

@@ -19,7 +19,39 @@ import com.xscm.moduleutil.dialog.PolicyDialog;
import com.xscm.moduleutil.utils.ARouteConstants; import com.xscm.moduleutil.utils.ARouteConstants;
import com.xscm.moduleutil.utils.SpUtil; import com.xscm.moduleutil.utils.SpUtil;
import com.xscm.midi.databinding.ActivityLaunchPageBinding; import com.xscm.midi.databinding.ActivityLaunchPageBinding;
/**
APP准备启动
*
* _oo0oo_
* o8888888o
* 88" . "88
* (| -_- |)
* 0\ = /0
* ___/`---'\___
* .' \\| |// '.
* / \\||| : |||// \
* / _||||| -卍-|||||- \
* | | \\\ - /// | |
* | \_| ''\---/'' |_/ |
* \ .-\__ '-' ___/-. /
* ___'. .' /--.--\ `. .'___
* ."" '< `.___\_<|>_/___.' >' "".
* | | : `- \`.;`\ _ /`;.`/ - ` : | |
* \ \ `_. \_ __\ /__ _/ .-` / /
*=====`-.____`.___ \_____/___.-`___.-'=====
* `=---='
*
* 佛祖保佑 永无BUG
* 佛曰:
* 写字楼里写字间,写字间里程序员;
* 程序人员写程序,又拿程序换酒钱。
* 酒醒只在网上坐,酒醉还来网下眠;
* 酒醉酒醒日复日,网上网下年复年。
* 但愿老死电脑间,不愿鞠躬老板前;
* 奔驰宝马贵者趣,公交自行程序员。
* 别人笑我忒疯癫,我笑自己命太贱;
* 不见满街漂亮妹,哪个归得程序员?
*/
public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPageBinding> { public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPageBinding> {
private Handler handler; private Handler handler;
private PolicyDialog policyDialog; private PolicyDialog policyDialog;

View File

@@ -29,8 +29,8 @@ isBuildModule=false
#org.gradle.deamon=false #org.gradle.deamon=false
android.injected.testOnly=false android.injected.testOnly=false
APP_VERSION_NAME=1.0.3 APP_VERSION_NAME=1.0.5
APP_VERSION_CODE=155 APP_VERSION_CODE=158
org.gradle.jvm.toolchain.useLegacyAdapters=false org.gradle.jvm.toolchain.useLegacyAdapters=false
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15 #org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15

View File

@@ -8,6 +8,7 @@ import androidx.annotation.NonNull;
import com.blankj.utilcode.util.ScreenUtils; import com.blankj.utilcode.util.ScreenUtils;
import com.xscm.moduleutil.R; import com.xscm.moduleutil.R;
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
import com.xscm.moduleutil.color.ThemeableDrawableUtils; import com.xscm.moduleutil.color.ThemeableDrawableUtils;
import com.xscm.moduleutil.databinding.DialogRealNameBinding; import com.xscm.moduleutil.databinding.DialogRealNameBinding;
import com.xscm.moduleutil.databinding.IndexDialogYouthModelBinding; import com.xscm.moduleutil.databinding.IndexDialogYouthModelBinding;
@@ -20,6 +21,18 @@ import com.xscm.moduleutil.widget.dialog.BaseDialog;
*/ */
public class RealNameDialog extends BaseDialog<DialogRealNameBinding> { public class RealNameDialog extends BaseDialog<DialogRealNameBinding> {
public interface OnFirstChargeListener {
void onFirstChargeConfirmed(String giftBean, int type);
void onFirstChargeCancelled();
}
private OnFirstChargeListener listener;
// 设置监听器的方法
public void setOnFirstChargeListener(OnFirstChargeListener listener) {
this.listener = listener;
}
public RealNameDialog(@NonNull Context context) { public RealNameDialog(@NonNull Context context) {
super(context); super(context);
} }
@@ -36,8 +49,19 @@ public class RealNameDialog extends BaseDialog<DialogRealNameBinding> {
Window window = getWindow(); Window window = getWindow();
window.setLayout((int) (ScreenUtils.getScreenWidth() * 315.f / 375), WindowManager.LayoutParams.WRAP_CONTENT); window.setLayout((int) (ScreenUtils.getScreenWidth() * 315.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
mBinding.tvIKnow.setOnClickListener(v -> dismiss()); // mBinding.tvIKnow.setOnClickListener(v -> dismiss());
mBinding.ivClose.setOnClickListener(v -> dismiss()); // mBinding.ivClose.setOnClickListener(v -> dismiss());
mBinding.tvIKnow.setOnClickListener(v -> {
if (listener != null) {
listener.onFirstChargeConfirmed(null, 0);
}
});
mBinding.ivClose.setOnClickListener(v -> {
if (listener != null) {
listener.onFirstChargeCancelled();
}
});
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvIKnow, ColorManager.getInstance().getPrimaryColorInt(), 53); ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvIKnow, ColorManager.getInstance().getPrimaryColorInt(), 53);
mBinding.tvIKnow.setTextColor(ColorManager.getInstance().getButtonColorInt()); mBinding.tvIKnow.setTextColor(ColorManager.getInstance().getButtonColorInt());

View File

@@ -0,0 +1,228 @@
package com.xscm.moduleutil.dialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebViewClient;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.tencent.imsdk.v2.V2TIMConversation;
import com.tencent.mm.opensdk.modelbiz.WXOpenCustomerServiceChat;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.tencent.qcloud.tuicore.TUIConstants;
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIC2CChatActivity;
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIGroupChatActivity;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.base.RoomManager;
import com.xscm.moduleutil.databinding.DialogRoomAuctionWebviewBinding;
import com.xscm.moduleutil.databinding.WebViewDialogBinding;
import com.xscm.moduleutil.utils.ARouteConstants;
import com.xscm.moduleutil.widget.dialog.BaseDialog;
/**
*@author qx
*@data 2025/9/24
*@description: 这是拍卖房的规则界面
*/
public class RoomAuctionWebViewDialog extends BaseDialog<DialogRoomAuctionWebviewBinding> {
String mUrl;
int type;//10天空之境 11岁月之城 12时空之巅
public RoomAuctionWebViewDialog(@NonNull Context context, Bundle args) {
super(context, R.style.BaseDialogStyleH);
this.mUrl = args.getString("url");
this.type = args.getInt("type");
initData1();
}
@Override
public void onStart() {
super.onStart();
if (getWindow() != null) {
// 获取屏幕尺寸
android.util.DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
// 设置高度为屏幕高度的80%
android.view.WindowManager.LayoutParams params = getWindow().getAttributes();
params.height = (int) (displayMetrics.heightPixels * 0.9);
params.width = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
getWindow().setAttributes(params);
}
}
@Override
public int getLayoutId() {
return R.layout.dialog_room_auction_webview;
}
@Override
public void initView() {
setCancelable(true);
setCanceledOnTouchOutside(true);
Window window = getWindow();
assert window != null;
window.setGravity(Gravity.BOTTOM);
window.setLayout((int) (ScreenUtils.getScreenWidth() * 320.f / 375), WindowManager.LayoutParams.MATCH_PARENT);
mBinding.topBar.setTitle("规则");
mBinding.topBar.getIvBack().setOnClickListener(v -> dismiss());
}
@Override
public void initData() {
}
public void initData1() {
// WebSettings webSettings = mBinding.webView.getSettings();
// webSettings.setUseWideViewPort(true);
// webSettings.setLoadWithOverviewMode(true);
// webSettings.setJavaScriptEnabled(true);
// webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); //关闭webview中缓存
// //增加JSBridge
// mBinding.webView.addJavascriptInterface(new WebAppInterface(getContext()), "Android");
//// mBinding.webView.addJavascriptInterface(new WebViewBridgeConfig(title), WebViewBridgeConfig.NAME);
// webSettings.setBuiltInZoomControls(false);
// webSettings.setSupportZoom(false);
// webSettings.setDomStorageEnabled(true);
// webSettings.setBlockNetworkImage(false);//解决图片不显示
// // 启用 WebView 内容的滚动
// mBinding.webView.setVerticalScrollBarEnabled(true);
// mBinding.webView.setScrollbarFadingEnabled(true);
// webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
// webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
// mBinding.webView.setHorizontalScrollBarEnabled(false);//水平不显示
// mBinding.webView.setVerticalScrollBarEnabled(false); //垂直不显示
// mBinding.webView.setWebViewClient(new WebViewClient());
// mBinding.webView.setBackgroundColor(Color.TRANSPARENT);
// mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
//
// mBinding.webView.requestFocus();
// mBinding.webView.loadUrl(mUrl);
WebSettings webSettings = mBinding.webView.getSettings();
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setJavaScriptEnabled(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); //关闭webview中缓存
//增加JSBridge
mBinding.webView.addJavascriptInterface(new WebAppInterface(getContext()), "Android");
// mBinding.webView.addJavascriptInterface(new WebViewBridgeConfig(title), WebViewBridgeConfig.NAME);
webSettings.setBuiltInZoomControls(false);
webSettings.setSupportZoom(false);
webSettings.setDomStorageEnabled(true);
webSettings.setBlockNetworkImage(false);//解决图片不显示
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
// 启用 WebView 内容的滚动,但隐藏滚动条
mBinding.webView.setHorizontalScrollBarEnabled(false);//水平不显示
mBinding.webView.setVerticalScrollBarEnabled(false); //垂直不显示滚动条
mBinding.webView.setWebViewClient(new WebViewClient());
mBinding.webView.setBackgroundColor(Color.TRANSPARENT);
mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
// 确保内容可以滚动
webSettings.setDomStorageEnabled(true);
mBinding.webView.requestFocus();
mBinding.webView.loadUrl(mUrl);
}
private Resources getResources() {
return getContext().getResources();
}
public class WebAppInterface {
Context mContext;
WebAppInterface(Context c) {
mContext = c;
}
// 被 H5 调用的方法
@JavascriptInterface
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
}
@JavascriptInterface
public void closeWeb() {
LogUtils.e("value: ");
dismiss();
}
@JavascriptInterface
public void customerService() {
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId(); // 填移动应用(App)的 AppId
IWXAPI api = WXAPIFactory.createWXAPI(mContext, appId);
// 判断当前版本是否支持拉起客服会话
WXOpenCustomerServiceChat.Req req = new WXOpenCustomerServiceChat.Req();
req.corpId = "ww1de4300858c0b461"; // 企业ID
req.url = "https://work.weixin.qq.com/kfid/kfcb3d23a59c188a0e7"; // 客服URL
api.sendReq(req);
}
@JavascriptInterface
public void jumpRoomPage(String room_id) {
RoomManager.getInstance().fetchRoomDataAndEnter(getContext(), room_id,"");
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", room_id).navigation();
}
@JavascriptInterface
public void jumpWebPage(String objects) {
// ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).navigation();
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", objects).navigation();
}
@JavascriptInterface
public void enterGroupChat(String group_id,String cover,String guild_name) {
Intent intent = new Intent(mContext, TUIGroupChatActivity.class);
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, group_id);
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_GROUP);
mContext.startActivity(intent);
}
@JavascriptInterface
public void chatWithUser(String user_id,String nickname) {
Intent intent = new Intent(mContext, TUIC2CChatActivity.class);
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, user_id);
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_C2C);
mContext.startActivity(intent);
}
@JavascriptInterface
public void exchange(){
ARouter.getInstance().build(ARouteConstants.CURRENCY).navigation();
}
@JavascriptInterface
public void Withdrawal() {
ARouter.getInstance().build(ARouteConstants.WITHDRAWAL_ACTIVITY).navigation();
}
@JavascriptInterface
public void enterAuthent() {//实名认证
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
}
@JavascriptInterface
public void Recharge(){
ARouter.getInstance().build(ARouteConstants.RECHARGE_ACTIVITY).navigation();
}
}
}

View File

@@ -171,7 +171,7 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_ROOM_RANK) @POST(Constants.POST_ROOM_RANK)
Observable<BaseModel<List<CharmRankingResp>>> getRoomRank(@Field("room_id") String room_id, @Field("type") String type, @Field("time_type") String time_type, @Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<List<CharmRankingResp>>> getRoomRank(@Field("room_id") String room_id, @Field("type") String type, @Field("time_type") String time_type, @Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_ROOM_RANKING) @POST(Constants.POST_ROOM_RANKING)
@@ -182,16 +182,16 @@ public interface ApiServer {
Observable<BaseModel<PlaceholderBean>> loveRanking(@Field("type") String type); Observable<BaseModel<PlaceholderBean>> loveRanking(@Field("type") String type);
@GET(Constants.GET_REAL_NAME) @GET(Constants.GET_REAL_NAME)
Observable<BaseModel<RealNameBean>> realNameInfo(); Call<BaseModel<RealNameBean>> realNameInfo();
@GET(Constants.GET_DAILY_TASK_BOX) @GET(Constants.GET_DAILY_TASK_BOX)
Observable<BaseModel<List<GiftBoxRecordBean>>> dailyTasksBoxRecord(); Call<BaseModel<List<GiftBoxRecordBean>>> dailyTasksBoxRecord();
@GET(Constants.GET_MY_BAG_DATA) @GET(Constants.GET_MY_BAG_DATA)
Observable<BaseModel<List<MyBagDataBean>>> packIncome(@Query("page") String page, @Query("page_limit") String page_size); Call<BaseModel<List<MyBagDataBean>>> packIncome(@Query("page") String page, @Query("page_limit") String page_size);
@GET(Constants.GET_MY_BAG_OUTCOME) @GET(Constants.GET_MY_BAG_OUTCOME)
Observable<BaseModel<List<MyBagDataBean>>> packOutcome(@Query("page") String page, @Query("page_limit") String page_size); Call<BaseModel<List<MyBagDataBean>>> packOutcome(@Query("page") String page, @Query("page_limit") String page_size);
@GET(Constants.GET_GIFT_PACK) @GET(Constants.GET_GIFT_PACK)
Call<BaseModel<List<GiftPackBean>>> giftPack(); Call<BaseModel<List<GiftPackBean>>> giftPack();
@@ -213,7 +213,7 @@ public interface ApiServer {
Call<ResponseBody> endPk(@Field("pk_id") String is_pk, @Field("type") String type, @Field("user_id") String user_id); Call<ResponseBody> endPk(@Field("pk_id") String is_pk, @Field("type") String type, @Field("user_id") String user_id);
@GET(Constants.GET_RECHARGE) @GET(Constants.GET_RECHARGE)
Observable<BaseModel<List<RechargeBean>>> recharge(); Call<BaseModel<List<RechargeBean>>> recharge();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_START_PK) @POST(Constants.POST_START_PK)
@@ -225,7 +225,7 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.SWITCH_ACCOUNTS) @POST(Constants.SWITCH_ACCOUNTS)
Observable<BaseModel<List<UserBean>>> switchAccounts(@Field("user_login") String user_id); Call<BaseModel<List<UserBean>>> switchAccounts(@Field("user_login") String user_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.FORGOT_PASSWORD) @POST(Constants.FORGOT_PASSWORD)
@@ -233,7 +233,7 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.USER_UPDATE) @POST(Constants.USER_UPDATE)
Observable<BaseModel<UserBean>> userUpdate(@Field("nickname") String nickname, @Field("birthday") String birthday, @Field("sex") String sex, @Field("avatar") String avatar, @Field("init_code") String init_code, @Field("user_id") String user_id); Call<BaseModel<UserBean>> userUpdate(@Field("nickname") String nickname, @Field("birthday") String birthday, @Field("sex") String sex, @Field("avatar") String avatar, @Field("init_code") String init_code, @Field("user_id") String user_id);
@GET(Constants.AUTHORIZATION) @GET(Constants.AUTHORIZATION)
Call<ResponseBody> authorization(); Call<ResponseBody> authorization();
@@ -263,18 +263,18 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.REAL_NAME) @POST(Constants.REAL_NAME)
Observable<BaseModel<RealNameBean>> realName(@Field("real_name") String real_name, @Field("card_number") String card_number); Call<BaseModel<RealNameBean>> realName(@Field("real_name") String real_name, @Field("card_number") String card_number);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_EXPAND_COLUMN) @POST(Constants.GET_EXPAND_COLUMN)
Observable<BaseModel<List<ExpandColumnBean>>> getExpandColumn(@Field("type") String type, @Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<List<ExpandColumnBean>>> getExpandColumn(@Field("type") String type, @Field("page") String page, @Field("page_limit") String page_limit);
@GET(Constants.GET_OFFICIAL_NOTICE) @GET(Constants.GET_OFFICIAL_NOTICE)
Observable<BaseModel<NewsDataBean>> getOfficialNotice(); Call<BaseModel<NewsDataBean>> getOfficialNotice();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_ALBUM_LIST) @POST(Constants.GET_ALBUM_LIST)
Observable<BaseModel<List<AlbumBean>>> getAlbumList(@Field("page") String page, @Field("page_limit") String page_limit, @Field("user_id") String user_id); Call<BaseModel<List<AlbumBean>>> getAlbumList(@Field("page") String page, @Field("page_limit") String page_limit, @Field("user_id") String user_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.CREATE_ALBUM) @POST(Constants.CREATE_ALBUM)
@@ -289,19 +289,19 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_FOLLOW_LIST) @POST(Constants.POST_FOLLOW_LIST)
Observable<BaseModel<List<BlackUserBean>>> getUserFollowList(@Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<List<BlackUserBean>>> getUserFollowList(@Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_FANS_LIST) @POST(Constants.POST_FANS_LIST)
Observable<BaseModel<List<BlackUserBean>>> getUserFansList(@Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<List<BlackUserBean>>> getUserFansList(@Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_BLACK_LIST) @POST(Constants.POST_BLACK_LIST)
Observable<BaseModel<List<BlackUserBean>>> getBlacklist(@Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<List<BlackUserBean>>> getBlacklist(@Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_LOCK_MI_LIST) @POST(Constants.POST_LOCK_MI_LIST)
Observable<BaseModel<List<BlackUserBean>>> getLockMiniList(@Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<List<BlackUserBean>>> getLockMiniList(@Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_MY_ROOM) @POST(Constants.GET_MY_ROOM)
@@ -316,7 +316,7 @@ public interface ApiServer {
Call<BaseModel<List<TopRoom>>> getTopRooms(@Field("page") String page, @Field("page_limit") String page_limit, @Field("is_top") String is_top, @Field("label_id") String label_id); Call<BaseModel<List<TopRoom>>> getTopRooms(@Field("page") String page, @Field("page_limit") String page_limit, @Field("is_top") String is_top, @Field("label_id") String label_id);
@GET(Constants.GET_ROOM_TYPE) @GET(Constants.GET_ROOM_TYPE)
Observable<BaseModel<List<RoomTypeModel>>> getRoomCategories(); Call<BaseModel<List<RoomTypeModel>>> getRoomCategories();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.CHECK_TXT) @POST(Constants.CHECK_TXT)
@@ -324,35 +324,35 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_REWARD_LIST) @POST(Constants.GET_REWARD_LIST)
Observable<BaseModel<List<RewardUserBean>>> getRewardList(@Field("id") String id, @Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<List<RewardUserBean>>> getRewardList(@Field("id") String id, @Field("page") String page, @Field("page_limit") String page_limit);
@GET(Constants.GET_GIFT_LABEL) @GET(Constants.GET_GIFT_LABEL)
Observable<BaseModel<List<GiftLabelBean>>> getGiftLabel(@Query("have_hot") String have_hot); Call<BaseModel<List<GiftLabelBean>>> getGiftLabel(@Query("have_hot") String have_hot);
@GET(Constants.GIFT_LIST) @GET(Constants.GIFT_LIST)
//获取礼物列表 //获取礼物列表
Observable<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label,@Query("room_id")String room_id); Call<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label,@Query("room_id")String room_id);
@GET(Constants.TOPIC_LIST) @GET(Constants.TOPIC_LIST)
//获取话题 //获取话题
Observable<BaseModel<List<HeatedBean>>> topicList(@Query("page") String page, @Query("page_limit") String page_limit); Call<BaseModel<List<HeatedBean>>> topicList(@Query("page") String page, @Query("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.PUBLISH_ZONE) @POST(Constants.PUBLISH_ZONE)
Call<BaseModel<String>> publishZone(@Field("images") String images, @Field("content") String content, @Field("topic_id") String topic_id, @Field("room_id") String room_id, @Field("ip") String ip); Call<BaseModel<String>> publishZone(@Field("images") String images, @Field("content") String content, @Field("topic_id") String topic_id, @Field("room_id") String room_id, @Field("ip") String ip);
@GET(Constants.GET_CATEGORIES) @GET(Constants.GET_CATEGORIES)
Observable<BaseModel<List<HeatedBean>>> getCategories(); Call<BaseModel<List<HeatedBean>>> getCategories();
@GET(Constants.GET_CIRCLE_LIST) @GET(Constants.GET_CIRCLE_LIST)
Call<BaseModel<List<CircleListBean>>> getCircleList(@Query("page") String page, @Query("page_limit") String page_limit); Call<BaseModel<List<CircleListBean>>> getCircleList(@Query("page") String page, @Query("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_USER_HOME_ZONE) @POST(Constants.GET_USER_HOME_ZONE)
Observable<BaseModel<List<CircleListBean>>> getCircleUserList(@Field("user_id") String user_id, @Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<List<CircleListBean>>> getCircleUserList(@Field("user_id") String user_id, @Field("page") String page, @Field("page_limit") String page_limit);
@GET(Constants.GET_MY_FOOT) @GET(Constants.GET_MY_FOOT)
Observable<BaseModel<List<MyFootResp>>> getMyFoot(@Query("page") String page, @Query("page_limit") String page_limit); Call<BaseModel<List<MyFootResp>>> getMyFoot(@Query("page") String page, @Query("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.LIKE_ZONE) @POST(Constants.LIKE_ZONE)
@@ -360,15 +360,15 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.TOPIC_ID) @POST(Constants.TOPIC_ID)
Observable<BaseModel<List<CircleListBean>>> topicId(@Field("topic_id") String topic_id); Call<BaseModel<List<CircleListBean>>> topicId(@Field("topic_id") String topic_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.ZONE_DETAIL) @POST(Constants.ZONE_DETAIL)
Observable<BaseModel<CircleListBean>> zoneDetail(@Field("id") String topic_id); Call<BaseModel<CircleListBean>> zoneDetail(@Field("id") String topic_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_USER_HOME) @POST(Constants.GET_USER_HOME)
Observable<BaseModel<UserInfo>> getUserHome(@Field("user_id") String user_id); Call<BaseModel<UserInfo>> getUserHome(@Field("user_id") String user_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.DELETE_COMMENT) @POST(Constants.DELETE_COMMENT)
@@ -376,11 +376,11 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_COMMENT_LIST) @POST(Constants.GET_COMMENT_LIST)
Observable<BaseModel<CommentBean>> getCommentList(@Field("id") String id, @Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<CommentBean>> getCommentList(@Field("id") String id, @Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_SONG) @POST(Constants.POST_SONG)
Observable<BaseModel<List<SongMusicBean>>> song(@Field("room_id") String roomId, @Field("user_id") String userId, @Field("song_code") String songCode, @Field("song_name") String songName, @Field("singer") String singer, @Field("poster") String poster, @Field("duration") String duration); Call<BaseModel<List<SongMusicBean>>> song(@Field("room_id") String roomId, @Field("user_id") String userId, @Field("song_code") String songCode, @Field("song_name") String songName, @Field("singer") String singer, @Field("poster") String poster, @Field("duration") String duration);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.COMMENT_ZONE) @POST(Constants.COMMENT_ZONE)
@@ -403,7 +403,7 @@ public interface ApiServer {
Call<BaseModel<String>> deleteZone(@Field("id") String id); Call<BaseModel<String>> deleteZone(@Field("id") String id);
@GET(Constants.GET_MY_INFO) @GET(Constants.GET_MY_INFO)
Observable<BaseModel<UserInfo>> getMyInfo(); Call<BaseModel<UserInfo>> getMyInfo();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.ED_USER_INFO) @POST(Constants.ED_USER_INFO)
@@ -414,25 +414,25 @@ public interface ApiServer {
Call<BaseModel<String>> editUserBg(@Field("images") String images); Call<BaseModel<String>> editUserBg(@Field("images") String images);
@GET(Constants.GET_USER_TAG_LIST) @GET(Constants.GET_USER_TAG_LIST)
Observable<BaseModel<List<UserTagBean>>> getUserTagList(); Call<BaseModel<List<UserTagBean>>> getUserTagList();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_LIKE_LIST) @POST(Constants.GET_LIKE_LIST)
Observable<BaseModel<List<CircleListBean.LikeList>>> getLikeList(@Field("id") String id); Call<BaseModel<List<CircleListBean.LikeList>>> getLikeList(@Field("id") String id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_ALBUM_DETAIL) @POST(Constants.GET_ALBUM_DETAIL)
Observable<BaseModel<AlbumBean>> getAlbumDetail(@Field("album_id") String albumId, @Field("pwd") String pwd, @Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<AlbumBean>> getAlbumDetail(@Field("album_id") String albumId, @Field("pwd") String pwd, @Field("page") String page, @Field("page_limit") String page_limit);
@GET(Constants.GET_PERSONALTY) @GET(Constants.GET_PERSONALTY)
Observable<BaseModel<List<PersonaltyBean>>> getPersonaltyList(); Call<BaseModel<List<PersonaltyBean>>> getPersonaltyList();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_SUBSIDY) @POST(Constants.GET_SUBSIDY)
Observable<BaseModel<RoomSubsidy>> getSubsidy(@Field("room_id") String roomId); Call<BaseModel<RoomSubsidy>> getSubsidy(@Field("room_id") String roomId);
@GET(Constants.GET_DECORATE) @GET(Constants.GET_DECORATE)
Observable<BaseModel<List<ZhuangBanShangChengBean>>> getDecorateList(@Query("type") String type); Call<BaseModel<List<ZhuangBanShangChengBean>>> getDecorateList(@Query("type") String type);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_GZ) @POST(Constants.POST_GZ)
@@ -497,11 +497,11 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.UPDATEPASSWORD) @POST(Constants.UPDATEPASSWORD)
Observable<BaseModel<String>> updatePassword(@Field("room_id") String roomId, @Field("password") String password); Call<BaseModel<String>> updatePassword(@Field("room_id") String roomId, @Field("password") String password);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_ROOM_ONLINE) @POST(Constants.GET_ROOM_ONLINE)
Observable<BaseModel<RoomOnline>> getRoomOnline(@Field("room_id") String roomId, @Field("page") String page, @Field("page_limit") String page_limit); Call<BaseModel<RoomOnline>> getRoomOnline(@Field("room_id") String roomId, @Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_GIVE_GIFT) @POST(Constants.GET_GIVE_GIFT)
@@ -512,29 +512,29 @@ public interface ApiServer {
Call<BaseModel<String>> roomGift(@Field("room_id") String room_id, @Field("gift_id") String gift_id, @Field("gift_num") String num, @Field("to_uid") String to_uid, @Field("type") String gift_type, @Field("pit_number") String pit_number, @Field("heart_id") String heat_id); Call<BaseModel<String>> roomGift(@Field("room_id") String room_id, @Field("gift_id") String gift_id, @Field("gift_num") String num, @Field("to_uid") String to_uid, @Field("type") String gift_type, @Field("pit_number") String pit_number, @Field("heart_id") String heat_id);
@GET(Constants.GET_FIRST_CHARGE_GIFT) @GET(Constants.GET_FIRST_CHARGE_GIFT)
Observable<BaseModel<FirstChargeGiftBean>> firstChargeGift(); Call<BaseModel<FirstChargeGiftBean>> firstChargeGift();
@GET(Constants.GET_WALLET) @GET(Constants.GET_WALLET)
Observable<BaseModel<WalletBean>> wallet(); Call<BaseModel<WalletBean>> wallet();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_APPLY_Pay) @POST(Constants.POST_APPLY_Pay)
Observable<BaseModel<AppPay>> appPay(@Field("user_id") String user_id, @Field("money") String money, @Field("coin") String coin, @Field("type") String type); Call<BaseModel<AppPay>> appPay(@Field("user_id") String user_id, @Field("money") String money, @Field("coin") String coin, @Field("type") String type);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_APPLY_LIST) @POST(Constants.POST_APPLY_LIST)
Observable<BaseModel<RoomApplyListBean>> roomApplyListBean(@Field("room_id") String room_id); Call<BaseModel<RoomApplyListBean>> roomApplyListBean(@Field("room_id") String room_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_ROOM_USER) @POST(Constants.GET_ROOM_USER)
Observable<BaseModel<UserInfo>> getRoomUserInfo(@Field("room_id") String roomId, @Field("user_id") String userId); Call<BaseModel<UserInfo>> getRoomUserInfo(@Field("room_id") String roomId, @Field("user_id") String userId);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_BIND_TYPE) @POST(Constants.POST_BIND_TYPE)
Observable<BaseModel<BindType>> bindType(@Field("user_id") String userId); Call<BaseModel<BindType>> bindType(@Field("user_id") String userId);
@GET(Constants.GET_WALLET_CONFIG) @GET(Constants.GET_WALLET_CONFIG)
Observable<BaseModel<WalletConfig>> getWalletConfig(); Call<BaseModel<WalletConfig>> getWalletConfig();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_BIND) @POST(Constants.POST_BIND)
@@ -542,7 +542,7 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_SONG_LIST) @POST(Constants.POST_SONG_LIST)
Observable<BaseModel<List<MusicSongBean>>> songList(@Field("room_id") String room_id); Call<BaseModel<List<MusicSongBean>>> songList(@Field("room_id") String room_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.APPLY_PIT) @POST(Constants.APPLY_PIT)
@@ -626,23 +626,23 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_HOST_LIST) @POST(Constants.POST_HOST_LIST)
Observable<BaseModel<List<HostBean>>> getHostList(@Query("room_id") String room_id, @Field("type") String type); Call<BaseModel<List<HostBean>>> getHostList(@Query("room_id") String room_id, @Field("type") String type);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.GET_CHARM_RANK) @POST(Constants.GET_CHARM_RANK)
Observable<BaseModel<List<RoomCharmRankBean>>> getCharmRank(@Field("room_id") String roomId); Call<BaseModel<List<RoomCharmRankBean>>> getCharmRank(@Field("room_id") String roomId);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_ROOM_RELATION_LIST) @POST(Constants.POST_ROOM_RELATION_LIST)
Observable<BaseModel<List<RoomRelationBean>>> roomRelationList(@Field("type") String type); Call<BaseModel<List<RoomRelationBean>>> roomRelationList(@Field("type") String type);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_ROOM_AUCTION_LIST) @POST(Constants.POST_ROOM_AUCTION_LIST)
Observable<BaseModel<List<RoomAuction.AuctionListBean>>> roomAuctionList(@Field("auction_id") String auction_id); Call<BaseModel<List<RoomAuction.AuctionListBean>>> roomAuctionList(@Field("auction_id") String auction_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_SEARCH) @POST(Constants.POST_SEARCH)
Observable<BaseModel<List<RoomSearchResp>>> getSearch(@Query("search") String room_id, @Field("type") String type); Call<BaseModel<List<RoomSearchResp>>> getSearch(@Query("search") String room_id, @Field("type") String type);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.SET_PRESIDED_RATIO) @POST(Constants.SET_PRESIDED_RATIO)
@@ -670,11 +670,11 @@ public interface ApiServer {
Call<BaseModel<String>> setLockPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number, @Field("is_lock") String is_lock); Call<BaseModel<String>> setLockPit(@Field("room_id") String room_id, @Field("pit_number") String pit_number, @Field("is_lock") String is_lock);
@GET(Constants.GET_ROOM_BJ) @GET(Constants.GET_ROOM_BJ)
Observable<BaseModel<RoomBgBean>> getBackgroundList(); Call<BaseModel<RoomBgBean>> getBackgroundList();
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_CHARM_LIST) @POST(Constants.POST_CHARM_LIST)
Observable<BaseModel<RoomDetails>> getCharmList(@Field("room_id") String room_id, @Field("start_time") String start_time, @Field("end_time") String end_time, @Field("page") String page); Call<BaseModel<RoomDetails>> getCharmList(@Field("room_id") String room_id, @Field("start_time") String start_time, @Field("end_time") String end_time, @Field("page") String page);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_SET_UPLOAD_BG_IMG) @POST(Constants.POST_SET_UPLOAD_BG_IMG)
@@ -707,7 +707,7 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_RELATION_CARD) @POST(Constants.POST_RELATION_CARD)
Observable<BaseModel<RelationCardBean>> relationCard(@Field("user_id") String user_id); Call<BaseModel<RelationCardBean>> relationCard(@Field("user_id") String user_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_TOP_RELATION_CARD) @POST(Constants.POST_TOP_RELATION_CARD)
@@ -720,11 +720,11 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_ROOM_AUCTION) @POST(Constants.POST_ROOM_AUCTION)
Observable<BaseModel<AuctionBean>> roomAuction(@Field("room_id") String room_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("relation_id") String relation_id, @Field("auction_type") String auction_type, @Field("time_day") String time_day); Call<BaseModel<AuctionBean>> roomAuction(@Field("room_id") String room_id, @Field("user_id") String user_id, @Field("gift_id") String gift_id, @Field("relation_id") String relation_id, @Field("auction_type") String auction_type, @Field("time_day") String time_day);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_ROOM_AUCTION_TIME) @POST(Constants.POST_ROOM_AUCTION_TIME)
Observable<BaseModel<RoomTime>> roomAuctionTime(@Field("gift_id") String gift_id); Call<BaseModel<RoomTime>> roomAuctionTime(@Field("gift_id") String gift_id);
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_ROOM_AUCTION_JOIN) @POST(Constants.POST_ROOM_AUCTION_JOIN)
@@ -733,7 +733,7 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.POST_SEARCH_PK_ROOM) @POST(Constants.POST_SEARCH_PK_ROOM)
Observable<BaseModel<List<RoomBean>>> searchPkRoom(@Field("room_id") String room_id, @Field("page") String page, @Field("limit") String limit); Call<BaseModel<List<RoomBean>>> searchPkRoom(@Field("room_id") String room_id, @Field("page") String page, @Field("limit") String limit);
@GET(Constants.GET_BOX_GIFT_LIST) @GET(Constants.GET_BOX_GIFT_LIST)
Call<BaseModel<BlindBoxBean>> getBoxGiftList(@Query("gift_bag_id") String gift_bag_id, @Query("room_id") String room_id); Call<BaseModel<BlindBoxBean>> getBoxGiftList(@Query("gift_bag_id") String gift_bag_id, @Query("room_id") String room_id);
@@ -779,6 +779,6 @@ public interface ApiServer {
@FormUrlEncoded @FormUrlEncoded
@POST(Constants.ROOM_USER_RECONNECT) @POST(Constants.ROOM_USER_RECONNECT)
Observable<BaseModel<String>> roomUserReconnect(@Field("room_id") String room_id); Call<BaseModel<String>> roomUserReconnect(@Field("room_id") String room_id);
} }

View File

@@ -46,26 +46,9 @@ public class DefaultTransformer<T> implements ObservableTransformer<BaseModel<T>
T data = response.getData(); T data = response.getData();
if (data == null) { if (data == null) {
return getDefaultValue(); return getDefaultValue();
// 根据类型返回默认值
// if (data instanceof String) {
// data = (T) "";
// } else if (data instanceof List) {
// data = (T) new ArrayList<>();
// } else if (data instanceof Integer) {
// data = (T) Integer.valueOf(0);
// } else if (data instanceof Long) {
// data = (T) Long.valueOf(0L);
// } else if (data instanceof Double) {
// data = (T) Double.valueOf(0.0);
// } else if (data instanceof Float) {
// data = (T) Float.valueOf(0.0f);
// } else if (data instanceof Boolean) {
// data = (T) Boolean.FALSE;
// } else {
// data= ;
// }
} }
return data; return data;
// return response.getData();
}) })
.onErrorResumeNext(throwable -> { .onErrorResumeNext(throwable -> {
// 可以在这里统一处理异常 // 可以在这里统一处理异常
@@ -81,8 +64,26 @@ public class DefaultTransformer<T> implements ObservableTransformer<BaseModel<T>
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private T getDefaultValue() { private T getDefaultValue() {
try { try {
// 尝试返回合理类型的默认值 // 根据类型返回合理的默认值
Class<T> type = (Class<T>) Object.class;
if (String.class.isAssignableFrom(type)) {
return (T) "";
} else if (List.class.isAssignableFrom(type)) {
return (T) new ArrayList<>();
} else if (Integer.class.isAssignableFrom(type) || int.class.isAssignableFrom(type)) {
return (T) Integer.valueOf(0);
} else if (Long.class.isAssignableFrom(type) || long.class.isAssignableFrom(type)) {
return (T) Long.valueOf(0L);
} else if (Double.class.isAssignableFrom(type) || double.class.isAssignableFrom(type)) {
return (T) Double.valueOf(0.0);
} else if (Float.class.isAssignableFrom(type) || float.class.isAssignableFrom(type)) {
return (T) Float.valueOf(0.0f);
} else if (Boolean.class.isAssignableFrom(type) || boolean.class.isAssignableFrom(type)) {
return (T) Boolean.FALSE;
} else {
// 对于其他对象类型返回一个新的Object实例
return (T) new Object(); return (T) new Object();
}
} catch (Exception e) { } catch (Exception e) {
return null; return null;
} }

View File

@@ -2,6 +2,7 @@ package com.xscm.moduleutil.widget;
import android.content.Context; import android.content.Context;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.widget.FrameLayout; import android.widget.FrameLayout;
@@ -47,7 +48,22 @@ public class GiftAnimView extends FrameLayout implements GiftSvgaView.OnAnimatio
private List<String> giftArray = new ArrayList<>(); private List<String> giftArray = new ArrayList<>();
public ExecutorService queue = Executors.newSingleThreadExecutor(); public ExecutorService queue = Executors.newSingleThreadExecutor();
private Context mContext; private Context mContext;
private boolean isOnece;
// 添加带Context参数的构造函数
// 添加带Context和AttributeSet参数的构造函数解决XML inflate问题的关键
public GiftAnimView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
this.mContext = context;
init();
}
// 添加带Context、AttributeSet和 defStyleAttr 参数的构造函数(更完整的实现)
public GiftAnimView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.mContext = context;
init();
}
public void setQueue(ExecutorService queue) { public void setQueue(ExecutorService queue) {
this.queue = queue; this.queue = queue;
} }
@@ -85,6 +101,9 @@ public class GiftAnimView extends FrameLayout implements GiftSvgaView.OnAnimatio
post(() -> { post(() -> {
if (playerMp4View!=null) { if (playerMp4View!=null) {
playerMp4View.setVisibility(View.GONE); playerMp4View.setVisibility(View.GONE);
if (isOnece){
return;
}
// 通知播放完成 // 通知播放完成
notifyPlaybackComplete(); notifyPlaybackComplete();
loadStartSVGAPlayer(); loadStartSVGAPlayer();
@@ -187,6 +206,35 @@ public class GiftAnimView extends FrameLayout implements GiftSvgaView.OnAnimatio
}); });
} }
public void previewEffectWith(String playImage){
this.isOnece=true;
if (playImage.endsWith("mp4")) {
downloadAndPlay(getContext(), playImage, new DownloadCallback() {
@Override
public void onSuccess(File file) {
post(() -> {
playerMp4View.setVisibility(View.VISIBLE);
svgaView.setVisibility(View.GONE);
playerMp4View.startPlay(file);
});
}
@Override
public void onFailure(Exception e) {
LogUtils.e("MP4下载或播放失败: " + e.getMessage());
// 处理失败情况,继续播放下一个
}
});
} else if (playImage.endsWith("svga")) {
// File file = downloadAndPlay(getContext(), playImage);
post(() -> {
playerMp4View.setVisibility(View.GONE);
svgaView.setVisibility(View.VISIBLE);
svgaView.loadSVGAPlayerWith(playImage, false);
});
}
}
public void openOrCloseEffectViewWith(boolean isShow) { public void openOrCloseEffectViewWith(boolean isShow) {
this.isShow = isShow; this.isShow = isShow;
removeSvgaQueueData(); removeSvgaQueueData();
@@ -420,6 +468,9 @@ public class GiftAnimView extends FrameLayout implements GiftSvgaView.OnAnimatio
if (svgaView!=null) { if (svgaView!=null) {
svgaView.setVisibility(View.GONE); svgaView.setVisibility(View.GONE);
} }
if (isOnece){
return;
}
// 通知播放完成 // 通知播放完成
notifyPlaybackComplete(); notifyPlaybackComplete();
loadStartSVGAPlayer(); loadStartSVGAPlayer();

View File

@@ -0,0 +1,32 @@
<?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">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<com.xscm.moduleutil.widget.CustomTopBar
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-30dp"
app:layout_constraintTop_toTopOf="parent" />
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/white"
app:layout_constraintTop_toBottomOf="@+id/top_bar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -53,6 +53,7 @@ import com.xscm.moduleutil.bean.room.RoomBean;
import com.xscm.moduleutil.bean.room.RoomInfoResp; import com.xscm.moduleutil.bean.room.RoomInfoResp;
import com.xscm.moduleutil.bean.room.RoomPitBean; import com.xscm.moduleutil.bean.room.RoomPitBean;
import com.xscm.moduleutil.dialog.ConfirmDialog; import com.xscm.moduleutil.dialog.ConfirmDialog;
import com.xscm.moduleutil.dialog.RoomAuctionWebViewDialog;
import com.xscm.moduleutil.dialog.WebViewDialog; import com.xscm.moduleutil.dialog.WebViewDialog;
import com.xscm.moduleutil.utils.ARouteConstants; import com.xscm.moduleutil.utils.ARouteConstants;
import com.xscm.moduleutil.utils.ClickUtils; import com.xscm.moduleutil.utils.ClickUtils;
@@ -567,9 +568,18 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
// WebViewDialog dialog = new WebViewDialog(getActivity(), bundle); // WebViewDialog dialog = new WebViewDialog(getActivity(), bundle);
// dialog.show(); // dialog.show();
if (type==1) { if (type==1) {
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=23").withString("title", "真爱拍规则").navigation(); Bundle bundle = new Bundle();
bundle.putString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"api/Page/page_show?id=23");
RoomAuctionWebViewDialog dialog = new RoomAuctionWebViewDialog(getActivity(), bundle);
dialog.show();
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=23").withString("title", "真爱拍规则").navigation();
}else { }else {
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=22").withString("title", "亲密拍规则").navigation();
Bundle bundle = new Bundle();
bundle.putString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"api/Page/page_show?id=22");
RoomAuctionWebViewDialog dialog = new RoomAuctionWebViewDialog(getActivity(), bundle);
dialog.show();
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=22").withString("title", "亲密拍规则").navigation();
} }
} }
} }

View File

@@ -2,6 +2,7 @@ package com.example.modulevocal.activity;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.view.View;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
@@ -179,7 +180,7 @@ public class PersonalityActivity extends BaseMvpActivity<PersonalityPresenter, A
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager); mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
mBinding.slidingTabLayout.setCurrentTab(0); mBinding.slidingTabLayout.setCurrentTab(0);
mBinding.viewPager.setOffscreenPageLimit(0); mBinding.viewPager.setOffscreenPageLimit(0);
refreshCurrentGiftFragment(personaltyBean.get(0).getId()); refreshCurrentGiftFragment(personaltyBean.get(0).getId(),0);
mBinding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { mBinding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override @Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
@@ -189,7 +190,7 @@ public class PersonalityActivity extends BaseMvpActivity<PersonalityPresenter, A
@Override @Override
public void onPageSelected(int position) { public void onPageSelected(int position) {
// 当页面切换时,控制 tv_bb_qs 按钮的显示 // 当页面切换时,控制 tv_bb_qs 按钮的显示
refreshCurrentGiftFragment(personaltyBean.get(position).getId()); refreshCurrentGiftFragment(personaltyBean.get(position).getId(),position);
} }
@Override @Override
@@ -198,9 +199,14 @@ public class PersonalityActivity extends BaseMvpActivity<PersonalityPresenter, A
} }
}); });
} }
private void refreshCurrentGiftFragment(String id) { private void refreshCurrentGiftFragment(String id,int position) {
if (getCurrentGiftFragment()!=null){ if (getCurrentGiftFragment()!=null){
getCurrentGiftFragment().loadDataIfNeeded(Integer.parseInt(id)); getCurrentGiftFragment().loadDataIfNeeded(Integer.parseInt(id), position);
if (position==0){
mBinding.ivUser.setVisibility(View.VISIBLE);
}else {
mBinding.ivUser.setVisibility(View.GONE);
}
} }
} }
private ZhuangBanShangChengFragment getCurrentGiftFragment() { private ZhuangBanShangChengFragment getCurrentGiftFragment() {

View File

@@ -18,6 +18,8 @@ import com.example.modulevocal.presenter.SettingPresenter;
import com.xscm.moduleutil.activity.BaseMvpActivity; import com.xscm.moduleutil.activity.BaseMvpActivity;
import com.xscm.moduleutil.activity.WebViewActivity; import com.xscm.moduleutil.activity.WebViewActivity;
import com.xscm.moduleutil.base.CommonAppContext; import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
import com.xscm.moduleutil.dialog.FirstChargeDialog;
import com.xscm.moduleutil.dialog.RealNameDialog; import com.xscm.moduleutil.dialog.RealNameDialog;
import com.xscm.moduleutil.utils.ARouteConstants; import com.xscm.moduleutil.utils.ARouteConstants;
import com.xscm.moduleutil.utils.SpUtil; import com.xscm.moduleutil.utils.SpUtil;
@@ -78,11 +80,22 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
} else { } else {
RealNameDialog realNameDialog = new RealNameDialog(this); RealNameDialog realNameDialog = new RealNameDialog(this);
realNameDialog.show(); realNameDialog.show();
realNameDialog.setOnDismissListener(dialog -> { realNameDialog.setOnFirstChargeListener(new RealNameDialog.OnFirstChargeListener() {
dialog.dismiss(); @Override
public void onFirstChargeConfirmed(String giftBean, int type) {
realNameDialog.dismiss();
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation(); ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
// startActivity(new Intent(SettingActivity.this, RealName1Activity.class)); }
@Override
public void onFirstChargeCancelled() {
realNameDialog.dismiss();
}
}); });
// realNameDialog.setOnDismissListener(dialog -> {
// dialog.dismiss();
// ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
// });
} }
} else if (view.getId() == R.id.ll_qhch) { } else if (view.getId() == R.id.ll_qhch) {
new AlertDialog.Builder(this).setMessage("确认清理缓存?").setPositiveButton("确定", new DialogInterface.OnClickListener() { new AlertDialog.Builder(this).setMessage("确认清理缓存?").setPositiveButton("确定", new DialogInterface.OnClickListener() {

View File

@@ -64,7 +64,7 @@ public class MyAlbumFragment extends BaseMvpFragment<MyAlbumPresenter, FragmentM
@Override @Override
protected void initData() { protected void initData() {
MvpPre.getAlbumList("1", "10",userId); MvpPre.getAlbumList("1", "10", userId);
} }
@Override @Override
@@ -79,28 +79,28 @@ public class MyAlbumFragment extends BaseMvpFragment<MyAlbumPresenter, FragmentM
AlbumBean item = mAdapter.getItem(position); AlbumBean item = mAdapter.getItem(position);
if ("0".equals(item.getId())) { if ("0".equals(item.getId())) {
startActivity(new Intent(getActivity(), CreateAlbumActivity.class)); startActivity(new Intent(getActivity(), CreateAlbumActivity.class));
} } else {
else {
if (!TextUtils.isEmpty(item.getPwd())) { if (!TextUtils.isEmpty(item.getPwd())) {
if (userId.equals(SpUtil.getUserId() + "")){ if (userId.equals(SpUtil.getUserId() + "")) {
onPasswordCorrect(item); onPasswordCorrect(item);
}else { } else {
showPasswordInputDialog(item); showPasswordInputDialog(item);
} }
} else { } else {
ARouter.getInstance().build(ARouteConstants.USER_ALBUM_DETAIL).withString("albumId", item.getId()).withString("pwd", item.getPwd()).withString("target_fragment",ARouteConstants.FRAGMENT_ALBUM).navigation(); ARouter.getInstance().build(ARouteConstants.USER_ALBUM_DETAIL).withString("albumId", item.getId()).withString("pwd", item.getPwd()).withString("target_fragment", ARouteConstants.FRAGMENT_ALBUM).navigation();
} }
} }
} }
}); });
List<AlbumBean> list = new ArrayList<>(); List<AlbumBean> list = new ArrayList<>();
if (userId.equals(SpUtil.getUserId()+"")){ if (userId.equals(SpUtil.getUserId() + "")) {
AlbumBean albumBean = new AlbumBean(); AlbumBean albumBean = new AlbumBean();
albumBean.setId("0"); albumBean.setId("0");
list.add(albumBean); list.add(albumBean);
mAdapter.setNewData(list); mAdapter.setNewData(list);
} }
} }
@SuppressLint({"MissingInflatedId", "LocalSuppress"}) @SuppressLint({"MissingInflatedId", "LocalSuppress"})
private void showPasswordInputDialog(AlbumBean item) { private void showPasswordInputDialog(AlbumBean item) {
// 创建弹出框视图 // 创建弹出框视图
@@ -160,10 +160,13 @@ public class MyAlbumFragment extends BaseMvpFragment<MyAlbumPresenter, FragmentM
@Override @Override
public void getAlbumList(List<AlbumBean> data) { public void getAlbumList(List<AlbumBean> data) {
if (userId.equals(SpUtil.getUserId()+"")){ if (data == null) {
data = new ArrayList<>();
}
if (userId.equals(SpUtil.getUserId() + "")) {
AlbumBean albumBean = new AlbumBean(); AlbumBean albumBean = new AlbumBean();
albumBean.setId("0"); albumBean.setId("0");
data.add(0,albumBean); data.add(0, albumBean);
} }
mAdapter.setNewData(data); mAdapter.setNewData(data);
} }

View File

@@ -11,7 +11,7 @@ import java.util.List;
public class ZhuangBanShangChengConactos { public class ZhuangBanShangChengConactos {
public interface View extends IView<Activity> { public interface View extends IView<Activity> {
void getDecorateList(List<ZhuangBanShangChengBean> zhuangBanShangChengBeans); void getDecorateList(List<ZhuangBanShangChengBean> zhuangBanShangChengBeans,int tabIndex);
void setUserDecorate(); void setUserDecorate();
@@ -19,7 +19,7 @@ public class ZhuangBanShangChengConactos {
} }
public interface ICreatedRoomPre extends IPresenter { public interface ICreatedRoomPre extends IPresenter {
void getDecorateList(String type); void getDecorateList(String type,int tabIndex);
void setUserDecorate(String udid); void setUserDecorate(String udid);

View File

@@ -1,9 +1,11 @@
package com.example.modulevocal.fragment.zhuangb; package com.example.modulevocal.fragment.zhuangb;
import static android.view.View.GONE;
import static com.xscm.moduleutil.utils.ImageLoader.loadImage; import static com.xscm.moduleutil.utils.ImageLoader.loadImage;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast; import android.widget.Toast;
import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
@@ -21,7 +23,9 @@ import com.xscm.moduleutil.utils.ImageUtils;
import com.xscm.moduleutil.utils.SpUtil; import com.xscm.moduleutil.utils.SpUtil;
import com.xscm.moduleutil.widget.AvatarFrameView; import com.xscm.moduleutil.widget.AvatarFrameView;
import com.tencent.qgame.animplayer.AnimView; import com.tencent.qgame.animplayer.AnimView;
import com.xscm.moduleutil.widget.GiftAnimView;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangChengPresenter, ZhuangbanRecyclerviewNorefBinding> implements ZhuangBanShangChengConactos.View { public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangChengPresenter, ZhuangbanRecyclerviewNorefBinding> implements ZhuangBanShangChengConactos.View {
@@ -33,8 +37,11 @@ public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangC
private String did; private String did;
ZhuangBanShangChengAdapter adapter; ZhuangBanShangChengAdapter adapter;
AvatarFrameView imageBg; AvatarFrameView imageBg;
GiftAnimView imageBg2;
AnimView item_animview; AnimView item_animview;
RoundedImageView image_user; RoundedImageView image_user;
private int tabIndex;
@Override @Override
protected ZhuangBanShangChengPresenter bindPresenter() { protected ZhuangBanShangChengPresenter bindPresenter() {
return new ZhuangBanShangChengPresenter(this, getActivity()); return new ZhuangBanShangChengPresenter(this, getActivity());
@@ -47,22 +54,26 @@ public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangC
fragment.setArguments(args); fragment.setArguments(args);
return fragment; return fragment;
} }
@Override @Override
public void initArgs(Bundle arguments) { public void initArgs(Bundle arguments) {
super.initArgs(arguments); super.initArgs(arguments);
type = arguments.getInt("type", MyRoomListFragment.TYPE_CREATE); type = arguments.getInt("type", MyRoomListFragment.TYPE_CREATE);
} }
public void loadDataIfNeeded(int type){ public void loadDataIfNeeded(int type,int tabIndex) {
if (MvpPre==null){ if (MvpPre == null) {
MvpPre=bindPresenter(); MvpPre = bindPresenter();
} }
MvpPre.getDecorateList(type+""); this.type = type;
this.tabIndex = tabIndex;
MvpPre.getDecorateList(type + "", tabIndex);
} }
@Override @Override
protected void initData() { protected void initData() {
MvpPre.getDecorateList(type+""); MvpPre.getDecorateList(type + "", tabIndex);
// //这里根据传递的type进行数据查询 // //这里根据传递的type进行数据查询
@@ -77,14 +88,38 @@ public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangC
// zhuangBanShangChengBean.setBase_image(""); // zhuangBanShangChengBean.setBase_image("");
// zhuangBanShangChengBeanList.add(zhuangBanShangChengBean); // zhuangBanShangChengBeanList.add(zhuangBanShangChengBean);
// } // }
image_user=(RoundedImageView) getActivity().findViewById(R.id.iv_user); image_user = (RoundedImageView) getActivity().findViewById(R.id.iv_user);
imageBg = (AvatarFrameView) getActivity().findViewById(R.id.image_headPortrait); imageBg = (AvatarFrameView) getActivity().findViewById(R.id.image_headPortrait);
// imageBg2 = (GiftAnimView) getActivity().findViewById(R.id.image_headPortrait2);
imageBg2 = new GiftAnimView(getActivity());
imageBg2.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
));
imageBg2.setVisibility(GONE);
ViewGroup parentLayout = (ViewGroup) getActivity().findViewById(R.id.ccl).getParent(); // 或者其他合适的父布局
parentLayout.addView(imageBg2);
item_animview = (AnimView) getActivity().findViewById(R.id.item_animview); item_animview = (AnimView) getActivity().findViewById(R.id.item_animview);
if (SpUtil.getUserInfo()!=null){ if (SpUtil.getUserInfo() != null) {
if (SpUtil.getUserInfo().getAvatar() != null){ if (SpUtil.getUserInfo().getAvatar() != null) {
ImageUtils.loadHeadCC(SpUtil.getUserInfo().getAvatar(),image_user); ImageUtils.loadHeadCC(SpUtil.getUserInfo().getAvatar(), image_user);
} }
} }
// if (type == 1) {
//// image_user.setVisibility(View.VISIBLE);
// imageBg.setVisibility(View.VISIBLE);
// imageBg2.setVisibility(View.GONE);
// } else if (type == 2){
//// image_user.setVisibility(View.GONE);
// imageBg.setVisibility(View.GONE);
// imageBg2.setVisibility(View.VISIBLE);
// }else {
//// image_user.setVisibility(View.GONE);
// imageBg.setVisibility(View.GONE);
// imageBg2.setVisibility(View.GONE);
// }
adapter = new ZhuangBanShangChengAdapter(); adapter = new ZhuangBanShangChengAdapter();
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3); GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3);
@@ -93,6 +128,29 @@ public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangC
adapter.setOnItemChildClickListener((adapter1, view, position) -> { adapter.setOnItemChildClickListener((adapter1, view, position) -> {
List<ZhuangBanShangChengBean> list = (List<ZhuangBanShangChengBean>) adapter1.getData(); List<ZhuangBanShangChengBean> list = (List<ZhuangBanShangChengBean>) adapter1.getData();
// 清除之前的选择状态
clearPreviousSelection(list);
// // 设置当前选择
// ZhuangBanShangChengBean selectedBean = list.get(position);
// selectedBean.setIs_select(true);
// pSelect = position;
// did = selectedBean.getUdid();
//
// // 更新UI显示
// if (position == 0) { // "无"选项
// mBinding.ll.setVisibility(View.GONE);
// clearDecorations();
// } else {
// mBinding.ll.setVisibility(View.VISIBLE);
//
// if ("svga".equalsIgnoreCase(getFileExtension(selectedBean.getPlay_image()))) {
// imageBg.stopAll();
// imageBg.setSource(selectedBean.getPlay_image(), 2);
// } else if ("mp4".equalsIgnoreCase(getFileExtension(selectedBean.getPlay_image()))) {
// imageBg.stopAll();
// imageBg.setSource(selectedBean.getPlay_image(), 2);
// }
// }
if (pSelect != -1 && pSelect != position) { if (pSelect != -1 && pSelect != position) {
list.get(pSelect).setIs_select(false); list.get(pSelect).setIs_select(false);
@@ -100,38 +158,60 @@ public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangC
pSelect = position; pSelect = position;
did = list.get(position).getUdid(); did = list.get(position).getUdid();
mBinding.ll.setVisibility(View.VISIBLE); mBinding.ll.setVisibility(View.VISIBLE);
if (list.get( position)!=null && list.get(position).getType()!=null && list.get(position).getPlay_image()!=null) {
if ("svga".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) { // if ("svga".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) {
// imageBg.playSVGA(list.get(position).getPlay_image()); if (list.get(position).getType().equals("1")) {
imageBg2.setVisibility(View.GONE);
imageBg.stopAll(); imageBg.stopAll();
imageBg.setSource(list.get(position).getPlay_image(),1); imageBg.setSource(list.get(position).getPlay_image(), 2);
} else if ("mp4".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) { } else if (list.get(position).getType().equals("2")) {
// imageBg.playMP4(Uri.parse(list.get(position).getPlay_image())); // imageBg2.setSource(list.get(position).getPlay_image(), 2);
imageBg.stopAll(); imageBg2.setVisibility(View.VISIBLE);
imageBg.setSource(list.get(position).getPlay_image(),1); imageBg2.previewEffectWith(list.get(position).getPlay_image());
} }
}
// } else if ("mp4".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) {
//// imageBg.playMP4(Uri.parse(list.get(position).getPlay_image()));
// imageBg.stopAll();
// imageBg.setSource(list.get(position).getPlay_image(),2);
// }
} else if (pSelect != -1 && pSelect == position) { } else if (pSelect != -1 && pSelect == position) {
list.get(position).setIs_select(false); list.get(position).setIs_select(false);
pSelect = -1; pSelect = -1;
mBinding.ll.setVisibility(View.GONE); mBinding.ll.setVisibility(GONE);
} else { } else {
list.get(position).setIs_select(true); list.get(position).setIs_select(true);
did = list.get(position).getUdid(); did = list.get(position).getUdid();
pSelect = position; pSelect = position;
mBinding.ll.setVisibility(View.VISIBLE); mBinding.ll.setVisibility(View.VISIBLE);
if (list.get( position)!=null && list.get(position).getType()!=null && list.get(position).getPlay_image()!=null) {
if (list.get(position).getType().equals("1")) {
imageBg2.setVisibility(View.GONE);
imageBg.stopAll();
imageBg.setSource(list.get(position).getPlay_image(), 2);
} else if (list.get(position).getType().equals("2")) {
imageBg2.setVisibility(View.VISIBLE);
// imageBg2.stopAll();
// imageBg2.setSource(list.get(position).getPlay_image(), 2);
imageBg2.previewEffectWith(list.get(position).getPlay_image());
}
}
// loadImage(getContext(),imageBg, list.get(position).getPlay_image()); // loadImage(getContext(),imageBg, list.get(position).getPlay_image());
// ImageUtils.loadDecorationAvatar(list.get(position).getPlay_image(), imageBg); // ImageUtils.loadDecorationAvatar(list.get(position).getPlay_image(), imageBg);
// imageBg.load(list.get(position).getPlay_image()); // imageBg.load(list.get(position).getPlay_image());
if ("svga".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) { // if ("svga".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) {
imageBg.stopAll(); // imageBg.stopAll();
imageBg.setSource(list.get(position).getPlay_image(),1); // imageBg.setSource(list.get(position).getPlay_image(), 2);
// imageBg.playSVGA(list.get(position).getPlay_image()); //// imageBg.playSVGA(list.get(position).getPlay_image());
} else if ("mp4".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) { // } else if ("mp4".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) {
imageBg.stopAll(); // imageBg.stopAll();
imageBg.setSource(list.get(position).getPlay_image(), 1); // imageBg.setSource(list.get(position).getPlay_image(), 2);
// imageBg.playMP4(Uri.parse(list.get(position).getPlay_image())); //// imageBg.playMP4(Uri.parse(list.get(position).getPlay_image()));
} // }
} }
@@ -141,6 +221,29 @@ public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangC
adapter.setNewData(zhuangBanShangChengBeanList); adapter.setNewData(zhuangBanShangChengBeanList);
} }
/**
* 清除之前的选择状态
*/
private void clearPreviousSelection(List<ZhuangBanShangChengBean> list) {
if (pSelect != -1 && pSelect < list.size()) {
list.get(pSelect).setIs_select(false);
}
pSelect = -1;
}
/**
* 清除装饰效果
*/
private void clearDecorations() {
if (imageBg != null) {
imageBg.stopAll();
}
if (item_animview != null) {
item_animview.stopPlay();
}
}
private String getFileExtension(String url) { private String getFileExtension(String url) {
if (url == null || url.isEmpty()) return ""; if (url == null || url.isEmpty()) return "";
int dotIndex = url.lastIndexOf("."); int dotIndex = url.lastIndexOf(".");
@@ -154,9 +257,9 @@ public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangC
protected void initView() { protected void initView() {
mBinding.zhuangbanBuy.setOnClickListener(v -> { mBinding.zhuangbanBuy.setOnClickListener(v -> {
if (did == null || did.isEmpty()){ if (did == null || did.isEmpty()) {
MvpPre.cancelUserDecorate(type+""); MvpPre.cancelUserDecorate(type + "");
}else { } else {
MvpPre.setUserDecorate(did); MvpPre.setUserDecorate(did);
} }
}); });
@@ -170,15 +273,20 @@ public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangC
} }
@Override @Override
public void getDecorateList(List<ZhuangBanShangChengBean> zhuangBanShangChengBeans) { public void getDecorateList(List<ZhuangBanShangChengBean> zhuangBanShangChengBeans, int tabIndex) {
if (adapter==null){ if (adapter == null) {
adapter = new ZhuangBanShangChengAdapter(); adapter = new ZhuangBanShangChengAdapter();
} }
if (zhuangBanShangChengBeans==null){
zhuangBanShangChengBeans=new ArrayList<>();
}
ZhuangBanShangChengBean zhuangBanShangChengBean = new ZhuangBanShangChengBean(); ZhuangBanShangChengBean zhuangBanShangChengBean = new ZhuangBanShangChengBean();
zhuangBanShangChengBean.setTitle(""); zhuangBanShangChengBean.setTitle("");
zhuangBanShangChengBean.setBase_image(""); zhuangBanShangChengBean.setBase_image("");
zhuangBanShangChengBeans.add(0,zhuangBanShangChengBean); zhuangBanShangChengBeans.add(0, zhuangBanShangChengBean);
adapter.setNewData(zhuangBanShangChengBeans); adapter.setNewData(zhuangBanShangChengBeans);
this.tabIndex = tabIndex;
} }
@Override @Override

View File

@@ -20,7 +20,7 @@ public class ZhuangBanShangChengPresenter extends BasePresenter<ZhuangBanShangCh
} }
@Override @Override
public void getDecorateList(String type) { public void getDecorateList(String type,int tabIndex) {
api.getDecorateList(type, new BaseObserver<List<ZhuangBanShangChengBean>>() { api.getDecorateList(type, new BaseObserver<List<ZhuangBanShangChengBean>>() {
@Override @Override
public void onSubscribe(Disposable d) { public void onSubscribe(Disposable d) {
@@ -32,7 +32,7 @@ public class ZhuangBanShangChengPresenter extends BasePresenter<ZhuangBanShangCh
if (MvpRef == null) { if (MvpRef == null) {
MvpRef = new WeakReference<>(mView); MvpRef = new WeakReference<>(mView);
} }
MvpRef.get().getDecorateList(zhuangBanShangChengBeans); MvpRef.get().getDecorateList(zhuangBanShangChengBeans, tabIndex);
} }
}); });
} }

View File

@@ -93,7 +93,7 @@
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/bg_r100_hui" android:background="@drawable/bg_r100_hui"
android:gravity="center|left" android:gravity="center|left"
android:hint="请输入称" android:hint="请输入房间名称"
android:maxLength="10" android:maxLength="10"
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingEnd="@dimen/dp_10" android:paddingEnd="@dimen/dp_10"

View File

@@ -9,6 +9,7 @@
</data> </data>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ccl"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@@ -85,7 +86,8 @@
<com.tencent.qgame.animplayer.AnimView <com.tencent.qgame.animplayer.AnimView
android:id="@+id/item_animview" android:id="@+id/item_animview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
android:visibility="gone"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@@ -118,6 +120,11 @@
android:layout_marginTop="@dimen/dp_30" android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toBottomOf="@+id/cl_2" /> app:layout_constraintTop_toBottomOf="@+id/cl_2" />
<com.xscm.moduleutil.widget.GiftAnimView
android:id="@+id/image_headPortrait2"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_60" android:layout_height="@dimen/dp_60"

View File

@@ -18,12 +18,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_20"> android:paddingBottom="@dimen/dp_20">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10"
android:nestedScrollingEnabled="false" android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/tv_title" app:layout_constraintTop_toBottomOf="@+id/tv_title"

View File

@@ -2,9 +2,10 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_78" android:layout_width="match_parent"
android:layout_height="@dimen/dp_110" android:layout_height="@dimen/dp_110"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10"
android:background="#E9E9E9" android:background="#E9E9E9"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"

View File

@@ -96,11 +96,11 @@ public class TUIC2CChatFragment extends TUIBaseChatFragment {
} }
private void openFriendProfile(String userId) { private void openFriendProfile(String userId) {
Intent intent = new Intent(getContext(), FriendProfileActivity.class); // Intent intent = new Intent(getContext(), FriendProfileActivity.class);
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, userId); // intent.putExtra(TUIConstants.TUIChat.CHAT_ID, userId);
intent.putExtra(TUIChatConstants.CHAT_BACKGROUND_URI, mChatBackgroundThumbnailUrl); // intent.putExtra(TUIChatConstants.CHAT_BACKGROUND_URI, mChatBackgroundThumbnailUrl);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent); // startActivity(intent);
} }
@Override @Override

View File

@@ -152,9 +152,9 @@ public class TipsMessageHolder extends MessageBaseHolder {
} }
private void onUserClick(String userID) { private void onUserClick(String userID) {
Intent intent = new Intent(itemView.getContext(), FriendProfileActivity.class); // Intent intent = new Intent(itemView.getContext(), FriendProfileActivity.class);
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, userID); // intent.putExtra(TUIConstants.TUIChat.CHAT_ID, userID);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
itemView.getContext().startActivity(intent); // itemView.getContext().startActivity(intent);
} }
} }