修改交友布局
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.xscm.moduleutil;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomAutionTimeBean {
|
||||
private int days; // 天数,例如 1, 3, 5, 10, 15, 20
|
||||
private boolean isSelected;
|
||||
|
||||
public RoomAutionTimeBean(int days) {
|
||||
this.days = days;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应小时数(1天 = 24小时)
|
||||
*/
|
||||
public int getHours() {
|
||||
return days * 24;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
package com.xscm.moduleutil.activity;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.BarUtils;
|
||||
import com.tencent.qcloud.tuikit.tuichat.bean.ChatInfo;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.BackgroundManager;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.DisplayUtil;
|
||||
import com.xscm.moduleutil.utils.LanguageUtil;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends AppCompatActivity
|
||||
implements BackgroundManager.BackgroundUpdateListener, ColorManager.ColorChangeListener {
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(LanguageUtil.attachBaseContext(newBase));
|
||||
}
|
||||
|
||||
protected VDB mBinding;
|
||||
private static final List<BaseMvpActivity> activityList = new ArrayList<>();
|
||||
|
||||
|
||||
// private LoadingDialog mLoadingDialog;
|
||||
// 添加广播接收器成员变量
|
||||
private BroadcastReceiver mLogoutReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if ("com.xscm.moduleutil.ACTION_USER_LOGOUT".equals(intent.getAction())) {
|
||||
// 在这里处理用户登出后的UI更新
|
||||
// 例如:隐藏需要登录才能显示的控件
|
||||
// 或者跳转到登录状态的页面
|
||||
handleUserLogout();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 处理用户登出的方法
|
||||
protected void handleUserLogout() {
|
||||
// 子类可以重写此方法处理具体的登出逻辑
|
||||
// 例如:更新UI状态、清除本地数据等
|
||||
|
||||
ActivityUtils.finishAllActivities();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().getDecorView().setBackgroundResource(R.mipmap.log_bj);
|
||||
setContentView(getLayoutId());
|
||||
// 隐藏标题栏
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().hide();
|
||||
}
|
||||
mBinding = DataBindingUtil.setContentView(this, getLayoutId());
|
||||
mBinding.setLifecycleOwner(this);
|
||||
ARouter.getInstance().inject(this);
|
||||
BarUtils.setStatusBarLightMode(this, isLightMode());
|
||||
BarUtils.transparentStatusBar(this);
|
||||
initView();
|
||||
initData();
|
||||
initCompleted();
|
||||
|
||||
// 注册背景更新监听器
|
||||
BackgroundManager.getInstance().addListener(this);
|
||||
// 尝试加载网络背景
|
||||
loadNetworkBackground();
|
||||
// 注册颜色变化监听器
|
||||
ColorManager.getInstance().addColorChangeListener(this);
|
||||
|
||||
// 注册登出广播接收器
|
||||
IntentFilter filter = new IntentFilter("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
registerReceiver(mLogoutReceiver, filter);
|
||||
|
||||
// 动态判断是否包含 @Subscribe 注解的方法
|
||||
boolean hasSubscribeMethods = false;
|
||||
for (Method method : getClass().getDeclaredMethods()) {
|
||||
if (method.isAnnotationPresent(Subscribe.class)) {
|
||||
hasSubscribeMethods = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasSubscribeMethods) {
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
|
||||
// // 设置全屏模式,隐藏状态栏和导航栏
|
||||
// View decorView = getWindow().getDecorView();
|
||||
// decorView.setSystemUiVisibility(
|
||||
// View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
// | View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||
|
||||
}
|
||||
|
||||
public static void finishAll() {
|
||||
for (BaseMvpActivity activity : activityList) {
|
||||
if (!activity.isFinishing()) {
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColorChanged() {
|
||||
// 在主线程中更新UI
|
||||
runOnUiThread(this::updateUIColors);
|
||||
}
|
||||
|
||||
// 子类可以重写此方法来更新UI颜色
|
||||
protected void updateUIColors() {
|
||||
// 默认实现,子类可以覆盖
|
||||
}
|
||||
|
||||
|
||||
protected void loadNetworkBackground() {
|
||||
// 只有当已经有背景URL时才加载
|
||||
String backgroundUrl = BackgroundManager.getInstance().getBackgroundUrl();
|
||||
if (backgroundUrl != null && !backgroundUrl.isEmpty()) {
|
||||
// 检查是否有已加载的drawable
|
||||
Drawable cachedDrawable = BackgroundManager.getInstance().getBackgroundDrawable();
|
||||
if (cachedDrawable != null) {
|
||||
getWindow().getDecorView().setBackground(cachedDrawable);
|
||||
} else {
|
||||
// 加载网络背景
|
||||
BackgroundManager.getInstance().loadBackgroundDrawable(this, new BackgroundManager.BackgroundLoadCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
getWindow().getDecorView().setBackground(drawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
// 加载失败时使用默认背景
|
||||
getWindow().getDecorView().setBackgroundResource(R.mipmap.activity_bj);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackgroundUpdated(Drawable drawable) {
|
||||
// 当背景更新时,更新当前Activity的背景
|
||||
if (drawable != null) {
|
||||
getWindow().getDecorView().setBackground(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
// 提供一个方法供子类调用,用于设置背景URL
|
||||
protected void setNetworkBackgroundUrl(String url) {
|
||||
BackgroundManager.getInstance().setBackgroundUrl(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resources getResources() {//禁止app字体大小跟随系统字体大小调节
|
||||
Resources resources = super.getResources();
|
||||
if (resources != null && resources.getConfiguration().fontScale != 1.0f) {
|
||||
android.content.res.Configuration configuration = resources.getConfiguration();
|
||||
configuration.fontScale = 1.0f;
|
||||
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||
}
|
||||
return resources;
|
||||
}
|
||||
|
||||
static float fontScale = 1f;
|
||||
|
||||
// @Override
|
||||
// public Resources getResources() {
|
||||
// Resources resources = super.getResources();
|
||||
// return DisplayUtil.getResources(this,resources,fontScale);
|
||||
// }
|
||||
|
||||
public void setFontScale(float fontScale) {
|
||||
this.fontScale = fontScale;
|
||||
DisplayUtil.recreate(this);
|
||||
}
|
||||
|
||||
public boolean isLightMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected abstract void initData();
|
||||
|
||||
protected abstract void initView();
|
||||
|
||||
protected void initCompleted() {
|
||||
}
|
||||
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// 移除背景更新监听器
|
||||
BackgroundManager.getInstance().removeListener(this);
|
||||
// 移除颜色变化监听器
|
||||
ColorManager.getInstance().removeColorChangeListener(this);
|
||||
if (mBinding != null) {
|
||||
mBinding.unbind();
|
||||
}
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
try {
|
||||
unregisterReceiver(mLogoutReceiver);
|
||||
} catch (Exception e) {
|
||||
// 忽略异常
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
public void showLoading(String content) {
|
||||
// if (mLoadingDialog == null) {
|
||||
// mLoadingDialog = new LoadingDialog(this);
|
||||
// }
|
||||
// if (!mLoadingDialog.isShowing()) {
|
||||
// mLoadingDialog.show();
|
||||
// }
|
||||
}
|
||||
|
||||
public void showLoading() {
|
||||
// if (mLoadingDialog == null) {
|
||||
// mLoadingDialog = new LoadingDialog(this);
|
||||
// }
|
||||
// if (!mLoadingDialog.isShowing()) {
|
||||
// mLoadingDialog.show();
|
||||
// }
|
||||
}
|
||||
|
||||
public void disLoading() {
|
||||
// if (mLoadingDialog != null && mLoadingDialog.isShowing()) {
|
||||
// mLoadingDialog.dismiss();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
View view = getCurrentFocus();
|
||||
if (isShouldHideInput(view, ev)) {
|
||||
InputMethodManager Object = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (Object != null) {
|
||||
Object.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
return super.dispatchTouchEvent(ev);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否隐藏键盘
|
||||
public boolean isShouldHideInput(View v, MotionEvent event) {
|
||||
if (v != null && (v instanceof EditText)) {
|
||||
int[] leftTop = {0, 0};
|
||||
//获取输入框当前的location位置
|
||||
v.getLocationInWindow(leftTop);
|
||||
int left = leftTop[0];
|
||||
int top = leftTop[1];
|
||||
int bottom = top + v.getHeight();
|
||||
int right = left + v.getWidth();
|
||||
if (event.getX() > left && event.getX() < right
|
||||
&& event.getY() > top && event.getY() < bottom) {
|
||||
// 点击的是输入框区域,保留点击EditText的事件
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onMessageReceived(MqttBean mqttBean) {
|
||||
//// PiaoPingManager.getInstance(this).showPiaoPingMessage(mqttBean);
|
||||
// FxAppHelper fxAppHelper = FxAppHelper.builder().setContext(this).setLayout(R.layout.item_piaoping).build();
|
||||
// FloatingX.install(fxAppHelper).show();
|
||||
// }
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(ChatInfo event) {
|
||||
String id = event.getId().replace("g", "");
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getH5Url() + "/web/index.html#/pages/union/setGroup?id=" + SpUtil.getToken() + "&guildId=" + id).navigation();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package com.xscm.moduleutil.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.utils.LanguageUtil;
|
||||
import com.xscm.moduleutil.utils.location.LocationProvider;
|
||||
import com.xscm.moduleutil.utils.location.SystemLocationProvider;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||
import com.tencent.qcloud.tuicore.TUILogin;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewDataBinding> extends BaseAppCompatActivity<VDB> implements
|
||||
IView<Activity> , LocationProvider.LocationCallback
|
||||
{
|
||||
|
||||
protected P MvpPre;
|
||||
|
||||
protected abstract P bindPresenter();
|
||||
private String city1;
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
MvpPre = bindPresenter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoadings() {
|
||||
// showLoading("加载中");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoadings(String content) {
|
||||
// showLoading(content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disLoadings() {
|
||||
// disLoading();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (MvpPre != null) {
|
||||
MvpPre.detachView();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Activity getSelfActivity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(LanguageUtil.attachBaseContext(newBase));
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void logOutEvent(UserBean userBean) {
|
||||
// 在用户 UI 点击登录的时候调用
|
||||
TUILogin.login(getBaseContext(), CommonAppContext.getInstance().getCurrentEnvironment().getSdkAppId(), "u"+userBean.getUser_id(), userBean.getTencent_im(), new TUICallback() {
|
||||
@Override
|
||||
public void onError(final int code, final String desc) {
|
||||
LogUtils.e("@@@1",code,"描述:",desc);
|
||||
}
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtils.e("@@@","成功");
|
||||
// V2TIMUserFullInfo userFullInfo = new V2TIMUserFullInfo();
|
||||
// userFullInfo.setNickname(userBean.getNickname());
|
||||
// userFullInfo.setFaceUrl(userBean.getAvatar());
|
||||
// userFullInfo.setAllowType(userBean.getSex());
|
||||
// V2TIMManager.getInstance().setSelfInfo(userFullInfo, new V2TIMCallback() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// LogUtils.e("@@@", "成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int code, String desc) {
|
||||
// LogUtils.e("@@@", "描述"+desc);
|
||||
// }
|
||||
// });
|
||||
initLocation();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
private SystemLocationProvider locationProvider;
|
||||
private void initLocation() {
|
||||
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
// 请求定位权限
|
||||
ActivityCompat.requestPermissions(
|
||||
(Activity) this,
|
||||
new String[]{
|
||||
android.Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
},
|
||||
1001 // 自定义常量,比如 1001
|
||||
);
|
||||
}
|
||||
locationProvider = new SystemLocationProvider();
|
||||
|
||||
// 请求一次性的位置信息
|
||||
locationProvider.getLastKnownLocation(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationReceived(double latitude, double longitude, String city) {
|
||||
LogUtils.e("当前位置:" + city);
|
||||
city1=city;
|
||||
EventBus.getDefault().post(city1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorMessage) {
|
||||
LogUtils.e("定位失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
if (requestCode == 1001) {
|
||||
if (locationProvider==null) {
|
||||
locationProvider = new SystemLocationProvider();
|
||||
}
|
||||
locationProvider.getLastKnownLocation(this, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void userInfoEvent(UserInfo event) {
|
||||
// V2TIMUserFullInfo userFullInfo = new V2TIMUserFullInfo();
|
||||
// userFullInfo.setNickname(event.getNickname());
|
||||
// userFullInfo.setFaceUrl(event.getAvatar());
|
||||
// userFullInfo.setAllowType(event.getSex());
|
||||
// V2TIMManager.getInstance().setSelfInfo(userFullInfo, new V2TIMCallback() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// LogUtils.e("@@@", "成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int code, String desc) {
|
||||
// LogUtils.e("@@@", "描述"+desc);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
/**
|
||||
* 显示全局飘屏消息(支持任意位置飘过)
|
||||
*
|
||||
*/
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void showPiaoPingMessage(MqttBean mqttBean) {
|
||||
// WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
|
||||
// if (windowManager == null) return;
|
||||
//
|
||||
// int screenWidth = getResources().getDisplayMetrics().widthPixels;
|
||||
// int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||
//
|
||||
// WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(
|
||||
// WindowManager.LayoutParams.MATCH_PARENT,
|
||||
// WindowManager.LayoutParams.WRAP_CONTENT,
|
||||
// Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ?
|
||||
// WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY :
|
||||
// WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
|
||||
// WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
|
||||
// WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
|
||||
// WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
|
||||
// PixelFormat.TRANSLUCENT);
|
||||
//
|
||||
// // 设置 Gravity 为左上角
|
||||
// layoutParams.gravity = Gravity.TOP | Gravity.START;
|
||||
//
|
||||
// // Y 轴随机位置
|
||||
//// layoutParams.y = (int) ((Math.random() * (screenHeight - 200)));
|
||||
//
|
||||
// // 初始 X 设为负值,确保 View 在屏幕左侧外
|
||||
// layoutParams.x = -screenWidth;
|
||||
//
|
||||
// View piaoPingView = LayoutInflater.from(this).inflate(R.layout.item_piaoping, null);
|
||||
// TextView textView = piaoPingView.findViewById(R.id.tv_name);
|
||||
// TextView textView2 = piaoPingView.findViewById(R.id.tv_to_name);
|
||||
// textView2.setText("送给"+mqttBean.getList().getToUserName());
|
||||
// textView.setText(mqttBean.getList().getFromUserName());
|
||||
// ImageUtils.loadHeadCC(mqttBean.getList().getGift_picture(), piaoPingView.findViewById(R.id.iv_piaoping));
|
||||
// TextView tv_time = piaoPingView.findViewById(R.id.tv_num);
|
||||
// tv_time.setText(mqttBean.getList().getNumber());
|
||||
// windowManager.addView(piaoPingView, layoutParams);
|
||||
//
|
||||
// piaoPingView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
// @Override
|
||||
// public void onGlobalLayout() {
|
||||
// piaoPingView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
//
|
||||
// // 设置锚点为左上角,避免偏移干扰
|
||||
// piaoPingView.setPivotX(0);
|
||||
// piaoPingView.setPivotY(0);
|
||||
//
|
||||
// // 启动动画:从左外滑入 -> 右外滑出
|
||||
// ObjectAnimator animator = ObjectAnimator.ofFloat(
|
||||
// piaoPingView,
|
||||
// "translationX",
|
||||
// 0f, // 初始偏移为 0(此时 View 在左侧外)
|
||||
// screenWidth // 向右移动整个屏幕宽度
|
||||
// );
|
||||
// animator.setDuration(2000); // 整个动画的时长为2秒
|
||||
//
|
||||
// // 强制 GPU 渲染
|
||||
// piaoPingView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
||||
//
|
||||
// // 延迟显示2秒后开始滑出屏幕的动画
|
||||
// piaoPingView.postDelayed(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// animator.start();
|
||||
// }
|
||||
// }, 3000);
|
||||
//
|
||||
// animator.addListener(new AnimatorListenerAdapter() {
|
||||
// @Override
|
||||
// public void onAnimationEnd(Animator animation) {
|
||||
// windowManager.removeView(piaoPingView);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.xscm.moduleutil.activity;
|
||||
|
||||
public interface IPresenter {
|
||||
void detachView();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xscm.moduleutil.activity;
|
||||
|
||||
public interface IView<T> {
|
||||
T getSelfActivity();
|
||||
|
||||
void showLoadings();
|
||||
|
||||
void showLoadings(String content);
|
||||
|
||||
void disLoadings();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
package com.xscm.moduleutil.activity;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.ClipData;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.webkit.GeolocationPermissions;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.databinding.ActivityWebViewBinding;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/6/3
|
||||
* @description: webview公共方法
|
||||
*/
|
||||
@Route(path = ARouteConstants.H5)
|
||||
public class WebViewActivity extends BaseAppCompatActivity<ActivityWebViewBinding> {
|
||||
|
||||
public String title;
|
||||
public String url;
|
||||
private ValueCallback<Uri> mUploadMessage;
|
||||
private ValueCallback<Uri[]> mUploadCallbackAboveL;
|
||||
private final int REQUEST_FILE_PICKER = 1;
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@Override
|
||||
protected void initData() {
|
||||
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(this), "Android");
|
||||
|
||||
if (title!=null && !title.isEmpty()){
|
||||
if (title.contains("协议")) {
|
||||
webSettings.setDisplayZoomControls(false); // 隐藏默认缩放控件
|
||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL); // 使用正常布局算法
|
||||
webSettings.setBuiltInZoomControls(false);
|
||||
webSettings.setSupportZoom(false);
|
||||
|
||||
// 重要:设置布局算法为适应屏幕
|
||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING);
|
||||
// 设置初始缩放
|
||||
mBinding.webView.setInitialScale(100);
|
||||
mBinding.webView.getSettings().setUseWideViewPort(false);
|
||||
}else {
|
||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
}
|
||||
}else {
|
||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
}
|
||||
|
||||
webSettings.setBuiltInZoomControls(true);
|
||||
webSettings.setSupportZoom(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
webSettings.setBlockNetworkImage(false);//解决图片不显示
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
|
||||
mBinding.webView.setHorizontalScrollBarEnabled(false);//水平不显示
|
||||
mBinding.webView.setVerticalScrollBarEnabled(false); //垂直不显示
|
||||
mBinding.webView.setScrollbarFadingEnabled(false);
|
||||
mBinding.webView.setScrollContainer(true);
|
||||
|
||||
|
||||
|
||||
mBinding.webView.setWebViewClient(new WebViewClient());
|
||||
mBinding.webView.setBackgroundColor(Color.TRANSPARENT);
|
||||
mBinding.webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||
|
||||
mBinding.webView.requestFocus();
|
||||
mBinding.webView.loadUrl(url);
|
||||
|
||||
mBinding.webView.setWebChromeClient(new WebChromeClient() {
|
||||
|
||||
//配置权限(同样在WebChromeClient中实现)
|
||||
@Override
|
||||
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
|
||||
callback.invoke(origin, true, false);
|
||||
super.onGeolocationPermissionsShowPrompt(origin, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
if (title != null && !title.isEmpty()) {
|
||||
if (title.contains("协议")) {
|
||||
|
||||
if (newProgress >= 100) {
|
||||
// 页面加载完成后调整文本换行
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 注入CSS确保文字自动换行
|
||||
mBinding.webView.loadUrl("javascript:(function() {" +
|
||||
"var sheets = document.styleSheets;" +
|
||||
"for (var i = 0; i < sheets.length; i++) {" +
|
||||
" try {" +
|
||||
" sheets[i].addRule('*', 'word-wrap: break-word !important; white-space: normal !important; overflow-x: hidden !important;', 0);" +
|
||||
" } catch(e) {" +
|
||||
" try {" +
|
||||
" sheets[i].insertRule('* { word-wrap: break-word !important; white-space: normal !important; overflow-x: hidden !important; }', 0);" +
|
||||
" } catch(e2) {}" +
|
||||
" }" +
|
||||
"}" +
|
||||
"})()");
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// For Android < 3.0
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
|
||||
mUploadMessage = uploadMsg;
|
||||
// showFileChooser();
|
||||
|
||||
}
|
||||
|
||||
// For Android > 4.1.1
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
|
||||
mUploadMessage = uploadMsg;
|
||||
// showFileChooser();
|
||||
}
|
||||
|
||||
// For Android > 5.0支持多张上传
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> uploadMsg, WebChromeClient.FileChooserParams
|
||||
fileChooserParams) {
|
||||
mUploadCallbackAboveL = uploadMsg;
|
||||
showFileChooser();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedTitle(WebView view, String title) {
|
||||
super.onReceivedTitle(view, title);
|
||||
// tvTitle.setText(title);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void showFileChooser() {
|
||||
// 这里可以扩展为显示对话框让用户选择“拍照”或“从相册选择”
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("image/*");
|
||||
startActivityForResult(Intent.createChooser(intent, "选择图片"), REQUEST_FILE_PICKER);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (requestCode == REQUEST_FILE_PICKER) {
|
||||
if (mUploadMessage != null) {
|
||||
Uri result = data == null || resultCode != RESULT_OK ? null : data.getData();
|
||||
mUploadMessage.onReceiveValue(result);
|
||||
mUploadMessage = null;
|
||||
} else if (mUploadCallbackAboveL != null) {
|
||||
Uri[] results = null;
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
String dataString = data.getDataString();
|
||||
ClipData clipData = data.getClipData();
|
||||
|
||||
if (clipData != null) {
|
||||
results = new Uri[clipData.getItemCount()];
|
||||
for (int i = 0; i < clipData.getItemCount(); i++) {
|
||||
ClipData.Item item = clipData.getItemAt(i);
|
||||
results[i] = item.getUri();
|
||||
}
|
||||
}
|
||||
|
||||
if (dataString != null)
|
||||
results = new Uri[]{Uri.parse(dataString)};
|
||||
}
|
||||
|
||||
mUploadCallbackAboveL.onReceiveValue(results);
|
||||
mUploadCallbackAboveL = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
getWindow().getDecorView().setBackgroundResource(com.xscm.moduleutil.R.color.white);
|
||||
title = getIntent().getStringExtra("title");
|
||||
url = getIntent().getStringExtra("url");
|
||||
if (title!=null) {
|
||||
if (title.equals("举报") || title.equals("等级") || title.equals("公会") || title.equals("邀请") || title.equals("反馈")) {
|
||||
mBinding.topBar.setVisibility(GONE);
|
||||
// mBinding.webView.setPadding(0,20,0,0);
|
||||
} else {
|
||||
mBinding.topBar.setVisibility(VISIBLE);
|
||||
mBinding.topBar.setTitle(title);
|
||||
}
|
||||
}else {
|
||||
if (url.equals(CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=6")){
|
||||
mBinding.topBar.setVisibility(VISIBLE);
|
||||
mBinding.topBar.setTitle("用户协议");
|
||||
}else if (url.equals(CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=4")){
|
||||
mBinding.topBar.setVisibility(VISIBLE);
|
||||
mBinding.topBar.setTitle("隐私协议");
|
||||
}else {
|
||||
mBinding.topBar.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_web_view;
|
||||
}
|
||||
|
||||
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: ");
|
||||
finish();
|
||||
}
|
||||
|
||||
@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) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void closeWeb() {
|
||||
//做原生操作
|
||||
// Intent intent = new Intent(mContext, ListActivity.class);
|
||||
// intent.putExtra("menuName", msg);
|
||||
// startActivity(intent);
|
||||
|
||||
LogUtils.e("closeWeb");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
package com.xscm.moduleutil.activity;
|
||||
|
||||
import android.webkit.JavascriptInterface;
|
||||
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* 项目名称 qipao-android
|
||||
* 包名:com.yutang.xqipao.ui.h5
|
||||
* 创建人 王欧
|
||||
* 创建时间 2020/6/16 1:26 PM
|
||||
* 描述 describe
|
||||
*/
|
||||
public class WebViewBridgeConfig {
|
||||
public static final String NAME = "bridge";
|
||||
public static final String TYPE_QQ_SERVICE = "qqService";
|
||||
public static final String TYPE_FEEDBACK = "feedback";
|
||||
public static final String TYPE_USER_ZONE = "userZone";
|
||||
public static final String TYPE_RECHARGE = "recharge";
|
||||
public static final String TYPE_BACK = "onBackPressed";
|
||||
|
||||
public static final String TYPE_GAME_RANK = "gameRank";//游戏排行榜
|
||||
public static final String TYPE_GAME_SOUND = "gameSound";//游戏声音
|
||||
public static final String TYPE_GAME_END = "gameEnd";//游戏结束
|
||||
public static final String TYPE_GAME_PAUSE = "gamePause";//游戏暂停
|
||||
public static final String TYPE_GAME_BEGIN = "gameBegin";//游戏开始
|
||||
public static final String TYPE_GAME_NEXT = "gameNext";//游戏下一关
|
||||
|
||||
private static int gameCount = 0;//游戏次数
|
||||
private String NextGame = "";//上次游戏名称
|
||||
private String title = "";//标题
|
||||
public static final String GAME_EL = "俄罗斯方块";//俄罗斯方块
|
||||
public static final String GAME_XM = "消灭星星";//消灭星星
|
||||
public static final String GAME_SB = "神步伐";//神步伐
|
||||
public static final String GAME_XT = "线条冲刺";//线条冲刺
|
||||
public static final String GAME_FK = "疯狂赛车";//疯狂赛车
|
||||
|
||||
public WebViewBridgeConfig(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void postMessage(String json) {
|
||||
Logger.e(json);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(json);
|
||||
String type = jsonObject.getString("type");
|
||||
JSONObject object = jsonObject.getJSONObject("data");
|
||||
switch (type) {
|
||||
case TYPE_QQ_SERVICE:
|
||||
serviceUser();
|
||||
break;
|
||||
case TYPE_FEEDBACK:
|
||||
// ActivityUtils.startActivity(FeedBackActivity.class);
|
||||
break;
|
||||
case TYPE_USER_ZONE:
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", object.getString("userId")).navigation();
|
||||
break;
|
||||
case TYPE_RECHARGE:
|
||||
// ARouter.getInstance().build(ARouters.ME_BALANCE).navigation();
|
||||
break;
|
||||
case TYPE_BACK:
|
||||
try {
|
||||
ActivityUtils.getTopActivity().onBackPressed();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//跳转QQ客服
|
||||
private void serviceUser() {
|
||||
// RemoteDataSource.getInstance().serviceUser(new BaseObserver<String>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(String uin) {
|
||||
// try {
|
||||
// String qqUrl = "mqqwpa://im/chat?chat_type=wpa&uin=" + uin + "&version=1";
|
||||
// ActivityUtils.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(qqUrl)));
|
||||
// } catch (Exception e) {
|
||||
// ToastUtils.showShort("请先安装QQ");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* H5小游戏语音互动调用
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void common(String json) {
|
||||
// ThreadUtils.runOnUiThread(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// Logger.e(json);
|
||||
// try {
|
||||
// JSONObject jsonObject = new JSONObject(json);
|
||||
// String type = jsonObject.getString("type");
|
||||
// JSONObject object = jsonObject.getJSONObject("params");
|
||||
// switch (type) {
|
||||
// case JOIN_LIVE_ROOM:
|
||||
// quitLiveRoom();
|
||||
// RtcManager.getInstance().setGame(true);
|
||||
// RtcManager.getInstance().leaveChannel();
|
||||
// //游戏时关闭房间
|
||||
// ActivityUtils.finishActivity(RoomActivity.class);
|
||||
// BaseApplication.getInstance().isPlaying = false;
|
||||
// BaseApplication.getInstance().isShow = false;
|
||||
// UserBean userBean = BaseApplication.getInstance().getUser();
|
||||
// RtcManager.getInstance().loginRoomGame(object.getString("roomId"), userBean.getUser_id(), userBean.getNickname(), "");
|
||||
// break;
|
||||
// case LEAVE_LIVE_ROOM:
|
||||
// RtcManager.getInstance().leaveChannel(object.getString("roomId"));
|
||||
// RtcManager.getInstance().setAudioUrl(null);
|
||||
// break;
|
||||
// case ROOM_START_PUBLISH_STREAM:
|
||||
// RtcManager.getInstance().applyWheat(String.format("%s_%s", object.getString("roomId"), object.getString("userId")));
|
||||
// break;
|
||||
// case ROOM_STOP_PUBLISH_STREAM:
|
||||
// RtcManager.getInstance().downWheat();
|
||||
// break;
|
||||
// case ROOM_MUTE_LOCAL:
|
||||
// RtcManager.getInstance().muteLocalAudioStream(object.getBoolean("mute"));
|
||||
// break;
|
||||
// case ROOM_MUTE_MICROPHONE:
|
||||
// RtcManager.getInstance().muteSpeaker(object.getBoolean("mute"));
|
||||
// break;
|
||||
// case ROOM_SHOW_MESSAGE_DIALOG:
|
||||
// DialogUtils.showDialogFragment(ARouter.getInstance().build(ARouteConstants.ROOM_MSG_DIALOG).navigation());
|
||||
// break;
|
||||
// case ON_CLOSE_BTN_CLICK:
|
||||
// RtcManager.getInstance().leaveChannel();
|
||||
// ActivityUtils.finishActivity(H5Activity.class);
|
||||
// break;
|
||||
// case TYPE_QQ_SERVICE:
|
||||
// serviceUser();
|
||||
// break;
|
||||
// case TYPE_FEEDBACK:
|
||||
// ActivityUtils.startActivity(FeedBackActivity.class);
|
||||
// break;
|
||||
// case TYPE_USER_ZONE:
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", object.getString("userId")).navigation();
|
||||
// break;
|
||||
// case TYPE_RECHARGE:
|
||||
// ARouter.getInstance().build(ARouters.ME_BALANCE).navigation();
|
||||
// break;
|
||||
// case TYPE_BACK:
|
||||
// try {
|
||||
// ActivityUtils.getTopActivity().onBackPressed();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// break;
|
||||
// //游戏排行榜
|
||||
// case TYPE_GAME_RANK:
|
||||
// switch (title) {
|
||||
// case GAME_EL:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050303);
|
||||
// break;
|
||||
// case GAME_SB:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050403);
|
||||
// break;
|
||||
// case GAME_XM:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050503);
|
||||
// break;
|
||||
// case GAME_XT:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050603);
|
||||
// break;
|
||||
// case GAME_FK:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050703);
|
||||
// break;
|
||||
// }
|
||||
// break;
|
||||
// //游戏开始
|
||||
// case TYPE_GAME_BEGIN:
|
||||
// switch (title) {
|
||||
// case GAME_EL:
|
||||
// if (!TextUtils.isEmpty(NextGame) && GAME_EL.equals(NextGame)) {
|
||||
// gameCount++;
|
||||
// }
|
||||
// break;
|
||||
// case GAME_SB:
|
||||
// if (!TextUtils.isEmpty(NextGame) && GAME_SB.equals(NextGame)) {
|
||||
// gameCount++;
|
||||
// }
|
||||
// break;
|
||||
// case GAME_XM:
|
||||
// if (!TextUtils.isEmpty(NextGame) && GAME_XM.equals(NextGame)) {
|
||||
// gameCount++;
|
||||
// }
|
||||
// break;
|
||||
// case GAME_XT:
|
||||
// if (!TextUtils.isEmpty(NextGame) && GAME_XT.equals(NextGame)) {
|
||||
// gameCount++;
|
||||
// }
|
||||
// break;
|
||||
// case GAME_FK:
|
||||
// if (!TextUtils.isEmpty(NextGame) && GAME_FK.equals(NextGame)) {
|
||||
// gameCount++;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// if (gameCount == 0) {
|
||||
// gameCount = 1;
|
||||
// }
|
||||
// break;
|
||||
// //游戏结束
|
||||
// case TYPE_GAME_END:
|
||||
// switch (title) {
|
||||
// case GAME_EL:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050301, "game_count", String.valueOf(gameCount));
|
||||
// break;
|
||||
// case GAME_SB:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050401, "game_count", String.valueOf(gameCount));
|
||||
// break;
|
||||
// case GAME_XM:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050501, "game_count", String.valueOf(gameCount));
|
||||
// break;
|
||||
// case GAME_XT:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050601, "game_count", String.valueOf(gameCount));
|
||||
// break;
|
||||
// case GAME_FK:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050701, "game_count", String.valueOf(gameCount));
|
||||
// break;
|
||||
// }
|
||||
// break;
|
||||
// //游戏下一关
|
||||
// case TYPE_GAME_NEXT:
|
||||
// switch (title) {
|
||||
// case GAME_XM:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050504);
|
||||
// break;
|
||||
// case GAME_XT:
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050604);
|
||||
// break;
|
||||
// }
|
||||
// break;
|
||||
// //游戏暂停
|
||||
// case TYPE_GAME_PAUSE:
|
||||
// break;
|
||||
// //游戏声音
|
||||
// case TYPE_GAME_SOUND:
|
||||
// switch (title) {
|
||||
// case GAME_EL:
|
||||
// if (!object.getBoolean("sound")) {
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050302);
|
||||
// }
|
||||
// break;
|
||||
// case GAME_SB:
|
||||
// if (!object.getBoolean("sound")) {
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050402);
|
||||
// }
|
||||
// break;
|
||||
// case GAME_XM:
|
||||
// if (!object.getBoolean("sound")) {
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050502);
|
||||
// }
|
||||
// break;
|
||||
// case GAME_XT:
|
||||
// if (!object.getBoolean("sound")) {
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050602);
|
||||
// }
|
||||
// break;
|
||||
// case GAME_FK:
|
||||
// if (!object.getBoolean("sound")) {
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A050702);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private void quitLiveRoom() {
|
||||
// if (!TextUtils.isEmpty(BaseApplication.getInstance().playId)) {
|
||||
// NewApi.getInstance().quit(BaseApplication.getInstance().playId, new com.qpyy.libcommon.api.BaseObserver<String>(false, false) {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(String s) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// 调用示例:
|
||||
// window.bridge.common('{"type":"joinStreamLiveRoom","params":{"roomId":"12445435","userId":"12323 ","mute":false}}');
|
||||
// 调用顺序:
|
||||
// 1、加入直播间 joinStreamLiveRoom
|
||||
// 2、开始推流 startPublishingStreamLiveRoom
|
||||
// 3、打开麦克风 muteMicrophoneLiveRoom
|
||||
|
||||
/*
|
||||
加入直播间 joinStreamLiveRoom
|
||||
params :
|
||||
{
|
||||
"roomId":"房间id",
|
||||
}
|
||||
*/
|
||||
public static final String JOIN_LIVE_ROOM = "joinStreamLiveRoom";
|
||||
|
||||
/*
|
||||
离开流房间 推拉流 leaveStreamLiveRoom
|
||||
params :
|
||||
{
|
||||
"roomId":"房间id",
|
||||
}
|
||||
*/
|
||||
public static final String LEAVE_LIVE_ROOM = "leaveStreamLiveRoom";
|
||||
|
||||
/*
|
||||
开始推流 startPublishingStreamLiveRoom
|
||||
params :
|
||||
{
|
||||
"roomId":"房间id",
|
||||
"userId":"用户ID"
|
||||
}
|
||||
*/
|
||||
public static final String ROOM_START_PUBLISH_STREAM = "startPublishingStreamLiveRoom";
|
||||
|
||||
/*
|
||||
停止推流 stopPublishingStreamLiveRoom
|
||||
params :
|
||||
{
|
||||
"roomId":"房间id",
|
||||
"userId":"用户ID"
|
||||
}
|
||||
*/
|
||||
public static final String ROOM_STOP_PUBLISH_STREAM = "stopPublishingStreamLiveRoom";
|
||||
|
||||
/*
|
||||
是否屏蔽远端所有声音 muteSpeakerLiveRoom
|
||||
params :
|
||||
{
|
||||
mute:true // true为关闭,false为打开
|
||||
}
|
||||
*/
|
||||
public static final String ROOM_MUTE_LOCAL = "muteSpeakerLiveRoom";
|
||||
|
||||
/*
|
||||
是否静音(关闭)麦克风 muteMicrophoneLiveRoom
|
||||
params :
|
||||
{
|
||||
mute:true // true为关闭,false为打开
|
||||
}
|
||||
*/
|
||||
public static final String ROOM_MUTE_MICROPHONE = "muteMicrophoneLiveRoom";
|
||||
|
||||
|
||||
/*
|
||||
点击消息按钮 onMessageBtnClick
|
||||
params :
|
||||
{
|
||||
}
|
||||
*/
|
||||
public static final String ROOM_SHOW_MESSAGE_DIALOG = "onMessageBtnClick";
|
||||
|
||||
|
||||
//关闭按钮
|
||||
public static final String ON_CLOSE_BTN_CLICK = "onCloseBtnClick";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xscm.moduleutil.activity.news;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.NewsMessageList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NewsContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void showNews(List<NewsMessageList> newsList);
|
||||
void finishRefresh();
|
||||
}
|
||||
public interface IHomePre extends IPresenter {
|
||||
|
||||
void getMessagetitle(String type,String page,String pageLimit);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.xscm.moduleutil.activity.news;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.xscm.moduleutil.bean.NewsMessageList;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class NewsPresenter extends BasePresenter<NewsContacts.View> implements NewsContacts.IHomePre {
|
||||
public NewsPresenter(NewsContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getMessagetitle(String type, String page, String pageLimit) {
|
||||
api.getMessagetitle(type, page, pageLimit, new BaseObserver<List<NewsMessageList>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
MvpRef.get().finishRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<NewsMessageList> newsMessageLists) {
|
||||
MvpRef.get().showNews(newsMessageLists);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.xscm.moduleutil.activity.news;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.NewsMessageList;
|
||||
import com.xscm.moduleutil.databinding.ActivityOfficialNoticeBinding;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.TimeUtils;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OfficialNoticeActivity extends BaseMvpActivity<NewsPresenter, ActivityOfficialNoticeBinding> implements NewsContacts.View {
|
||||
|
||||
private int page = 1;
|
||||
private BaseQuickAdapter<NewsMessageList, BaseViewHolder> mAdapter;
|
||||
private String type;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
type = getIntent().getStringExtra("type");
|
||||
if (type.equals("1")) {
|
||||
mBinding.topBar.setTitle("系统消息");
|
||||
} else {
|
||||
mBinding.topBar.setTitle("官方公告");
|
||||
}
|
||||
// mBinding.smartRefreshLayout.autoRefresh();
|
||||
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getMessagetitle(type, page + "", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
MvpPre.getMessagetitle(type, page + "", "10");
|
||||
}
|
||||
});
|
||||
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(this));
|
||||
mAdapter = new BaseQuickAdapter<NewsMessageList, BaseViewHolder>(R.layout.news_rv_item_system_news) {
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, NewsMessageList item) {
|
||||
String time = TimeUtils.getDateToStringNoZ(Long.parseLong(item.getCreatetime()) * 1000L);
|
||||
helper.setText(R.id.tv_sys_time, time);
|
||||
if (item.getImage()==null || item.getImage().isEmpty()){
|
||||
helper.getView(R.id.tv_sys_con).setVisibility(VISIBLE);
|
||||
helper.setText(R.id.tv_sys_con, item.getContent());
|
||||
helper.getView(R.id.ll_system_official).setVisibility(GONE);
|
||||
}else {
|
||||
helper.getView(R.id.tv_sys_con).setVisibility(GONE);
|
||||
helper.getView(R.id.ll_system_official).setVisibility(VISIBLE);
|
||||
ImageUtils.loadHeadCC(item.getImage(), helper.getView(R.id.image));
|
||||
helper.setText(R.id.tv_cont, Html.fromHtml(item.getContent()));
|
||||
}
|
||||
helper.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (item.getRoom_id()>0){
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("room_id", item.getRoom_id() + "").navigation();
|
||||
}else if (item.getRoom_id() == 0 && item.getUrl() != null && !item.getUrl().isEmpty()){
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", item.getUrl()).navigation();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// if (item.getType().equals("1")) {
|
||||
// helper.getView(R.id.ll_system_official).setVisibility(GONE);
|
||||
// } else if (item.getType().equals("2")) {
|
||||
// helper.getView(R.id.tv_sys_con).setVisibility(GONE);
|
||||
// helper.getView(R.id.ll_system_official).setVisibility(VISIBLE);
|
||||
// } else {
|
||||
// helper.getView(R.id.ll_system_official).setVisibility(GONE);
|
||||
// }
|
||||
|
||||
// helper.getView(R.id.image).setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
};
|
||||
mBinding.recycleView.setAdapter(mAdapter);
|
||||
MvpPre.getMessagetitle(type, "1", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_official_notice;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NewsPresenter bindPresenter() {
|
||||
return new NewsPresenter(this, this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showNews(List<NewsMessageList> newsList) {
|
||||
mAdapter.setNewData(newsList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.blankj.utilcode.util.AppUtils;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.AppUpdateModel;
|
||||
import com.xscm.moduleutil.databinding.DialogAppUpdateBinding;
|
||||
import com.xscm.moduleutil.utils.DownloadListener;
|
||||
import com.xscm.moduleutil.utils.DownloadUtil;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog;
|
||||
|
||||
public class AppUpdateDialog extends BaseDialog<DialogAppUpdateBinding> implements DownloadListener, View.OnClickListener {
|
||||
|
||||
private AppUpdateModel appUpdateModel;
|
||||
private ProgressDialog mProgressDialog;
|
||||
|
||||
public AppUpdateDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.dialog_app_update;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
Window window = getWindow();
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 305 / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.tvContent.setMovementMethod(new ScrollingMovementMethod());
|
||||
mBinding.btUpdate.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (appUpdateModel != null) {
|
||||
mProgressDialog = new ProgressDialog(getContext()) {
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
}
|
||||
};
|
||||
mProgressDialog.setMax(100);//设置最大值
|
||||
mProgressDialog.setTitle("安装包下载");//设置标题
|
||||
mProgressDialog.setIcon(R.mipmap.ic_launcher);//设置标题小图标
|
||||
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);//设置样式为横向显示进度的样式
|
||||
mProgressDialog.incrementProgressBy(0);//设置初始值为0,其实可以不用设置,默认就是0
|
||||
mProgressDialog.setIndeterminate(false);//是否精确显示对话框,flase为是,反之为否
|
||||
mProgressDialog.setCanceledOnTouchOutside(false);
|
||||
mProgressDialog.setMessage("下载中请稍等!!!");
|
||||
mProgressDialog.show();
|
||||
DownloadUtil downloadUtil = new DownloadUtil(getContext());
|
||||
downloadUtil.downloadFile(appUpdateModel.getUrl(), this);
|
||||
}
|
||||
}
|
||||
|
||||
public void setAppUpdateModel(AppUpdateModel appUpdateModel) {
|
||||
this.appUpdateModel = appUpdateModel;
|
||||
mBinding.tvContent.setText(TextUtils.isEmpty(appUpdateModel.getContent()) ? "修复旧版本已知bug" : Html.fromHtml(appUpdateModel.getContent()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
|
||||
return true;
|
||||
}
|
||||
if (keyCode == KeyEvent.KEYCODE_SEARCH) {
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(int currentLength) {
|
||||
if (mProgressDialog != null) {
|
||||
mProgressDialog.setProgress(currentLength);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish(String localPath) {
|
||||
if (mProgressDialog != null && mProgressDialog.isShowing()) {
|
||||
mProgressDialog.dismiss();
|
||||
}
|
||||
try {
|
||||
AppUtils.installApp(localPath);
|
||||
} catch (Exception e) {
|
||||
Logger.e("installAppError", e);
|
||||
onFailure();
|
||||
}
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure() {
|
||||
ToastUtils.showShort("下载失败前往浏览器手动更新");
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
Uri url = Uri.parse(appUpdateModel.getUrl());
|
||||
intent.setData(url);
|
||||
getContext().startActivity(intent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.RechargeBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充值adapter
|
||||
*/
|
||||
public class BalanceRechargeAdapter extends BaseMultiItemQuickAdapter<RechargeBean, BaseViewHolder> {
|
||||
private int selectedPosition = -1;
|
||||
private OnRechargeItemClickListener listener;
|
||||
private InputBoxVisibilityListener inputBoxVisibilityListener;
|
||||
|
||||
public static final int ITEM_TYPE_NORMAL = 0;
|
||||
public static final int ITEM_TYPE_FOOTER = 1;
|
||||
|
||||
public BalanceRechargeAdapter(@NonNull List<RechargeBean> data) {
|
||||
super(data);
|
||||
// 初始化 item 类型
|
||||
addItemType(ITEM_TYPE_NORMAL, R.layout.rv_item_balance_recharge);
|
||||
addItemType(ITEM_TYPE_FOOTER, R.layout.rv_item_footer);
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
RechargeBean item = getData().get(position);
|
||||
return item.getItemViewType(); // 使用 bean 中的 itemViewType
|
||||
}
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RechargeBean item) {
|
||||
int type = helper.getItemViewType();
|
||||
|
||||
if (type == ITEM_TYPE_NORMAL) {
|
||||
// 正常 item 显示逻辑
|
||||
helper.setText(R.id.tv_gold_num, item.getCoins());
|
||||
helper.setText(R.id.tv_money, String.format("¥%s", item.getMoney()));
|
||||
if (selectedPosition == helper.getAdapterPosition()) {
|
||||
helper.setBackgroundRes(R.id.cl_item, com.xscm.moduleutil.R.drawable.bg_10_white_sele);
|
||||
} else {
|
||||
helper.setBackgroundRes(R.id.cl_item, com.xscm.moduleutil.R.drawable.bg_r10_white);
|
||||
}
|
||||
|
||||
helper.getView(R.id.cl_item).setOnClickListener(v -> {
|
||||
selectedPosition = helper.getAdapterPosition();
|
||||
if (listener != null) {
|
||||
listener.onClick(item);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
|
||||
// 隐藏输入框
|
||||
if (inputBoxVisibilityListener != null) {
|
||||
inputBoxVisibilityListener.onInputBoxVisibilityChanged(false);
|
||||
}
|
||||
});
|
||||
} else if (type == ITEM_TYPE_FOOTER) {
|
||||
helper.setText(R.id.tv_gold_num, "自定义");
|
||||
helper.getView(R.id.tv_gold_num).setOnClickListener(v -> {
|
||||
clearSelect(); // 清除所有选中状态
|
||||
notifyDataSetChanged();
|
||||
|
||||
// 显示输入框
|
||||
if (inputBoxVisibilityListener != null) {
|
||||
inputBoxVisibilityListener.onInputBoxVisibilityChanged(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public interface OnRechargeItemClickListener {
|
||||
void onClick(RechargeBean rechargeBean);
|
||||
}
|
||||
|
||||
public void setListener(OnRechargeItemClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public interface InputBoxVisibilityListener {
|
||||
void onInputBoxVisibilityChanged(boolean isVisible);
|
||||
}
|
||||
|
||||
public void setInputBoxVisibilityListener(InputBoxVisibilityListener listener) {
|
||||
this.inputBoxVisibilityListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消所有选中
|
||||
*/
|
||||
public void clearSelect() {
|
||||
selectedPosition = -1;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.TimeUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.utils.MeHeadView;
|
||||
import com.xscm.moduleutil.utils.NumberFormatUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.MyGridView;
|
||||
import com.xscm.moduleutil.widget.img.FullScreenUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CirleListAdapter extends BaseQuickAdapter<CircleListBean, BaseViewHolder> {
|
||||
|
||||
public static final int PAGE_HOME = 0; // 首页
|
||||
public static final int PAGE_SEARCH = 2; // 点击头像进入的
|
||||
private int mPageType;
|
||||
|
||||
public CirleListAdapter(int pageType) {
|
||||
super(R.layout.item_cirle_list);
|
||||
this.mPageType = pageType;
|
||||
}
|
||||
public interface OnItemClickListener {
|
||||
void onDianzanClick(CircleListBean item);
|
||||
|
||||
void onHeadImageClick(CircleListBean item);
|
||||
|
||||
void onZsClick(CircleListBean item);
|
||||
|
||||
void onDiandianClick(CircleListBean item);
|
||||
|
||||
void onPinglunClick(CircleListBean item);
|
||||
|
||||
void onRelaClick(CircleListBean item);
|
||||
|
||||
void onGensui(CircleListBean item);
|
||||
}
|
||||
|
||||
private OnItemClickListener mListener;
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, CircleListBean item) {
|
||||
helper.addOnClickListener(com.xscm.moduleutil.R.id.dianzan)
|
||||
.addOnClickListener(R.id.dy_lookmore_tv)
|
||||
.addOnClickListener(R.id.dy_head_image)
|
||||
.addOnClickListener(R.id.diandian)
|
||||
.addOnClickListener(R.id.pinglun)
|
||||
.addOnClickListener(R.id.rela)
|
||||
.addOnClickListener(R.id.gensui)
|
||||
.addOnClickListener(com.xscm.moduleutil.R.id.zs);
|
||||
|
||||
//先让单图,多图,音频的布局显示
|
||||
helper.getView(R.id.dy_image_recyc).setVisibility(VISIBLE);
|
||||
helper.getView(R.id.iv_jubao).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// Intent intent = new Intent(mContext, UserHomepageActivity.class);
|
||||
// intent.putExtra("userId", SpUtil.getUserId()+"");
|
||||
// startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
// 设置点击回调
|
||||
helper.getView(com.xscm.moduleutil.R.id.dianzan).setOnClickListener(v -> {
|
||||
if (mListener != null){
|
||||
mListener.onDianzanClick(item);
|
||||
}
|
||||
});
|
||||
|
||||
helper.getView(com.xscm.moduleutil.R.id.dy_head_image).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onHeadImageClick(item);
|
||||
});
|
||||
|
||||
helper.getView(com.xscm.moduleutil.R.id.zs).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onZsClick(item);
|
||||
});
|
||||
|
||||
helper.getView(R.id.diandian).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onDiandianClick(item);
|
||||
});
|
||||
|
||||
helper.getView(R.id.pinglun).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onPinglunClick(item);
|
||||
});
|
||||
|
||||
helper.getView(R.id.rela).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onRelaClick(item);
|
||||
});
|
||||
helper.getView(R.id.gensui).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onGensui(item);
|
||||
});
|
||||
// 为整个 item 设置点击事件
|
||||
helper.itemView.setOnClickListener(v -> {
|
||||
if (mListener != null) {
|
||||
mListener.onPinglunClick(item); // 复用 onHeadImageClick 作为跳转逻辑
|
||||
}
|
||||
});
|
||||
//昵称
|
||||
helper.setText(R.id.dy_name_text, item.getNickname());
|
||||
|
||||
//头像
|
||||
// ImageUtils.loadHeadCC(item.getAvatar(), helper.getView(R.id.dy_head_image));
|
||||
MeHeadView headView = helper.getView(R.id.dy_head_image);
|
||||
headView.setData(item.getAvatar(), "", item.getSex() + "");
|
||||
//动态内容以富文本展示
|
||||
String content = item.getContent();
|
||||
if (content == null || content.length() == 0) {
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
|
||||
helper.getView(R.id.dy_content_tv).setVisibility(GONE);
|
||||
} else {
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(VISIBLE);
|
||||
helper.getView(R.id.dy_content_tv).setVisibility(VISIBLE);
|
||||
}
|
||||
helper.getView(R.id.dy_lookmore_tv).getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
//这个回调会调用多次,获取完行数记得注销监听
|
||||
TextView view = helper.getView(R.id.dy_content_tv);
|
||||
int lineCount = view.getLineCount();
|
||||
if (lineCount >= 7) {
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(VISIBLE);
|
||||
helper.getView(R.id.dy_content_tv).getViewTreeObserver().removeOnPreDrawListener(this);//销毁
|
||||
} else {
|
||||
helper.getView(R.id.dy_lookmore_tv).setVisibility(GONE);
|
||||
helper.getView(R.id.dy_content_tv).getViewTreeObserver().removeOnPreDrawListener(this);//销毁
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
TextView view = helper.getView(R.id.dy_content_tv);
|
||||
view.setVisibility(GONE);
|
||||
} else {
|
||||
TextView view = helper.getView(R.id.dy_content_tv);
|
||||
view.setVisibility(VISIBLE);
|
||||
}
|
||||
// 创建 SpannableString 来拼接 title 并设置点击事件
|
||||
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
|
||||
spannableStringBuilder.append(content).append(" "); // 添加原始内容
|
||||
if (item.getTitle() != null) {
|
||||
|
||||
for (int i = 0; i < item.getTitle().size(); i++) {
|
||||
HeatedBean heatedBean = item.getTitle().get(i);
|
||||
String title = heatedBean != null ? heatedBean.getTitle() : "";
|
||||
|
||||
// 添加 title 到 SpannableString
|
||||
spannableStringBuilder.append(title);
|
||||
|
||||
|
||||
// 创建点击事件和颜色
|
||||
ClickableSpan clickableSpan = new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
// 处理点击事件,比如跳转
|
||||
// Intent intent = new Intent(mContext, TargetActivity.class);
|
||||
// intent.putExtra("url", item.getUrl()); // 传递 URL 或其他参数
|
||||
// mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDrawState(TextPaint ds) {
|
||||
super.updateDrawState(ds);
|
||||
ds.setColor(ContextCompat.getColor(mContext, R.color.colorPrimary)); // 设置文字颜色
|
||||
ds.setUnderlineText(false); // 去掉下划线
|
||||
}
|
||||
};
|
||||
|
||||
// 设置点击效果
|
||||
spannableStringBuilder.setSpan(clickableSpan, spannableStringBuilder.length() - title.length(), spannableStringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
TextView textView = helper.getView(R.id.dy_content_tv);
|
||||
textView.setMovementMethod(LinkMovementMethod.getInstance()); // 允许点击
|
||||
textView.setHighlightColor(0); // 去掉点击时的背景色
|
||||
textView.setText(spannableStringBuilder);
|
||||
}
|
||||
|
||||
|
||||
if (item.getIs_like() == 1) {
|
||||
helper.setImageResource(R.id.dianzan_image, R.mipmap.dongtai_hudong_yidianzan);
|
||||
// helper.setText(R.id.dy_fabulous, String.valueOf(Integer.parseInt(item.getLike_num()) + 1));
|
||||
} else {
|
||||
helper.setImageResource(R.id.dianzan_image, com.xscm.moduleutil.R.mipmap.dongtai_hudong_dianzan);
|
||||
// helper.setText(R.id.dy_fabulous, item.getLike_num());
|
||||
}
|
||||
|
||||
helper.setText(R.id.dy_fabulous, item.getLike_num());
|
||||
|
||||
if (mPageType==PAGE_SEARCH){
|
||||
helper.setVisible(R.id.gensui, false);
|
||||
}else {
|
||||
if (item.getUser_id()==SpUtil.getUserId()){
|
||||
helper.setVisible(R.id.gensui, false);
|
||||
}else {
|
||||
helper.setVisible(R.id.gensui, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (item.getRoom_id() != null && !item.getRoom_id().equals("0")) {
|
||||
helper.setText(R.id.gensui, "跟随");
|
||||
} else if (item.getRoom_id() == null || item.getRoom_id().equals("0")){
|
||||
helper.setText(R.id.gensui, "私信");
|
||||
}
|
||||
//分享数
|
||||
// helper.setText(R.id.dy_zs, item.getRewards_num() != null ? item.getRewards_num() : "0");
|
||||
double rewardNum = item.getRewards_num() != null ? Double.parseDouble(item.getRewards_num()) : 0;
|
||||
helper.setText(R.id.dy_zs, NumberFormatUtils.formatRewardNumber(rewardNum));
|
||||
|
||||
//评论数
|
||||
helper.setText(R.id.dy_comment, item.getComment_num() + "");
|
||||
|
||||
//时间
|
||||
if (!item.getCreatetime().isEmpty()) {
|
||||
try {
|
||||
helper.setText(R.id.dy_time_text, TimeUtils.millis2String(Long.parseLong(item.getCreatetime()) * 1000));
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//显示图片
|
||||
if (item.getImages() != null && !item.getImages().isEmpty()) {
|
||||
String[] arrIv = item.getImages().split(",");
|
||||
OneImageYuanJiaoAdapter oneImageYuanJiaoAdapter = new OneImageYuanJiaoAdapter(mContext);
|
||||
MyGridView recyclerView = helper.getView(R.id.dy_image_recyc);
|
||||
recyclerView.setNumColumns(3);
|
||||
recyclerView.setAdapter(oneImageYuanJiaoAdapter);
|
||||
oneImageYuanJiaoAdapter.getList_adapter().clear();
|
||||
|
||||
for (int j = 0; j < arrIv.length; j++) {
|
||||
oneImageYuanJiaoAdapter.getList_adapter().add(arrIv[j]);
|
||||
}
|
||||
oneImageYuanJiaoAdapter.notifyDataSetChanged();
|
||||
recyclerView.setOnItemClickListener((parent, view, position, id) -> {
|
||||
FullScreenUtil.showFullScreenDialog(mContext, position, oneImageYuanJiaoAdapter.getList_adapter());
|
||||
});
|
||||
}else {
|
||||
helper.getView(R.id.dy_image_recyc).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (item.getLike_list() == null){
|
||||
helper.getView(R.id.rela).setVisibility(GONE);
|
||||
helper.getView(R.id.view).setVisibility(VISIBLE);
|
||||
}else {
|
||||
helper.getView(R.id.rela).setVisibility(VISIBLE);
|
||||
helper.getView(R.id.view).setVisibility(GONE);
|
||||
RecyclerView recyclerView= helper.getView(R.id.recycle_view);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
LikeUserAdapter<CircleListBean.LikeList> likeUserAdapter = new LikeUserAdapter<>();
|
||||
recyclerView.setAdapter(likeUserAdapter);
|
||||
likeUserAdapter.setNewData(item.getLike_list());
|
||||
helper.setText(R.id.pinglun_tv, item.getLike_num()+"人点赞");
|
||||
}
|
||||
|
||||
}
|
||||
public static final String PAYLOAD_LIKE = "like";
|
||||
|
||||
public void updateLikeStatusOnly(int position, int isLike) {
|
||||
notifyItemChanged(position, PAYLOAD_LIKE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull BaseViewHolder holder, int position, @NonNull List<Object> payloads) {
|
||||
if (payloads.isEmpty()) {
|
||||
onBindViewHolder(holder, position); // 全量绑定
|
||||
} else {
|
||||
for (Object payload : payloads) {
|
||||
if (payload.equals(PAYLOAD_LIKE)) {
|
||||
CircleListBean item = getData().get(position);
|
||||
if (item.getIs_like() == 1) {
|
||||
holder.setImageResource(R.id.dianzan_image, R.mipmap.dongtai_hudong_yidianzan);
|
||||
holder.setText(R.id.dy_fabulous, String.valueOf(Integer.parseInt(item.getLike_num()) + 1));
|
||||
} else {
|
||||
holder.setImageResource(R.id.dianzan_image, com.xscm.moduleutil.R.mipmap.dongtai_hudong_dianzan);
|
||||
holder.setText(R.id.dy_fabulous, item.getLike_num());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.TimeUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.utils.MeHeadView;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CommentAdapter extends RecyclerView.Adapter<CommentAdapter.CommentViewHolder> {
|
||||
public interface OnCommentInteractionListener {
|
||||
void onInputBoxShow(int id,String s,int position,String replyTo);
|
||||
|
||||
void onDetaleClick(int id,int position);
|
||||
// 新增长按回调
|
||||
void onCommentLongClick(CommentBean.CommentDetailsBean comment, CommentBean.CommentDetailsBean.Replies reply, int position);
|
||||
|
||||
}
|
||||
private OnCommentInteractionListener listener; // 新增监听器引用
|
||||
public void setOnCommentInteractionListener(OnCommentInteractionListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
private List<CommentBean.CommentDetailsBean> commentList;
|
||||
private static FragmentManager fragmentManager = null;
|
||||
|
||||
public CommentAdapter(List<CommentBean.CommentDetailsBean> commentList) {
|
||||
this.commentList = commentList;
|
||||
}
|
||||
public void updateData(List<CommentBean.CommentDetailsBean> newReplyList) {
|
||||
DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(new CommentDiffCallback(this.commentList, newReplyList));
|
||||
this.commentList.clear();
|
||||
this.commentList.addAll(newReplyList);
|
||||
diffResult.dispatchUpdatesTo(this);
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public CommentViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_comment, parent, false);
|
||||
return new CommentViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull CommentViewHolder holder, int position) {
|
||||
CommentBean.CommentDetailsBean comment = commentList.get(position);
|
||||
holder.bind(comment, listener, position);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return commentList.size();
|
||||
}
|
||||
|
||||
static class CommentViewHolder extends RecyclerView.ViewHolder {
|
||||
private MeHeadView ivAvatar;
|
||||
private TextView tvNickname;
|
||||
private TextView tvContent;
|
||||
private RecyclerView rvReplies;
|
||||
private TextView btnReply,btnDetale;
|
||||
private TextView tvTime;
|
||||
private TextView btnShowAllReplies;
|
||||
|
||||
private TextView tv_send;
|
||||
private EditText et_input;
|
||||
|
||||
public CommentViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
ivAvatar = itemView.findViewById(R.id.iv_avatar);
|
||||
tvNickname = itemView.findViewById(R.id.tv_nickname);
|
||||
tvContent = itemView.findViewById(R.id.tv_content);
|
||||
rvReplies = itemView.findViewById(R.id.rv_replies);
|
||||
btnReply = itemView.findViewById(R.id.btn_reply);
|
||||
btnDetale=itemView.findViewById(R.id.btn_detale);
|
||||
tvTime = itemView.findViewById(R.id.tv_time);
|
||||
btnShowAllReplies = itemView.findViewById(R.id.btn_show_all_replies);
|
||||
tv_send= itemView.findViewById(R.id.tv_send);
|
||||
et_input= itemView.findViewById(R.id.et_input);
|
||||
// 设置子评论的适配器
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(itemView.getContext());
|
||||
rvReplies.setLayoutManager(layoutManager);
|
||||
ReplyAdapter replyAdapter = new ReplyAdapter(new ArrayList<>());
|
||||
rvReplies.setAdapter(replyAdapter);
|
||||
}
|
||||
|
||||
public void bind(CommentBean.CommentDetailsBean comment, OnCommentInteractionListener listener, int position) {
|
||||
// 绑定主评论数据
|
||||
tvNickname.setText(comment.getNickname());
|
||||
tvContent.setText(comment.getContent());
|
||||
ivAvatar.setData(comment.getAvatar(), "","");
|
||||
// 加载用户头像(使用 Glide 或其他图片加载库)
|
||||
// Glide.with(itemView).load(comment.getAvatar()).into(ivAvatar);
|
||||
|
||||
if (comment.getUser_id()==SpUtil.getUserId()){
|
||||
btnDetale.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
btnDetale.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
tvTime.setText(TimeUtils.millis2String(Long.parseLong(comment.getCreatetime()+"") * 1000));
|
||||
// 绑定子评论数据
|
||||
ReplyAdapter replyAdapter = (ReplyAdapter) rvReplies.getAdapter();
|
||||
if (replyAdapter != null) {
|
||||
if (comment.getReplies() != null&& comment.getReplies().size() > 0) {
|
||||
rvReplies.setVisibility(VISIBLE);
|
||||
replyAdapter.updateData(comment.getReplies());
|
||||
|
||||
// 控制“全部评论...”按钮的显示
|
||||
btnShowAllReplies.setVisibility(comment.getReplies().size() > 2 ? VISIBLE : GONE);
|
||||
|
||||
btnShowAllReplies.setOnClickListener(v -> {
|
||||
replyAdapter.setExpanded(true); // 展开所有评论
|
||||
btnShowAllReplies.setVisibility(GONE); // 隐藏按钮
|
||||
});
|
||||
|
||||
replyAdapter.setOnReplyClickListener((reply, position1) -> {
|
||||
if (listener != null) {
|
||||
// 构造回复内容(如 @用户名)
|
||||
String replyContent = "@" + reply.getNickname() + " ";
|
||||
listener.onInputBoxShow(reply.getPid(), replyContent, getAdapterPosition(),reply.getReply_to()+"");
|
||||
}
|
||||
});
|
||||
|
||||
replyAdapter.setOnReplyLongClickListener((reply, replyPosition) -> {
|
||||
if (listener != null) {
|
||||
// 转发到Activity
|
||||
listener.onCommentLongClick(comment,reply, replyPosition);
|
||||
}
|
||||
});
|
||||
}else {
|
||||
rvReplies.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
// 点击回复按钮
|
||||
btnReply.setOnClickListener(v -> {
|
||||
|
||||
if (listener != null) {
|
||||
// 传递需要的参数
|
||||
listener.onInputBoxShow(comment.getId(), "", position,"");
|
||||
}
|
||||
|
||||
});
|
||||
btnDetale.setOnClickListener(v -> {
|
||||
if (listener != null) {
|
||||
listener.onDetaleClick(comment.getId(), position); // 点击删除按钮
|
||||
}
|
||||
});
|
||||
|
||||
// if (comment.getUser_id()!= SpUtil.getUserId()){
|
||||
// btnReply.setVisibility(GONE);
|
||||
// }else {
|
||||
// btnReply.setVisibility(VISIBLE);
|
||||
// }
|
||||
|
||||
// 添加长按监听
|
||||
itemView.setOnLongClickListener(v -> {
|
||||
if (listener != null) {
|
||||
listener.onCommentLongClick(comment, null,position);
|
||||
}
|
||||
return true; // 消费事件
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class CommentDiffCallback extends DiffUtil.Callback {
|
||||
|
||||
private final List<CommentBean.CommentDetailsBean> oldList;
|
||||
private final List<CommentBean.CommentDetailsBean> newList;
|
||||
|
||||
public CommentDiffCallback(List<CommentBean.CommentDetailsBean> oldList, List<CommentBean.CommentDetailsBean> newList) {
|
||||
this.oldList = oldList;
|
||||
this.newList = newList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOldListSize() {
|
||||
return oldList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNewListSize() {
|
||||
return newList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
return oldList.get(oldItemPosition).getId() == newList.get(newItemPosition).getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
return oldList.get(oldItemPosition).equals(newList.get(newItemPosition));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/9
|
||||
*@description:可动态添加和删除的viewPage适配器
|
||||
*/
|
||||
public class CommonPageAdapter extends FragmentPagerAdapter {
|
||||
|
||||
private List<Fragment> mFragmentList = new ArrayList<>();
|
||||
private List<Integer> mItemIdList = new ArrayList<>();
|
||||
private int id = 0;
|
||||
private FragmentManager mFm;
|
||||
|
||||
public CommonPageAdapter(FragmentManager fm, @NonNull List<Fragment> fragmentList) {
|
||||
super(fm);
|
||||
this.mFm = fm;
|
||||
for (Fragment fragment : fragmentList) {
|
||||
this.mFragmentList.add(fragment);
|
||||
mItemIdList.add(id++);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public CommonPageAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
public List<Fragment> getFragmentList() {
|
||||
return mFragmentList;
|
||||
}
|
||||
|
||||
public void addPage(int index, Fragment fragment) {
|
||||
mFragmentList.add(index, fragment);
|
||||
mItemIdList.add(index, id++);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addPage(Fragment fragment) {
|
||||
mFragmentList.add(fragment);
|
||||
mItemIdList.add(id++);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void delPage(int index) {
|
||||
mFragmentList.remove(index);
|
||||
mItemIdList.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void updatePage(List<Fragment> fragmentList) {
|
||||
mFragmentList.clear();
|
||||
mItemIdList.clear();
|
||||
|
||||
for (int i = 0; i < fragmentList.size(); i++) {
|
||||
mFragmentList.add(fragmentList.get(i));
|
||||
mItemIdList.add(id++);//注意这里是id++,不是i++。
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return mFragmentList.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mFragmentList.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回值有三种,
|
||||
* POSITION_UNCHANGED 默认值,位置没有改变
|
||||
* POSITION_NONE item已经不存在
|
||||
* position item新的位置
|
||||
* 当position发生改变时这个方法应该返回改变后的位置,以便页面刷新。
|
||||
*/
|
||||
@Override
|
||||
public int getItemPosition(Object object) {
|
||||
if (object instanceof Fragment) {
|
||||
|
||||
if (mFragmentList.contains(object)) {
|
||||
return mFragmentList.indexOf(object);
|
||||
} else {
|
||||
return POSITION_NONE;
|
||||
}
|
||||
|
||||
}
|
||||
return super.getItemPosition(object);
|
||||
}
|
||||
public void updateFragments(List<Fragment> newFragments) {
|
||||
this.mFragmentList.clear();
|
||||
this.mFragmentList.addAll(newFragments);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return mItemIdList.get(position);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.blankj.utilcode.util.ConvertUtils;
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.HeavenGiftBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class GiftAdapter extends BaseQuickAdapter<HeavenGiftBean, BaseViewHolder> {
|
||||
//类型 1:金币,2:礼物,3:坐骑,4:头像框":
|
||||
private final int COIN_TYPE = 1;
|
||||
private final int GIFT_TYPE = 2;
|
||||
private final int MOUNT_TYPE = 3;
|
||||
private final int HEAD_TYPE = 4;
|
||||
|
||||
public GiftAdapter() {
|
||||
super(R.layout.item_gift);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, HeavenGiftBean item) {
|
||||
ImageUtils.loadHeadCC(item.getPicture(), helper.getView(R.id.iv_head));
|
||||
helper.getView(R.id.im_jb).setVisibility(View.VISIBLE);
|
||||
if (item.getType() == COIN_TYPE) {
|
||||
helper.setText(R.id.tv_gift_time, String.format("%s", item.getGold()));
|
||||
} else if (item.getType() == GIFT_TYPE) {
|
||||
helper.getView(R.id.im_jb).setVisibility(View.GONE);
|
||||
helper.setText(R.id.tv_gift_time, String.format("*%s", item.getQuantity()));
|
||||
} else {
|
||||
helper.getView(R.id.im_jb).setVisibility(View.GONE);
|
||||
helper.setText(R.id.tv_gift_time, String.format("%s天", item.getDays()));
|
||||
}
|
||||
helper.setText(R.id.tv_head_name, item.getTitle());
|
||||
ViewGroup.LayoutParams layoutParams = helper.itemView.getLayoutParams();
|
||||
layoutParams.width = ((ScreenUtils.getScreenWidth() - ConvertUtils.dp2px(140)) / 4);
|
||||
layoutParams.height = 259;
|
||||
helper.itemView.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.event.RoomGiftPackToEvent;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025年7月29日23:36:25$ $
|
||||
* @Description 背包礼物适配器$
|
||||
*/
|
||||
public class GiftPackAdapter extends BaseAdapter {
|
||||
private final List<GiftPackBean> mDatas;
|
||||
private final LayoutInflater inflater;
|
||||
private final Context mContext;
|
||||
private final MyGestureDetector gestureDetector;
|
||||
private final String type;
|
||||
/**
|
||||
* 页数下标,从0开始(当前是第几页)
|
||||
*/
|
||||
private final int curIndex;
|
||||
/**
|
||||
* 每一页显示的个数
|
||||
*/
|
||||
private final int pageSize = 100;
|
||||
|
||||
public GiftPackAdapter(Context context, List<GiftPackBean> mDatas, int curIndex, String type) {
|
||||
inflater = LayoutInflater.from(context);
|
||||
this.mDatas = mDatas;
|
||||
this.curIndex = curIndex;
|
||||
this.mContext = context;
|
||||
this.type = type;
|
||||
this.gestureDetector = new MyGestureDetector(mContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* 先判断数据集的大小是否足够显示满本页?mDatas.size() > (curIndex+1)*pageSize,
|
||||
* 如果够,则直接返回每一页显示的最大条目个数pageSize,
|
||||
* 如果不够,则有几项返回几,(mDatas.size() - curIndex * pageSize);(也就是最后一页的时候就显示剩余item)
|
||||
*/
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mDatas.size() > (curIndex + 1) * pageSize ? pageSize : (mDatas.size() - curIndex * pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GiftPackBean getItem(int position) {
|
||||
return mDatas.get(position + curIndex * pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position + (long) curIndex * pageSize;
|
||||
}
|
||||
|
||||
private static class MyGestureDetector extends GestureDetector {
|
||||
private static WeakReference<GiftPackAdapter> sAdapter = new WeakReference<>(null);
|
||||
private static GiftPackBean sGiftModel;
|
||||
private GiftPackAdapter mAdapter;
|
||||
private GiftPackBean mGiftModel;
|
||||
public void setGiftModel(GiftPackAdapter adapter, GiftPackBean gift) {
|
||||
sAdapter = new WeakReference<>(adapter);
|
||||
sGiftModel = gift;
|
||||
}
|
||||
|
||||
private static final SimpleOnGestureListener sSimpleOnGestureListener = new SimpleOnGestureListener() {
|
||||
@Override
|
||||
public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||
EventBus.getDefault().post(new RoomGiftPackToEvent(sAdapter.get(), sGiftModel, 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDoubleTap(MotionEvent e) {
|
||||
EventBus.getDefault().post(new RoomGiftPackToEvent(sAdapter.get(), sGiftModel, 2));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
public MyGestureDetector(Context context) {
|
||||
super(context, sSimpleOnGestureListener);
|
||||
setOnDoubleTapListener(sSimpleOnGestureListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
GiftPackAdapter.ViewHolder viewHolder;
|
||||
GiftPackBean giftModel = getItem(position);
|
||||
if (convertView == null) {
|
||||
convertView = inflater.inflate(R.layout.item_gift_room, parent, false);
|
||||
viewHolder = new GiftPackAdapter.ViewHolder();
|
||||
viewHolder.tv_gift_name = (TextView) convertView.findViewById(R.id.tv_gift_name);
|
||||
viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
|
||||
viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
|
||||
viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||
viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (GiftPackAdapter.ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
viewHolder.item_layout.setOnClickListener(v -> {
|
||||
// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||
EventBus.getDefault().post(new RoomGiftPackToEvent(this, giftModel, 1));
|
||||
|
||||
});
|
||||
|
||||
//设置礼物名字
|
||||
viewHolder.tv_gift_name.setText(giftModel.getGift_name());
|
||||
//设置礼物价格
|
||||
String surplusTxt = giftModel.getGift_price();
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
//ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
viewHolder.tv_gift_price.setText(stringBuilder);
|
||||
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(giftModel.getBase_image(), viewHolder.iv_gift_pic);
|
||||
//设置选中后的样式
|
||||
|
||||
if (giftModel.isChecked()) {//被选中
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||
}
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
|
||||
static class ViewHolder {
|
||||
public ConstraintLayout item_layout;
|
||||
public TextView tv_gift_name, tv_gift_price, tv_gift_num;
|
||||
public ImageView iv_gift_pic;
|
||||
public TextView tv_gift_change_love_values;
|
||||
public ImageView ivDownOn;
|
||||
public ConstraintLayout cl_iv_down_on;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.event.RoomGiftClickToEvent;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftRoomAdapter extends BaseAdapter {
|
||||
private final List<RoonGiftModel> mDatas;
|
||||
private final LayoutInflater inflater;
|
||||
private final Context mContext;
|
||||
private final MyGestureDetector gestureDetector;
|
||||
private final String type;
|
||||
/**
|
||||
* 页数下标,从0开始(当前是第几页)
|
||||
*/
|
||||
private final int curIndex;
|
||||
/**
|
||||
* 每一页显示的个数
|
||||
*/
|
||||
private final int pageSize = 100;
|
||||
|
||||
public GiftRoomAdapter(Context context, List<RoonGiftModel> mDatas, int curIndex, String type) {
|
||||
inflater = LayoutInflater.from(context);
|
||||
this.mDatas = mDatas;
|
||||
this.curIndex = curIndex;
|
||||
this.mContext = context;
|
||||
this.type = type;
|
||||
this.gestureDetector = new MyGestureDetector(mContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* 先判断数据集的大小是否足够显示满本页?mDatas.size() > (curIndex+1)*pageSize,
|
||||
* 如果够,则直接返回每一页显示的最大条目个数pageSize,
|
||||
* 如果不够,则有几项返回几,(mDatas.size() - curIndex * pageSize);(也就是最后一页的时候就显示剩余item)
|
||||
*/
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mDatas.size() > (curIndex + 1) * pageSize ? pageSize : (mDatas.size() - curIndex * pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoonGiftModel getItem(int position) {
|
||||
return mDatas.get(position + curIndex * pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position + (long) curIndex * pageSize;
|
||||
}
|
||||
|
||||
private static class MyGestureDetector extends GestureDetector {
|
||||
private static WeakReference<GiftRoomAdapter> sAdapter = new WeakReference<>(null);
|
||||
private static RoonGiftModel sGiftModel;
|
||||
private GiftRoomAdapter mAdapter;
|
||||
private RoonGiftModel mGiftModel;
|
||||
public void setGiftModel(GiftRoomAdapter adapter, RoonGiftModel gift) {
|
||||
sAdapter = new WeakReference<>(adapter);
|
||||
sGiftModel = gift;
|
||||
}
|
||||
|
||||
private static final SimpleOnGestureListener sSimpleOnGestureListener = new SimpleOnGestureListener() {
|
||||
@Override
|
||||
public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||
EventBus.getDefault().post(new RoomGiftClickToEvent(sAdapter.get(), sGiftModel, 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDoubleTap(MotionEvent e) {
|
||||
EventBus.getDefault().post(new RoomGiftClickToEvent(sAdapter.get(), sGiftModel, 2));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
public MyGestureDetector(Context context) {
|
||||
super(context, sSimpleOnGestureListener);
|
||||
setOnDoubleTapListener(sSimpleOnGestureListener);
|
||||
}
|
||||
}
|
||||
|
||||
// private static class MyGestureDetector extends GestureDetector {
|
||||
// private GiftRoomAdapter mAdapter;
|
||||
// private RoonGiftModel mGiftModel;
|
||||
//
|
||||
// public MyGestureDetector(Context context) {
|
||||
// super(context, new SimpleOnGestureListener() {
|
||||
// @Override
|
||||
// public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||
// if (mAdapter != null && mGiftModel != null) {
|
||||
// EventBus.getDefault().post(new RoomGiftClickToEvent(mAdapter, mGiftModel, 1));
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean onDoubleTap(MotionEvent e) {
|
||||
// if (mAdapter != null && mGiftModel != null) {
|
||||
// EventBus.getDefault().post(new RoomGiftClickToEvent(mAdapter, mGiftModel, 2));
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
// setOnDoubleTapListener(getListener());
|
||||
// }
|
||||
//
|
||||
// public void setGiftModel(GiftRoomAdapter adapter, RoonGiftModel giftModel) {
|
||||
// this.mAdapter = adapter;
|
||||
// this.mGiftModel = giftModel;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder viewHolder;
|
||||
RoonGiftModel giftModel = getItem(position);
|
||||
if (convertView == null) {
|
||||
convertView = inflater.inflate(R.layout.item_gift_room, parent, false);
|
||||
viewHolder = new ViewHolder();
|
||||
viewHolder.tv_gift_name = (TextView) convertView.findViewById(R.id.tv_gift_name);
|
||||
viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
|
||||
viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
|
||||
viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||
viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||
// viewHolder.tv_gift_num = convertView.findViewById(R.id.tv_gift_num);
|
||||
|
||||
// viewHolder.tv_gift_change_love_values = convertView.findViewById(R.id.tv_gift_change_love_values);
|
||||
// viewHolder.item_layout.setOnTouchListener((v, event) -> {
|
||||
// gestureDetector.setGiftModel(GiftRoomAdapter.this, giftModel);
|
||||
// gestureDetector.onTouchEvent(event);
|
||||
//
|
||||
// return true;
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
viewHolder.item_layout.setOnClickListener(v -> {
|
||||
// RoonGiftModel clickedModel = (RoonGiftModel) v.getTag();
|
||||
EventBus.getDefault().post(new RoomGiftClickToEvent(this, giftModel, 1));
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
* 在给View绑定显示的数据时,计算正确的position = position + curIndex * pageSize,
|
||||
*/
|
||||
// viewHolder.tv_gift_num.setVisibility(type.equals("1") ? View.VISIBLE : View.INVISIBLE);
|
||||
// viewHolder.tv_gift_change_love_values.setVisibility(View.GONE);
|
||||
|
||||
|
||||
//设置礼物名字
|
||||
viewHolder.tv_gift_name.setText(giftModel.getGift_name());
|
||||
//设置礼物价格
|
||||
String surplusTxt = giftModel.getGift_price();
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
//ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
viewHolder.tv_gift_price.setText(stringBuilder);
|
||||
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(giftModel.getBase_image(), viewHolder.iv_gift_pic);
|
||||
//设置选中后的样式
|
||||
|
||||
if (giftModel.isChecked()) {//被选中
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||
}
|
||||
//设置
|
||||
// //设置礼物心动值
|
||||
// if (giftModel.getCardiac().equals("0")) {
|
||||
// viewHolder.tv_gift_change_love_values.setBackgroundResource(R.mipmap.room_gift_xin_dong_reduce);
|
||||
// viewHolder.tv_gift_change_love_values.setText(String.format("%s", giftModel.getCardiac()));
|
||||
// } else {
|
||||
// viewHolder.tv_gift_change_love_values.setBackgroundResource(R.mipmap.room_gift_xin_dong_add);
|
||||
// viewHolder.tv_gift_change_love_values.setText(String.format("+%s", giftModel.getCardiac()));
|
||||
// }
|
||||
// if (giftModel.isManghe()) {
|
||||
// viewHolder.tv_gift_change_love_values.setVisibility(View.GONE);
|
||||
// }
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
|
||||
static class ViewHolder {
|
||||
public ConstraintLayout item_layout;
|
||||
public TextView tv_gift_name, tv_gift_price, tv_gift_num;
|
||||
public ImageView iv_gift_pic;
|
||||
public TextView tv_gift_change_love_values;
|
||||
public ImageView ivDownOn;
|
||||
public ConstraintLayout cl_iv_down_on;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.event.RoomGiftClickEvent;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftTwoAdapter extends BaseAdapter {
|
||||
private final List<RoonGiftModel> mDatas;
|
||||
private final LayoutInflater inflater;
|
||||
private final Context mContext;
|
||||
private final MyGestureDetector gestureDetector;
|
||||
private final String type;
|
||||
/**
|
||||
* 页数下标,从0开始(当前是第几页)
|
||||
*/
|
||||
private final int curIndex;
|
||||
/**
|
||||
* 每一页显示的个数
|
||||
*/
|
||||
private final int pageSize = 100;
|
||||
|
||||
public GiftTwoAdapter(Context context, List<RoonGiftModel> mDatas, int curIndex, String type) {
|
||||
inflater = LayoutInflater.from(context);
|
||||
this.mDatas = mDatas;
|
||||
this.curIndex = curIndex;
|
||||
this.mContext = context;
|
||||
this.type = type;
|
||||
this.gestureDetector = new MyGestureDetector(mContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* 先判断数据集的大小是否足够显示满本页?mDatas.size() > (curIndex+1)*pageSize,
|
||||
* 如果够,则直接返回每一页显示的最大条目个数pageSize,
|
||||
* 如果不够,则有几项返回几,(mDatas.size() - curIndex * pageSize);(也就是最后一页的时候就显示剩余item)
|
||||
*/
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mDatas.size() > (curIndex + 1) * pageSize ? pageSize : (mDatas.size() - curIndex * pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoonGiftModel getItem(int position) {
|
||||
return mDatas.get(position + curIndex * pageSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position + (long) curIndex * pageSize;
|
||||
}
|
||||
|
||||
private static class MyGestureDetector extends GestureDetector {
|
||||
private static WeakReference<GiftTwoAdapter> sAdapter = new WeakReference<>(null);
|
||||
private static RoonGiftModel sGiftModel;
|
||||
|
||||
public void setGiftModel(GiftTwoAdapter adapter, RoonGiftModel gift) {
|
||||
sAdapter = new WeakReference<>(adapter);
|
||||
sGiftModel = gift;
|
||||
}
|
||||
|
||||
private static final SimpleOnGestureListener sSimpleOnGestureListener = new SimpleOnGestureListener() {
|
||||
@Override
|
||||
public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||
EventBus.getDefault().post(new RoomGiftClickEvent(sAdapter.get(), sGiftModel, 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDoubleTap(MotionEvent e) {
|
||||
EventBus.getDefault().post(new RoomGiftClickEvent(sAdapter.get(), sGiftModel, 2));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
public MyGestureDetector(Context context) {
|
||||
super(context, sSimpleOnGestureListener);
|
||||
setOnDoubleTapListener(sSimpleOnGestureListener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressLint({"SetTextI18n", "ClickableViewAccessibility"})
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder viewHolder;
|
||||
if (convertView == null) {
|
||||
convertView = inflater.inflate(R.layout.room_gv_gift_item, parent, false);
|
||||
viewHolder = new ViewHolder();
|
||||
viewHolder.tv_gift_name = (TextView) convertView.findViewById(R.id.tv_gift_name);
|
||||
viewHolder.tv_gift_price = (TextView) convertView.findViewById(R.id.tv_gift_price);
|
||||
viewHolder.iv_gift_pic = (ImageView) convertView.findViewById(R.id.iv_gift_pic);
|
||||
viewHolder.item_layout = (ConstraintLayout) convertView.findViewById(R.id.cl_gift);
|
||||
viewHolder.ivDownOn = (ImageView) convertView.findViewById(R.id.iv_down_on);
|
||||
viewHolder.cl_iv_down_on = (ConstraintLayout) convertView.findViewById(R.id.cl_iv_down_on);
|
||||
viewHolder.tv_gift_num = convertView.findViewById(R.id.tv_number);
|
||||
// viewHolder.tv_gift_change_love_values = convertView.findViewById(R.id.tv_gift_change_love_values);
|
||||
viewHolder.item_layout.setOnTouchListener((v, event) -> {
|
||||
gestureDetector.setGiftModel(GiftTwoAdapter.this, (RoonGiftModel) v.getTag(R.id.id_gift_tag));
|
||||
gestureDetector.onTouchEvent(event);
|
||||
|
||||
return true;
|
||||
});
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
/*
|
||||
* 在给View绑定显示的数据时,计算正确的position = position + curIndex * pageSize,
|
||||
*/
|
||||
// viewHolder.tv_gift_num.setVisibility(type.equals("1") ? View.VISIBLE : View.INVISIBLE);
|
||||
// viewHolder.tv_gift_change_love_values.setVisibility(View.GONE);
|
||||
float[] corners = {0f, 4f, 0f, 4f};
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( viewHolder.tv_gift_num, ColorManager.getInstance().getPrimaryColorInt(), corners);
|
||||
viewHolder.tv_gift_num.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
RoonGiftModel giftModel = getItem(position);
|
||||
//设置礼物名字
|
||||
viewHolder.tv_gift_name.setText(giftModel.getGift_name());
|
||||
//设置礼物价格
|
||||
String surplusTxt = giftModel.getGift_price();
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(surplusTxt);
|
||||
//ForegroundColorSpan 为文字前景色,BackgroundColorSpan为文字背景色
|
||||
ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources().getColor(R.color.color_FFA9A9A9));
|
||||
stringBuilder.setSpan(redSpan, surplusTxt.length(), surplusTxt.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//修改最后两个字体的颜色
|
||||
viewHolder.tv_gift_price.setText(stringBuilder);
|
||||
// viewHolder.item_layout.setTag(R.id.id_gift_tag, giftModel);
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(giftModel.getBase_image(), viewHolder.iv_gift_pic);
|
||||
//设置选中后的样式
|
||||
|
||||
if (giftModel.isChecked()) {//被选中
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(R.mipmap.room_gift_bjx);
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
} else {
|
||||
viewHolder.ivDownOn.setVisibility(View.GONE);
|
||||
viewHolder.cl_iv_down_on.setBackgroundResource(0);
|
||||
}
|
||||
viewHolder.tv_gift_num.setText(String.format("x%s", giftModel.getNum()));
|
||||
|
||||
|
||||
//设置
|
||||
// //设置礼物心动值
|
||||
// if (giftModel.getCardiac().equals("0")) {
|
||||
// viewHolder.tv_gift_change_love_values.setBackgroundResource(R.mipmap.room_gift_xin_dong_reduce);
|
||||
// viewHolder.tv_gift_change_love_values.setText(String.format("%s", giftModel.getCardiac()));
|
||||
// } else {
|
||||
// viewHolder.tv_gift_change_love_values.setBackgroundResource(R.mipmap.room_gift_xin_dong_add);
|
||||
// viewHolder.tv_gift_change_love_values.setText(String.format("+%s", giftModel.getCardiac()));
|
||||
// }
|
||||
// if (giftModel.isManghe()) {
|
||||
// viewHolder.tv_gift_change_love_values.setVisibility(View.GONE);
|
||||
// }
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
|
||||
static class ViewHolder {
|
||||
public ConstraintLayout item_layout;
|
||||
public TextView tv_gift_name, tv_gift_price, tv_gift_num;
|
||||
public ImageView iv_gift_pic;
|
||||
public TextView tv_gift_change_love_values;
|
||||
public ImageView ivDownOn;
|
||||
public ConstraintLayout cl_iv_down_on;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.GiftLabelBean;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.bean.RewardUserBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||
import com.xscm.moduleutil.databinding.RoomVpGiftBinding;
|
||||
import com.xscm.moduleutil.event.GiftDoubleClickEvent;
|
||||
import com.xscm.moduleutil.event.GiftUserRefreshEvent;
|
||||
import com.xscm.moduleutil.event.RoomGiftClickEvent;
|
||||
import com.xscm.moduleutil.event.RoomGiftClickToEvent;
|
||||
import com.xscm.moduleutil.event.RoomGiftPackToEvent;
|
||||
import com.xscm.moduleutil.presenter.RewardGiftContacts;
|
||||
import com.xscm.moduleutil.presenter.RewardGiftPresenter;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter, RoomVpGiftBinding> implements RewardGiftContacts.View {
|
||||
private String id;
|
||||
private GiftTwoAdapter mAdapter;
|
||||
private GiftRoomAdapter roomAdapter;
|
||||
private GiftPackAdapter packAdapter;
|
||||
private String tag;
|
||||
private int pageSize = 100;//一页显示的礼物个数
|
||||
private int pageCount;//页数
|
||||
private int type;//1:房间点击进入的;2:打赏进入的
|
||||
private List<RoonGiftModel> giftList=new ArrayList<>();
|
||||
private List<GiftPackBean> giftPackList=new ArrayList<>();
|
||||
|
||||
public static GiftTwoDetailsFragment newInstance(String id,int type) {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString("id", id);
|
||||
args.putInt("type", type);
|
||||
GiftTwoDetailsFragment fragment = new GiftTwoDetailsFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
id = arguments.getString("id");
|
||||
type = arguments.getInt("type");
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RewardGiftPresenter bindPresenter() {
|
||||
return new RewardGiftPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (id.equals("0")){
|
||||
MvpPre.giftPack();
|
||||
}else {
|
||||
if (type==0) {
|
||||
MvpPre.getGiftList("0", type);
|
||||
}else {
|
||||
MvpPre.getGiftList(id, type);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_vp_gift;
|
||||
}
|
||||
|
||||
|
||||
public RoonGiftModel getGiftList() {
|
||||
if (giftList != null) {
|
||||
for (RoonGiftModel item : giftList) {
|
||||
if (item.isChecked()) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public GiftPackBean mGiftList() {
|
||||
if (giftPackList != null) {
|
||||
for (GiftPackBean item : giftPackList) {
|
||||
if (item.isChecked()) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public void setGiftList(List<RoonGiftModel> data,int type) {
|
||||
if (type == 1){
|
||||
giftList=new ArrayList<>();
|
||||
giftList.addAll(data);
|
||||
pageCount = (int) Math.ceil(data.size() * 1.0 / pageSize);
|
||||
for (int j = 0; j < pageCount; j++) {
|
||||
roomAdapter = new GiftRoomAdapter(getActivity(), data, j, "0");
|
||||
mBinding.rvGift.setAdapter(roomAdapter);
|
||||
}
|
||||
}else {
|
||||
giftList=new ArrayList<>();
|
||||
giftList.addAll(data);
|
||||
pageCount = (int) Math.ceil(data.size() * 1.0 / pageSize);
|
||||
for (int j = 0; j < pageCount; j++) {
|
||||
// mAdapter = new GiftTwoAdapter(getActivity(), data, j, "0");
|
||||
// mBinding.rvGift.setAdapter(mAdapter);
|
||||
roomAdapter = new GiftRoomAdapter(getActivity(), data, j, "0");
|
||||
mBinding.rvGift.setAdapter(roomAdapter);
|
||||
}
|
||||
}
|
||||
// EventBus.getDefault().post(new RoomGiftEvent(data));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void giveGift() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reward_zone() {
|
||||
ToastUtils.showShort("打赏成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomAuctionJoin(RoomAuction.AuctionListBean auctionListBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void giftPack(List<GiftPackBean> giftPackBean) {
|
||||
giftPackList=new ArrayList<>();
|
||||
giftPackList.addAll(giftPackBean);
|
||||
pageCount = (int) Math.ceil(giftPackBean.size() * 1.0 / pageSize);
|
||||
for (int j = 0; j < pageCount; j++) {
|
||||
// mAdapter = new GiftTwoAdapter(getActivity(), data, j, "0");
|
||||
// mBinding.rvGift.setAdapter(mAdapter);
|
||||
packAdapter = new GiftPackAdapter(getActivity(), giftPackBean, j, "0");
|
||||
mBinding.rvGift.setAdapter(packAdapter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRewardList(List<RewardUserBean> rewardUserBeanList) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onGiftClicRoomkEvent(RoomGiftClickEvent event) {
|
||||
if (giftList == null){
|
||||
giftList = new ArrayList<>();
|
||||
giftList.add(event.gift);
|
||||
}
|
||||
if (event.type == 1) {
|
||||
String id = event.gift.getGift_id();
|
||||
for (int i = 0; i < giftList.size(); i++) {
|
||||
RoonGiftModel giftModel = giftList.get(i);
|
||||
if (giftModel.getGift_id().equals(id)) {
|
||||
if (!giftModel.isChecked()) {
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type,event.gift));
|
||||
giftModel.setChecked(true);
|
||||
}
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
}
|
||||
}
|
||||
if (event.adapter != null && event.adapter.get() != null) {
|
||||
event.adapter.get().notifyDataSetChanged();
|
||||
}
|
||||
} else if (event.type == 2) {
|
||||
String id = event.gift.getGift_id();
|
||||
RoonGiftModel selGift = null;
|
||||
for (int i = 0; i < giftList.size(); i++) {
|
||||
RoonGiftModel giftModel = giftList.get(i);
|
||||
if (giftModel.getGift_id().equals(id)) {
|
||||
selGift = giftModel;
|
||||
if (!giftModel.isChecked()) {
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type,event.gift));
|
||||
giftModel.setChecked(true);
|
||||
}
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
}
|
||||
}
|
||||
if (event.adapter != null && event.adapter.get() != null) {
|
||||
event.adapter.get().notifyDataSetChanged();
|
||||
}
|
||||
if (selGift != null) {
|
||||
EventBus.getDefault().post(new GiftDoubleClickEvent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onGiftClicPackEvent(RoomGiftPackToEvent event) {
|
||||
if (giftPackList == null) {
|
||||
giftPackList = new ArrayList<>();
|
||||
giftPackList.add(event.gift);
|
||||
}
|
||||
if (event.type == 1){
|
||||
String id = event.gift.getGift_id();
|
||||
for (int i = 0; i < giftPackList.size(); i++) {
|
||||
GiftPackBean giftModel = giftPackList.get(i);
|
||||
RoonGiftModel roonGiftModel = new RoonGiftModel();
|
||||
roonGiftModel.setGift_id(giftModel.getGift_id());
|
||||
roonGiftModel.setGift_name(giftModel.getGift_name());
|
||||
roonGiftModel.setGift_price(giftModel.getGift_price());
|
||||
roonGiftModel.setBase_image(giftModel.getBase_image());
|
||||
roonGiftModel.setNum(Integer.parseInt(giftModel.getNum()));
|
||||
if (giftModel.getGift_id().equals(id)) {
|
||||
if (!giftModel.isChecked()) {
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type,roonGiftModel));
|
||||
giftModel.setChecked(true);
|
||||
}
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
}
|
||||
}
|
||||
if (event.adapter != null && event.adapter.get() != null) {
|
||||
event.adapter.get().notifyDataSetChanged();
|
||||
}
|
||||
}else {
|
||||
String id = event.gift.getGift_id();
|
||||
GiftPackBean selGift = null;
|
||||
for (int i = 0; i < giftPackList.size(); i++) {
|
||||
GiftPackBean giftModel = giftPackList.get(i);
|
||||
RoonGiftModel roonGiftModel = new RoonGiftModel();
|
||||
roonGiftModel.setGift_id(giftModel.getGift_id());
|
||||
roonGiftModel.setGift_name(giftModel.getGift_name());
|
||||
roonGiftModel.setGift_price(giftModel.getGift_price());
|
||||
roonGiftModel.setBase_image(giftModel.getBase_image());
|
||||
roonGiftModel.setNum(Integer.parseInt(giftModel.getNum()));
|
||||
if (giftModel.getGift_id().equals(id)) {
|
||||
selGift = giftModel;
|
||||
if (!giftModel.isChecked()) {
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type,roonGiftModel));
|
||||
giftModel.setChecked(true);
|
||||
}
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type,null));
|
||||
}
|
||||
}
|
||||
if (event.adapter != null && event.adapter.get() != null) {
|
||||
event.adapter.get().notifyDataSetChanged();
|
||||
}
|
||||
if (selGift != null) {
|
||||
EventBus.getDefault().post(new GiftDoubleClickEvent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onGiftClicRoomkTEvent(RoomGiftClickToEvent event) {
|
||||
if (giftList == null){
|
||||
giftList = new ArrayList<>();
|
||||
giftList.add(event.gift);
|
||||
}
|
||||
if (event.type == 1) {
|
||||
String id = event.gift.getGift_id();
|
||||
for (int i = 0; i < giftList.size(); i++) {
|
||||
RoonGiftModel giftModel = giftList.get(i);
|
||||
if (giftModel.getGift_id().equals(id)) {
|
||||
if (giftModel.isChecked()) {
|
||||
giftModel.setChecked(false);
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type,null));
|
||||
}else {
|
||||
giftModel.setChecked(true);
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(true, event.type,event.gift));
|
||||
}
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
}
|
||||
}
|
||||
if (event.adapter != null && event.adapter.get() != null) {
|
||||
event.adapter.get().notifyDataSetChanged();
|
||||
}
|
||||
} else if (event.type == 2) {
|
||||
String id = event.gift.getGift_id();
|
||||
RoonGiftModel selGift = null;
|
||||
for (int i = 0; i < giftList.size(); i++) {
|
||||
RoonGiftModel giftModel = giftList.get(i);
|
||||
if (giftModel.getGift_id().equals(id)) {
|
||||
selGift = giftModel;
|
||||
if (giftModel.isChecked()) {
|
||||
giftModel.setChecked(false);
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(false, event.type,null));
|
||||
}else {
|
||||
giftModel.setChecked(true);
|
||||
EventBus.getDefault().post(new GiftUserRefreshEvent(giftModel.isCan_send_self(), event.type,event.gift));
|
||||
}
|
||||
} else {
|
||||
giftModel.setChecked(false);
|
||||
}
|
||||
}
|
||||
if (event.adapter != null && event.adapter.get() != null) {
|
||||
event.adapter.get().notifyDataSetChanged();
|
||||
}
|
||||
if (selGift != null) {
|
||||
EventBus.getDefault().post(new GiftDoubleClickEvent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.GridView;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.BaseListData;
|
||||
import com.xscm.moduleutil.bean.HeavenGiftBean;
|
||||
import com.zhpan.bannerview.BaseBannerAdapter;
|
||||
import com.zhpan.bannerview.BaseViewHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HeavenGiftAdapter extends BaseBannerAdapter<BaseListData> {
|
||||
List<HeavenGiftBean> list;
|
||||
private OnItemClickListener onItemClickListener;
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.onItemClickListener = listener;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void bindData(BaseViewHolder<BaseListData> holder, BaseListData data, int position, int pageSize) {
|
||||
GiftTwoAdapter adapter = new GiftTwoAdapter(holder.itemView.getContext(), data.getData(), 0,"4");
|
||||
GridView recyclerView = holder.itemView.findViewById(R.id.rv_gift);
|
||||
// recyclerView.setLayoutManager(new GridLayoutManager(holder.itemView.getContext(), 4));
|
||||
recyclerView.setAdapter(adapter);
|
||||
// adapter.setNewData(data.getData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId(int viewType) {
|
||||
return R.layout.ietm_heaven_gift;
|
||||
}
|
||||
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(View view, HeavenGiftBean data, int position);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/10
|
||||
*@description: 点赞适配
|
||||
*/
|
||||
public class LikeListAdapter extends BaseQuickAdapter<CircleListBean.LikeList, BaseViewHolder> {
|
||||
public LikeListAdapter() {
|
||||
super(R.layout.item_like_list);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, CircleListBean.LikeList item) {
|
||||
ImageUtils.loadHeadCC(item.getAvatar(), helper.getView(R.id.like_avatar));
|
||||
helper.setText(R.id.tv_nickname, item.getNickname());
|
||||
String s=item.getSex().equals("1")?"男":"女";
|
||||
String age=item.getAge()+"岁";
|
||||
String constellation=item.getConstellation();
|
||||
String co=s+"/"+age+"/"+constellation;
|
||||
helper.setText(R.id.tv_content, co);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnlineBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/10
|
||||
*@description: 显示用户小头像
|
||||
*/
|
||||
public class LikeUserAdapter<T> extends BaseQuickAdapter<T, BaseViewHolder> {
|
||||
public LikeUserAdapter() {
|
||||
super(R.layout.item_like_user);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper,T item) {
|
||||
if (item instanceof CircleListBean.LikeList) {
|
||||
ImageUtils.loadHeadCC(((CircleListBean.LikeList) item).getAvatar(), helper.getView(R.id.user_icon));
|
||||
} else {
|
||||
// 可扩展:通过接口回调获取头像 URL
|
||||
ImageUtils.loadHeadCC(((RoomOnlineBean) item).getAvatar(), helper.getView(R.id.user_icon));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* listview的adapter基类
|
||||
*/
|
||||
public class MyBaseAdapter<T> extends BaseAdapter {
|
||||
|
||||
public List<T> list_adapter;
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list_adapter == null ? 0 : list_adapter.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return list_adapter.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<T> getList_adapter() {
|
||||
if (list_adapter == null)
|
||||
list_adapter = new ArrayList<>();
|
||||
return list_adapter;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
|
||||
private List<Fragment> fragmentList;
|
||||
|
||||
public MyFragmentPagerAdapter(List<Fragment> list, FragmentManager fm) {
|
||||
super(fm);
|
||||
this.fragmentList = list;
|
||||
}
|
||||
@Override
|
||||
public Fragment getItem(int i) {
|
||||
return fragmentList.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fragmentList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
|
||||
// super.destroyItem(container, position, object);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MyPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private List<Fragment> fragments;
|
||||
private List<String> typeOnes;
|
||||
|
||||
public MyPagerAdapter(FragmentManager fm, List<Fragment> mFragments, List<String> ones) {
|
||||
super(fm);
|
||||
this.fragments = mFragments;
|
||||
this.typeOnes = ones;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fragments.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return typeOnes.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||
super.destroyItem(container, position, object);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class OneImageYuanJiaoAdapter extends MyBaseAdapter<String> {
|
||||
private Context context;
|
||||
|
||||
// public OneImageYuanJiaoAdapter(Context context) {
|
||||
// this.context = context;
|
||||
// }
|
||||
|
||||
public OneImageYuanJiaoAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// protected void convert(BaseViewHolder helper, String item) {
|
||||
// helper.addOnClickListener(R.id.fiv);
|
||||
//
|
||||
// helper.setVisible(R.id.ll_del, false);
|
||||
// QMUIRadiusImageView image = helper.getView(R.id.fiv);
|
||||
// RequestOptions options = new RequestOptions()
|
||||
// .centerCrop()
|
||||
// .placeholder(R.color.white)
|
||||
// .diskCacheStrategy(DiskCacheStrategy.ALL);
|
||||
// Glide.with(mContext)
|
||||
// .load(item)
|
||||
// .apply(options)
|
||||
// .into(image);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder VH;
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.gv_filter_image, null);
|
||||
VH = new ViewHolder(convertView);
|
||||
convertView.setTag(VH);
|
||||
} else {
|
||||
VH = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
VH.iv_del.setVisibility(View.GONE);
|
||||
|
||||
if (!TextUtils.isEmpty(list_adapter.get(position))) {
|
||||
|
||||
ImageUtils.loadHeadCC(list_adapter.get(position),VH.tv_title);
|
||||
}
|
||||
//
|
||||
return convertView;
|
||||
}
|
||||
|
||||
|
||||
public static class ViewHolder {
|
||||
RoundedImageView tv_title;
|
||||
ImageView iv_del;
|
||||
RelativeLayout layoutImg;
|
||||
|
||||
public ViewHolder(View convertView) {
|
||||
tv_title = convertView.findViewById(R.id.fiv);
|
||||
iv_del = convertView.findViewById(R.id.iv_del);
|
||||
// layoutImg = convertView.findViewById(R.id.layout_img);
|
||||
//
|
||||
// int screenWidth = QMUIDisplayHelper.getScreenWidth(BaseApplication.mApplication) - QMUIDisplayHelper.dp2px(BaseApplication.mApplication, 24);
|
||||
//
|
||||
// int imgWidth = screenWidth*1/3-QMUIDisplayHelper.dp2px(BaseApplication.mApplication, 10);
|
||||
//
|
||||
// RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) layoutImg.getLayoutParams();
|
||||
// params.width = imgWidth;
|
||||
// params.height = imgWidth;
|
||||
// layoutImg.setLayoutParams(params);
|
||||
//
|
||||
// params = (RelativeLayout.LayoutParams) tv_title.getLayoutParams();
|
||||
// params.width = imgWidth;
|
||||
// params.height = imgWidth;
|
||||
// tv_title.setLayoutParams(params);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class PayMethodAdapter extends BaseQuickAdapter<BindType.AllData, BaseViewHolder> {
|
||||
|
||||
private int selectedPosition = -1; // -1 表示未选中
|
||||
|
||||
public PayMethodAdapter(int layoutResId) {
|
||||
super(layoutResId);
|
||||
}
|
||||
|
||||
public void setSelectedPosition(int position) {
|
||||
selectedPosition = position;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public int getSelectedPosition() {
|
||||
return selectedPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, BindType.AllData item) {
|
||||
helper.setText(R.id.tv_name, item.getName());
|
||||
ImageUtils.loadHeadCC(item.getIcon(), helper.getView(R.id.im_zfb));
|
||||
|
||||
// 设置选中状态样式
|
||||
boolean isSelected = helper.getAdapterPosition() == selectedPosition;
|
||||
View itemView = helper.itemView;
|
||||
itemView.setSelected(isSelected);
|
||||
ImageView imageView= helper.getView(R.id.iv_three_pay);
|
||||
// 你可以在这里修改背景、边框、图标等来表示选中状态
|
||||
if (isSelected) {
|
||||
imageView.setImageLevel(1);
|
||||
} else {
|
||||
imageView.setImageLevel(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.TimeUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ReplyAdapter extends RecyclerView.Adapter<ReplyAdapter.ReplyViewHolder> {
|
||||
public interface OnReplyClickListener {
|
||||
void onReplyClick(CommentBean.CommentDetailsBean.Replies reply, int position);
|
||||
}
|
||||
// 添加回调接口
|
||||
public interface OnReplyLongClickListener {
|
||||
void onReplyLongClick(CommentBean.CommentDetailsBean.Replies reply, int position);
|
||||
}
|
||||
|
||||
private OnReplyLongClickListener longClickListener;
|
||||
|
||||
public void setOnReplyLongClickListener(OnReplyLongClickListener listener) {
|
||||
this.longClickListener = listener;
|
||||
}
|
||||
private OnReplyClickListener listener;
|
||||
|
||||
// 设置监听器的方法
|
||||
public void setOnReplyClickListener(OnReplyClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
private List<CommentBean.CommentDetailsBean.Replies> replyList;
|
||||
private boolean isExpanded = false; // 是否展开显示所有评论
|
||||
|
||||
public ReplyAdapter(List<CommentBean.CommentDetailsBean.Replies> replyList) {
|
||||
this.replyList = replyList;
|
||||
}
|
||||
|
||||
public void updateData(List<CommentBean.CommentDetailsBean.Replies> newReplyList) {
|
||||
replyList.clear();
|
||||
replyList.addAll(newReplyList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ReplyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_reply, parent, false);
|
||||
return new ReplyViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ReplyViewHolder holder, int position) {
|
||||
CommentBean.CommentDetailsBean.Replies reply = replyList.get(position);
|
||||
if (!isExpanded && position >= 2) {
|
||||
return; // 不绑定数据
|
||||
}
|
||||
holder.bind(reply,position, listener,longClickListener);
|
||||
}
|
||||
|
||||
public void setExpanded(boolean expanded) {
|
||||
isExpanded = expanded;
|
||||
notifyDataSetChanged(); // 刷新适配器
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return isExpanded ? replyList.size() : Math.min(2, replyList.size());
|
||||
}
|
||||
|
||||
class ReplyViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView tvNickname;
|
||||
private TextView tvContent;
|
||||
private TextView btnReply;
|
||||
private TextView tvTime;
|
||||
private TextView btnShowAllReplies;
|
||||
public ReplyViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvNickname = itemView.findViewById(R.id.tv_name);
|
||||
tvContent = itemView.findViewById(R.id.tv_reply);
|
||||
btnReply = itemView.findViewById(R.id.btn_reply);
|
||||
tvTime = itemView.findViewById(R.id.tv_time);
|
||||
// btnShowAllReplies = itemView.findViewById(R.id.btn_show_all_replies);
|
||||
}
|
||||
|
||||
public void bind(CommentBean.CommentDetailsBean.Replies reply,int position, OnReplyClickListener listener,OnReplyLongClickListener longClickListener) {
|
||||
|
||||
tvNickname.setText(reply.getNickname()+":" +(reply.getReply_to_user()!=null?reply.getReply_to_user():""));
|
||||
tvContent.setText(reply.getContent());
|
||||
tvTime.setText(TimeUtils.millis2String(Long.parseLong(reply.getCreatetime()+"") * 1000));
|
||||
btnReply.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
listener.onReplyClick(reply, position);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 添加长按监听
|
||||
itemView.setOnLongClickListener(v -> {
|
||||
if (longClickListener != null) {
|
||||
longClickListener.onReplyLongClick(reply, position);
|
||||
return true; // 消费事件
|
||||
}
|
||||
return false;
|
||||
});
|
||||
// 控制“全部评论...”按钮的显示
|
||||
// btnShowAllReplies.setVisibility(position > 2 ? VISIBLE : GONE);
|
||||
//
|
||||
// btnShowAllReplies.setOnClickListener(v -> {
|
||||
//// replyAdapter.setExpanded(true); // 展开所有评论
|
||||
// notifyDataSetChanged(); // 刷新适配器
|
||||
// btnShowAllReplies.setVisibility(GONE); // 隐藏按钮
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
public class RewardUserAdapter {
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.xscm.moduleutil.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class UserPhotoWallAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
|
||||
private boolean b = false;
|
||||
public static final String ADD_PHOTO = "ADD_PHOTO";
|
||||
private int longClickPos = -1;
|
||||
|
||||
public UserPhotoWallAdapter() {
|
||||
super(R.layout.me_item_user_photo_wall);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, String item) {
|
||||
helper.setGone(R.id.iv_close, false);
|
||||
if (item.equals(ADD_PHOTO)) {
|
||||
// 显示加号图片
|
||||
helper.setImageResource(R.id.riv_user_head, com.xscm.moduleutil.R.mipmap.add_img);
|
||||
} else {
|
||||
ImageUtils.loadCenterCrop(item, helper.getView(R.id.riv_user_head));
|
||||
}
|
||||
|
||||
// if (helper.getAdapterPosition() == 5) {
|
||||
// helper.setVisible(R.id.riv_user_head, false);
|
||||
// helper.setVisible(R.id.iv_close, false);
|
||||
// } else {
|
||||
// helper.setVisible(R.id.riv_user_head, true);
|
||||
// if (!"0".equals(item.getId())) {
|
||||
// ImageUtils.loadCenterCrop(item.getUrl(), helper.getView(R.id.riv_user_head));
|
||||
// if (longClickPos == helper.getAdapterPosition()) {
|
||||
// helper.setVisible(R.id.iv_close, true);
|
||||
// } else {
|
||||
// helper.setVisible(R.id.iv_close, false);
|
||||
// }
|
||||
// } else {
|
||||
// helper.setImageResource(R.id.riv_user_head, com.qxcm.moduleutil.R.mipmap.add_img);
|
||||
// helper.setGone(R.id.iv_close, false);
|
||||
// }
|
||||
// }
|
||||
helper.addOnClickListener(R.id.iv_close);
|
||||
helper.addOnClickListener(R.id.riv_user_head);
|
||||
helper.addOnLongClickListener(R.id.riv_user_head);
|
||||
}
|
||||
|
||||
|
||||
public void setDelete(boolean b) {
|
||||
this.b = b;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setLongClickPos(int pos) {
|
||||
this.longClickPos = pos;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public boolean getDelete() {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
public abstract class BaseFragment<VDB extends ViewDataBinding> extends Fragment {
|
||||
protected VDB mBinding;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBinding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false);
|
||||
mBinding.setLifecycleOwner(this);
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
initArgs(getArguments());
|
||||
}
|
||||
initView();
|
||||
initData();
|
||||
initListener();
|
||||
}
|
||||
|
||||
public void initArgs(Bundle arguments) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (mBinding != null) {
|
||||
mBinding.unbind();
|
||||
}
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
protected void initListener() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected abstract void initData();
|
||||
|
||||
protected abstract void initView();
|
||||
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
|
||||
public void showLoading(String content) {
|
||||
if (!isAdded() || getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
if (getActivity() instanceof BaseAppCompatActivity) {
|
||||
((BaseAppCompatActivity) getActivity()).showLoading(content);
|
||||
}
|
||||
}
|
||||
|
||||
public void disLoading() {
|
||||
if (getActivity() instanceof BaseAppCompatActivity) {
|
||||
((BaseAppCompatActivity) getActivity()).disLoading();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/29
|
||||
*@description: dialogFragement基类
|
||||
*/
|
||||
public abstract class BaseMvpDialogFragment<P extends IPresenter, VDM extends ViewDataBinding> extends DialogFragment implements IView<Activity> {
|
||||
protected VDM mBinding;
|
||||
|
||||
protected P MvpPre;
|
||||
|
||||
protected abstract P bindPresenter();
|
||||
|
||||
protected boolean setDialogWH = true;
|
||||
protected boolean isAnimation = true;
|
||||
protected boolean mGravityBOTTOM;
|
||||
|
||||
@Override
|
||||
public Activity getSelfActivity() {
|
||||
return getActivity();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
// ARouter.getInstance().inject(this);
|
||||
mBinding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false);
|
||||
mBinding.setLifecycleOwner(this);
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
MvpPre = bindPresenter();
|
||||
if (getArguments() != null) {
|
||||
initArgs(getArguments());
|
||||
}
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
|
||||
public void initArgs(Bundle arguments) {
|
||||
|
||||
}
|
||||
|
||||
protected abstract void initData();
|
||||
|
||||
protected abstract void initView();
|
||||
|
||||
protected abstract int getLayoutId();
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (getDialog() != null && setDialogWH) {
|
||||
Window window = getDialog().getWindow();
|
||||
if (mGravityBOTTOM) {
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
}
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
||||
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
if (isAnimation) {
|
||||
window.setWindowAnimations(R.style.CommonShowDialogBottom);
|
||||
}
|
||||
// window.getDecorView().setPadding(0, 0, 0, 0);
|
||||
initDialogStyle(window);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initDialogStyle(Window window) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoadings() {
|
||||
if (!isAdded() || getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
if (getActivity() instanceof BaseAppCompatActivity) {
|
||||
((BaseAppCompatActivity) getActivity()).showLoading("加载中...");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoadings(String content) {
|
||||
if (!isAdded() || getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
if (getActivity() instanceof BaseAppCompatActivity) {
|
||||
((BaseAppCompatActivity) getActivity()).showLoading(content);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disLoadings() {
|
||||
if (getActivity() instanceof BaseAppCompatActivity) {
|
||||
((BaseAppCompatActivity) getActivity()).disLoading();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (mBinding != null) {
|
||||
mBinding.unbind();
|
||||
}
|
||||
if (MvpPre != null) {
|
||||
MvpPre.detachView();
|
||||
}
|
||||
super.onDestroyView();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
|
||||
public abstract class BaseMvpFragment<P extends IPresenter, VDB extends ViewDataBinding> extends BaseFragment<VDB> implements IView<Activity> {
|
||||
protected P MvpPre;
|
||||
|
||||
protected abstract P bindPresenter();
|
||||
|
||||
@Override
|
||||
public FragmentActivity getSelfActivity() {
|
||||
return getActivity();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
MvpPre = bindPresenter();
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (MvpPre != null) {
|
||||
MvpPre.detachView();
|
||||
}
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoadings() {
|
||||
// showLoading("加载中...");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoadings(String content) {
|
||||
// showLoading(content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disLoadings() {
|
||||
// disLoading();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
|
||||
public final class BaseRoomContacts {
|
||||
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
|
||||
}
|
||||
|
||||
public interface IBaseRoomPre extends IPresenter {
|
||||
void downWheat(String roomId);
|
||||
|
||||
void applyWheat(String roomId, String pitNumber);
|
||||
|
||||
void applyWheatWait(String roomId, String pitNumber);
|
||||
|
||||
void getRoomInfo(String roomId, String password);
|
||||
|
||||
void putOnWheat(String roomId, String userId,String pitNum);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public abstract class BaseRoomFragment<P extends BaseRoomPresenter, VDB extends ViewDataBinding> extends BaseMvpFragment<P, VDB> implements BaseRoomContacts.View {
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
unRegisterWheatViews();
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
registerWheatViews();
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间信息
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void roomInfo(RoomInfoResp resp) {
|
||||
roomInfoUpdate(resp);
|
||||
// EventBus.getDefault().post(new RoomCardiacValueChangedEvent());
|
||||
}
|
||||
|
||||
public abstract void roomInfoUpdate(RoomInfoResp resp);
|
||||
public abstract void registerWheatViews();
|
||||
public abstract void unRegisterWheatViews();
|
||||
|
||||
public abstract int[] collectCurrentCardiacValues();
|
||||
public int[][] collectAmativenessCurrentCardiacValues() { return new int[2][0]; }
|
||||
|
||||
public abstract void hideAllWheatMaozi();
|
||||
public void showWheatMaoziHuangguan(int wheat) {}
|
||||
public void showWheatMaoziBianbian(int... wheats) {}
|
||||
|
||||
public void showAmativenessMaleWheatMaozi(int index, int level) {}
|
||||
public void showAmativenessFemaleWheatMaozi(int index, int level) {}
|
||||
|
||||
protected void tzblChanged() {
|
||||
|
||||
}
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onRoomTzblChangedEvent(RoomTzblChangedEvent event) {
|
||||
// tzblChanged();
|
||||
// }
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onRoomCardiacValueChangedEvent(RoomCardiacValueChangedEvent event) {
|
||||
//// hideAllWheatMaozi();
|
||||
// checkWheatMaoziState(collectCurrentCardiacValues());
|
||||
// int[][] cvs = collectAmativenessCurrentCardiacValues();
|
||||
// checkAmativenessMaleWheatMaoziState(cvs[0]);
|
||||
// checkAmativenessFemaleWheatMaoziState(cvs[1]);
|
||||
// }
|
||||
|
||||
private void checkWheatMaoziState(int[] cvs) {
|
||||
int max = -999999999;
|
||||
int min = 999999999;
|
||||
List<Integer> maxs = new ArrayList<>();
|
||||
List<Integer> mins = new ArrayList<>();
|
||||
// 找出最大值/最小值
|
||||
for (int i = 0; i < cvs.length; i++) {
|
||||
int v = cvs[i];
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v >= max) { max = v; }
|
||||
if (v <= min) { min = v; }
|
||||
}
|
||||
// 如果最大值和最小值相同,全部不带帽子
|
||||
if (min == max) return;
|
||||
// 找出最大值的麦位/最小值的麦位
|
||||
for (int i = 0; i < cvs.length; i++) {
|
||||
int v = cvs[i];
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v == max) { maxs.add(i); }
|
||||
if (v == min) { mins.add(i); }
|
||||
}
|
||||
// 排序最大值的麦位,选出最优先的一个,带皇冠
|
||||
if (maxs.size() > 0) {
|
||||
// showWheatMaoziHuangguan(maxs.get(0));
|
||||
}
|
||||
// 给所有最小值的麦位,带便便
|
||||
if (mins.size() > 0) {
|
||||
int[] ws = new int[mins.size()];
|
||||
for (int i = 0; i < ws.length; i++) { ws[i] = mins.get(i); }
|
||||
// showWheatMaoziBianbian(ws);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAmativenessMaleWheatMaoziState(int[] cvs) {
|
||||
int max = -999999999;
|
||||
List<Integer> maxs = new ArrayList<>();
|
||||
// 找出最大值
|
||||
for (int v : cvs) {
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v >= max) {
|
||||
max = v;
|
||||
}
|
||||
}
|
||||
// 找出最大值的麦位
|
||||
for (int i = 0; i < cvs.length; i++) {
|
||||
int v = cvs[i];
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v == max) { maxs.add(i); }
|
||||
}
|
||||
// 获得男生第一帽子等级
|
||||
if (maxs.size() > 0) {
|
||||
int level = getAmativenessWheatMaoziLevel(max);
|
||||
if (level > 0) showAmativenessMaleWheatMaozi(maxs.get(0), level);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAmativenessFemaleWheatMaoziState(int[] cvs) {
|
||||
int max = -999999999;
|
||||
List<Integer> maxs = new ArrayList<>();
|
||||
// 找出最大值
|
||||
for (int v : cvs) {
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v >= max) {
|
||||
max = v;
|
||||
}
|
||||
}
|
||||
// 找出最大值的麦位
|
||||
for (int i = 0; i < cvs.length; i++) {
|
||||
int v = cvs[i];
|
||||
if (v < 0) continue; // 小于0的麦位表示麦位没人
|
||||
if (v == max) { maxs.add(i); }
|
||||
}
|
||||
// 获得女生第一帽子等级
|
||||
if (maxs.size() > 0) {
|
||||
int level = getAmativenessWheatMaoziLevel(max);
|
||||
if (level > 0) showAmativenessFemaleWheatMaozi(maxs.get(0), level);
|
||||
}
|
||||
}
|
||||
|
||||
private int getAmativenessWheatMaoziLevel(int value) {
|
||||
if (value >= 52000) {
|
||||
return 3;
|
||||
} else if (value >= 10000) {
|
||||
return 2;
|
||||
} else if (value >= 1000) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
public class BaseRoomPresenter<V extends IView> extends BasePresenter<V> implements BaseRoomContacts.IBaseRoomPre {
|
||||
|
||||
public BaseRoomPresenter(V view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downWheat(String roomId) {
|
||||
// ApiClient.getInstance().downWheat(roomId, new BaseObserver<String>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(String s) {
|
||||
//// getRoomInfo(roomId);
|
||||
// EventBus.getDefault().post(new UserDownWheatEvent());
|
||||
// RtcManager.getInstance().downWheat();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyWheat(String roomId, String pitNumber) {
|
||||
// ApiClient.getInstance().applyWheat(roomId, pitNumber, new BaseObserver<String>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(String s) {
|
||||
//// getRoomInfo(roomId);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyWheatWait(String roomId, String pitNumber) {
|
||||
// ApiClient.getInstance().applyWheatWait(roomId, pitNumber, new BaseObserver<ApplyWheatWaitResp>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(ApplyWheatWaitResp applyWheatWaitResp) {
|
||||
// if (applyWheatWaitResp != null && !applyWheatWaitResp.getState().equals("1")) {
|
||||
// EventBus.getDefault().post(new ApplyWaitEvent(true, pitNumber));
|
||||
//// ToastUtils.show("申请成功");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRoomInfo(String roomId, String password) {
|
||||
|
||||
// NewApi.getInstance().roomInfo(roomId, password, new com.qpyy.libcommon.api.BaseObserver<RoomInfoResp>() {
|
||||
//// NewApi.getInstance().roomGetIn(roomId, password, new com.qpyy.libcommon.api.BaseObserver<RoomInfoResp>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(RoomInfoResp roomInfoResp) {
|
||||
// if (roomInfoResp.getRejoin() == 1) {
|
||||
// UserBean userBean = BaseApplication.getInstance().getUser();
|
||||
// Config config = null;
|
||||
// if (!ObjectUtils.isEmpty(roomInfoResp.getRoom_info().getSound_effect())) {
|
||||
// config = roomInfoResp.getRoom_info().getSound_effect().getConfig();
|
||||
// }
|
||||
// RtcManager.getInstance().destroyAndLogin(RtcConstants.RtcType_CURR, roomInfoResp.getRoom_info().getSceneId(), config, roomId, userBean.getUser_id(), userBean.getNickname(), "", new RtcDestroyCallback() {
|
||||
// @Override
|
||||
// public void onDestroySuccess() {
|
||||
// if (roomInfoResp.isOnWheat()) {//在麦位上就恢复麦克风状态
|
||||
// RtcManager.getInstance().applyWheat(String.format("%s_%s", roomId, SpUtils.getUserId()));
|
||||
// } else {//否则停止推流
|
||||
// RtcManager.getInstance().downWheat();
|
||||
// }
|
||||
// RtcManager.getInstance().resumeAudio();
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// if (roomInfoResp.isOnWheat()) {//在麦位上就恢复麦克风状态
|
||||
// RtcManager.getInstance().resumeMic();
|
||||
// } else {//否则停止推流
|
||||
// RtcManager.getInstance().downWheat();
|
||||
// }
|
||||
// }
|
||||
// EventBus.getDefault().post(roomInfoResp);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e) {
|
||||
// super.onError(e);
|
||||
// if (e instanceof APIException) {
|
||||
// EventBus.getDefault().post(new RoomOutEvent());
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putOnWheat(String roomId, String userId,String pitNum) {
|
||||
MvpRef.get().showLoadings();
|
||||
// ApiClient.getInstance().putOnWheat(roomId, userId,pitNum, new BaseObserver<PutOnWheatResp>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(PutOnWheatResp s) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// MvpRef.get().disLoadings();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.Signature;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.Base64;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.AppUtils;
|
||||
import com.blankj.utilcode.util.FileUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ProcessUtils;
|
||||
import com.blankj.utilcode.util.ServiceUtils;
|
||||
import com.lahm.library.EasyProtectorLib;
|
||||
import com.lahm.library.EmulatorCheckCallback;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.event.AppLifecycleEvent;
|
||||
import com.xscm.moduleutil.interfaces.AppLifecycleUtil;
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.service.MyMqttService;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.UtilConfig;
|
||||
import com.xscm.moduleutil.utils.config.EnvironmentEnum;
|
||||
import com.xscm.moduleutil.utils.config.EnvironmentPrefs;
|
||||
import com.xscm.moduleutil.widget.CommonAppConfig;
|
||||
import com.xscm.moduleutil.widget.PiaoPingManager;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator;
|
||||
import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshFooter;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshHeader;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
|
||||
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.tencent.qcloud.tuicore.TUILogin;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/3.
|
||||
*/
|
||||
|
||||
public class CommonAppContext extends MultiDexApplication {
|
||||
|
||||
private static CommonAppContext sInstance;
|
||||
private static Handler sMainThreadHandler;
|
||||
private int mCount;
|
||||
private boolean mFront;//是否前台
|
||||
public String emulator = "0";
|
||||
@Getter
|
||||
private EnvironmentEnum currentEnvironment;
|
||||
public UserBean mUserBean;
|
||||
|
||||
public boolean isShow;
|
||||
public boolean isPlaying;
|
||||
|
||||
public String playId;
|
||||
public String playCover;
|
||||
public boolean showSelf;//盲盒是否能送自己
|
||||
public String playName;
|
||||
private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);
|
||||
private ScheduledExecutorService scheduledExecutorServiceRoom = null;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
sInstance = this;
|
||||
sMainThreadHandler = new Handler();
|
||||
EnvironmentPrefs prefs = new EnvironmentPrefs(this);
|
||||
currentEnvironment = prefs.getSelectedEnvironment();
|
||||
initialization();
|
||||
piaoPingManager = PiaoPingManager.getInstance(this);
|
||||
|
||||
}
|
||||
|
||||
public void initialization(){
|
||||
UtilConfig.init(this);
|
||||
registerActivityLifecycleCallbacks();
|
||||
initWebView();
|
||||
if (ProcessUtils.isMainProcess()) {
|
||||
initARouter();
|
||||
if (SpUtil.isAgreePolicy()) {
|
||||
checkInEmulator();
|
||||
UtilConfig.checkInEmulator();
|
||||
AgoraManager.getInstance(this).init(currentEnvironment.getSwSdkAppId());
|
||||
MessageListenerSingleton.getInstance();
|
||||
CrashReport.initCrashReport(this, "ac3ed4d89f", true);/*bugly初始化*/
|
||||
ServiceUtils.startService(MyMqttService.class);/*Mqtt初始化*/
|
||||
// 每次启动应用时重置状态
|
||||
SpUtil.getInstance().setBooleanValue("youth_model_shown", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private PiaoPingManager piaoPingManager;
|
||||
|
||||
private void initARouter() {
|
||||
if (true) {
|
||||
ARouter.openDebug();
|
||||
ARouter.openLog();
|
||||
}
|
||||
ARouter.init(this);
|
||||
|
||||
}
|
||||
|
||||
private void initWebView() {
|
||||
//Android P 以及之后版本不支持同时从多个进程使用具有相同数据目录的WebView
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
String processName = getProcessName(this);
|
||||
if (!AppUtils.getAppPackageName().equals(processName)) {//判断不等于默认进程名称
|
||||
WebView.setDataDirectorySuffix(processName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getProcessName(Context context) {
|
||||
if (context == null) return null;
|
||||
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) {
|
||||
if (processInfo.pid == android.os.Process.myPid()) {
|
||||
return processInfo.processName;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
MultiDex.install(this);
|
||||
super.attachBaseContext(base);
|
||||
}
|
||||
|
||||
public static CommonAppContext getInstance() {
|
||||
if (sInstance == null) {
|
||||
try {
|
||||
Class clazz = Class.forName("android.app.ActivityThread");
|
||||
Method method = clazz.getMethod("currentApplication", new Class[]{});
|
||||
Object obj = method.invoke(null, new Object[]{});
|
||||
if (obj != null && obj instanceof CommonAppContext) {
|
||||
sInstance = (CommonAppContext) obj;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void checkInEmulator() {
|
||||
emulator = EasyProtectorLib.checkIsRunningInEmulator(this, new EmulatorCheckCallback() {
|
||||
@Override
|
||||
public void findEmulator(String emulatorInfo) {
|
||||
// Logger.e(emulatorInfo);
|
||||
}
|
||||
}) ? "1" : "0";
|
||||
}
|
||||
|
||||
public static void postDelayed(Runnable runnable, long delayMillis) {
|
||||
if (sMainThreadHandler != null) {
|
||||
sMainThreadHandler.postDelayed(runnable, delayMillis);
|
||||
}
|
||||
}
|
||||
|
||||
public static void post(Runnable runnable) {
|
||||
if (sMainThreadHandler != null) {
|
||||
sMainThreadHandler.post(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return SpUtil.getToken();
|
||||
}
|
||||
|
||||
private void registerActivityLifecycleCallbacks() {
|
||||
registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
|
||||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
mCount++;
|
||||
if (!mFront) {
|
||||
mFront = true;
|
||||
LogUtils.e("AppContext------->处于前台");
|
||||
EventBus.getDefault().post(new AppLifecycleEvent(true));
|
||||
CommonAppConfig.getInstance().setFrontGround(true);
|
||||
// FloatWindowHelper.setFloatWindowVisible(true);
|
||||
AppLifecycleUtil.onAppFrontGround();
|
||||
// 确保在主线程中订阅
|
||||
if (activity != null && !activity.isFinishing()) {
|
||||
activity.runOnUiThread(() -> {
|
||||
if (piaoPingManager != null) {
|
||||
piaoPingManager.subscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity) {
|
||||
mCount--;
|
||||
if (mCount == 0) {
|
||||
mFront = false;
|
||||
LogUtils.e("AppContext------->处于后台");
|
||||
EventBus.getDefault().post(new AppLifecycleEvent(false));
|
||||
CommonAppConfig.getInstance().setFrontGround(false);
|
||||
// FloatWindowHelper.setFloatWindowVisible(false);
|
||||
AppLifecycleUtil.onAppBackGround();
|
||||
if (activity != null && !activity.isFinishing()) {
|
||||
activity.runOnUiThread(() -> {
|
||||
if (piaoPingManager != null) {
|
||||
piaoPingManager.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取App签名md5值
|
||||
*/
|
||||
public String getAppSignature() {
|
||||
try {
|
||||
PackageInfo info =
|
||||
this.getPackageManager().getPackageInfo(this.getPackageName(),
|
||||
PackageManager.GET_SIGNATURES);
|
||||
if (info != null) {
|
||||
Signature[] signs = info.signatures;
|
||||
byte[] bytes = signs[0].toByteArray();
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
md.update(bytes);
|
||||
bytes = md.digest();
|
||||
StringBuilder stringBuilder = new StringBuilder(2 * bytes.length);
|
||||
for (int i = 0; ; i++) {
|
||||
if (i >= bytes.length) {
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
String str = Integer.toString(0xFF & bytes[i], 16);
|
||||
if (str.length() == 1) {
|
||||
str = "0" + str;
|
||||
}
|
||||
stringBuilder.append(str);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取facebook散列秘钥
|
||||
*/
|
||||
public String getFacebookHashKey() {
|
||||
try {
|
||||
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
|
||||
for (Signature signature : info.signatures) {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA");
|
||||
md.update(signature.toByteArray());
|
||||
return Base64.encodeToString(md.digest(), Base64.DEFAULT);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return "get error";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isFront() {
|
||||
return mFront;
|
||||
}
|
||||
|
||||
public void startInitSdk() {
|
||||
UserBean userBean = SpUtil.getUserBean();
|
||||
if (userBean != null) {
|
||||
// 在用户 UI 点击登录的时候调用
|
||||
TUILogin.login(getBaseContext(), CommonAppContext.getInstance().getCurrentEnvironment().getSdkAppId(), "u" + userBean.getUser_id(), userBean.getTencent_im(), new TUICallback() {
|
||||
@Override
|
||||
public void onError(final int code, final String desc) {
|
||||
LogUtils.e("@@@1", code, "描述:", desc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtils.e("@@@", "成功");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void setUser(UserBean userBean) {
|
||||
mUserBean = userBean;
|
||||
SpUtil.saveUserId(userBean.getUser_id());
|
||||
SpUtil.saveUserBean(userBean);
|
||||
SpUtil.putToken(userBean.getToken());
|
||||
}
|
||||
|
||||
public UserBean getUser() {
|
||||
if (mUserBean == null) {
|
||||
mUserBean = SpUtil.getUserBean();
|
||||
}
|
||||
return mUserBean;
|
||||
}
|
||||
|
||||
public void setUserBean(UserBean bean) {
|
||||
mUserBean = bean;
|
||||
}
|
||||
|
||||
public void clearLoginInfo() throws ClassNotFoundException {
|
||||
// mUid = null;
|
||||
// mToken = null;
|
||||
// SpUtil.getInstance().removeValue(
|
||||
// SPConstants.USER_ID, SPConstants.TOKEN, SPConstants.USER_INFO
|
||||
// );
|
||||
isShow = false;
|
||||
isPlaying = false;
|
||||
mUserBean = null;
|
||||
SpUtil.saveUserId(-1);
|
||||
SpUtil.saveUserBean(new UserBean());
|
||||
SpUtil.putToken("");
|
||||
Intent intent = new Intent("com.example.action.LAUNCH_PAGE");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getApplicationContext().startActivity(intent);
|
||||
// piaoPingManager.unsubscribe();
|
||||
FileUtils.deleteAllInDir(getCacheDir());
|
||||
FileUtils.deleteAllInDir(getExternalCacheDir());
|
||||
AgoraManager.getInstance(getApplicationContext()).destroy();
|
||||
// 每次启动应用时重置状态
|
||||
SpUtil.setBooleanValue("youth_model_shown", false);
|
||||
|
||||
// 发送广播通知所有Activity刷新状态
|
||||
Intent refreshIntent = new Intent("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
sendBroadcast(refreshIntent);
|
||||
|
||||
}
|
||||
|
||||
public static boolean isAlipayInstalled(Context context) {
|
||||
try {
|
||||
context.getPackageManager().getPackageInfo("com.eg.android.AlipayGphone", 0);
|
||||
return true;//安装了支付宝
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return false; //未安装支付宝
|
||||
}
|
||||
}
|
||||
|
||||
//static 代码段可以防止内存泄露
|
||||
static {
|
||||
//设置全局的Header构建器
|
||||
SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() {
|
||||
@Override
|
||||
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
|
||||
ClassicsHeader header = new ClassicsHeader(context);
|
||||
header.setDrawableSize(20);
|
||||
header.setFinishDuration(0);
|
||||
return header;//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
||||
// return new CustomRefreshHeader(context);//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
|
||||
}
|
||||
});
|
||||
//设置全局的Footer构建器
|
||||
SmartRefreshLayout.setDefaultRefreshFooterCreator(new DefaultRefreshFooterCreator() {
|
||||
@Override
|
||||
public RefreshFooter createRefreshFooter(Context context, RefreshLayout layout) {
|
||||
ClassicsFooter classicsFooter = new ClassicsFooter(context);
|
||||
classicsFooter.setDrawableSize(20);
|
||||
classicsFooter.setFinishDuration(0);
|
||||
//指定为经典Footer,默认是 BallPulseFooter
|
||||
return classicsFooter;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xscm.moduleutil.base;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomRollModel {
|
||||
private String room_id;
|
||||
private String user_id;
|
||||
private String pit_number;
|
||||
private int number;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/29
|
||||
*@description: 相册列表
|
||||
*/
|
||||
@Data
|
||||
public class AlbumBean implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String id;//相册id
|
||||
|
||||
private String name; //相册名称
|
||||
|
||||
private String image; //相册封面
|
||||
|
||||
private String pwd; //相册密码
|
||||
|
||||
private String read_num; //相册阅读数
|
||||
private String is_pwd;
|
||||
private String is_like;//是否点赞
|
||||
private String like_num;//点赞数
|
||||
private String count;//图片数量
|
||||
private String user_id;
|
||||
|
||||
private List<ImageList> image_list;
|
||||
@Data
|
||||
public static class ImageList implements MultiItemEntity , Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String id; //图片id
|
||||
private String image; //图片地址
|
||||
private String content; //图片描述
|
||||
private String createtime; //图片创建时间
|
||||
private boolean isSelected; // 用于标记是否被选中
|
||||
private int itemViewType = 1;
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return itemViewType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/11
|
||||
*@description:支付的时候,返回的参数
|
||||
*/
|
||||
@Data
|
||||
public class AppPay {
|
||||
private String ali;
|
||||
private WxBean wx;
|
||||
|
||||
@Data
|
||||
public static class WxBean {
|
||||
private String appid;
|
||||
private String noncestr;
|
||||
private String partnerid;
|
||||
private String prepayid;
|
||||
private String timestamp;
|
||||
private String sign;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author $
|
||||
* @Time $ $
|
||||
* @Description $ 版本更新信息模型
|
||||
*/
|
||||
@Data
|
||||
public class AppUpdateModel {
|
||||
private int id;
|
||||
private String version;//当前版本号
|
||||
private String url;//下载地址
|
||||
private String content;//更新内容
|
||||
private String is_force;//是否强制更新
|
||||
private String apiversion;//API版本号
|
||||
private int code;//状态码
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
public class AttentionResp {
|
||||
|
||||
private String room_id;
|
||||
private String room_name;
|
||||
private String room_code;
|
||||
private String popularity;
|
||||
private String label_name;
|
||||
private String label_icon;
|
||||
private String owner_picture;
|
||||
private String owner_nickname;
|
||||
private int locked;
|
||||
|
||||
private String label_id;
|
||||
|
||||
public String getLabel_id() {
|
||||
return label_id;
|
||||
}
|
||||
|
||||
public void setLabel_id(String label_id) {
|
||||
this.label_id = label_id;
|
||||
}
|
||||
private String cover_picture;
|
||||
|
||||
public String getRoomPicture() {
|
||||
if (!TextUtils.isEmpty(cover_picture)) {
|
||||
return cover_picture;
|
||||
}
|
||||
return owner_picture;
|
||||
}
|
||||
|
||||
public String getCover_picture() {
|
||||
return cover_picture;
|
||||
}
|
||||
|
||||
public void setCover_picture(String cover_picture) {
|
||||
this.cover_picture = cover_picture;
|
||||
}
|
||||
|
||||
public int getLocked() {
|
||||
return locked;
|
||||
}
|
||||
|
||||
public void setLocked(int locked) {
|
||||
this.locked = locked;
|
||||
}
|
||||
|
||||
public String getRoom_id() {
|
||||
return room_id;
|
||||
}
|
||||
|
||||
public void setRoom_id(String room_id) {
|
||||
this.room_id = room_id;
|
||||
}
|
||||
|
||||
public String getRoom_name() {
|
||||
return room_name;
|
||||
}
|
||||
|
||||
public void setRoom_name(String room_name) {
|
||||
this.room_name = room_name;
|
||||
}
|
||||
|
||||
public String getRoom_code() {
|
||||
return room_code;
|
||||
}
|
||||
|
||||
public void setRoom_code(String room_code) {
|
||||
this.room_code = room_code;
|
||||
}
|
||||
|
||||
public String getPopularity() {
|
||||
return popularity;
|
||||
}
|
||||
|
||||
public void setPopularity(String popularity) {
|
||||
this.popularity = popularity;
|
||||
}
|
||||
|
||||
public String getLabel_name() {
|
||||
return label_name;
|
||||
}
|
||||
|
||||
public void setLabel_name(String label_name) {
|
||||
this.label_name = label_name;
|
||||
}
|
||||
|
||||
public String getLabel_icon() {
|
||||
return label_icon;
|
||||
}
|
||||
|
||||
public void setLabel_icon(String label_icon) {
|
||||
this.label_icon = label_icon;
|
||||
}
|
||||
|
||||
public String getOwner_picture() {
|
||||
return owner_picture;
|
||||
}
|
||||
|
||||
public void setOwner_picture(String owner_picture) {
|
||||
this.owner_picture = owner_picture;
|
||||
}
|
||||
|
||||
public String getOwner_nickname() {
|
||||
return owner_nickname;
|
||||
}
|
||||
|
||||
public void setOwner_nickname(String owner_nickname) {
|
||||
this.owner_nickname = owner_nickname;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.stx.xhb.xbanner.entity.SimpleBannerInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class BannerModel extends SimpleBannerInfo {
|
||||
|
||||
|
||||
/**
|
||||
* ad_id : 11
|
||||
* type : 2
|
||||
* title : 鱼糖语音·开服送好礼
|
||||
* item_id : 9
|
||||
* link_url : null
|
||||
* content : https://gudao-prod.oss-cn-hangzhou.aliyuncs.com/user-dir/YZrsGTJR5F.jpg
|
||||
* detail_pictures : null
|
||||
*/
|
||||
|
||||
private String bid;
|
||||
private String aid;
|
||||
private String type;
|
||||
private String show_type;
|
||||
private String image;
|
||||
private String url;
|
||||
private ArrayList<String> detail_pictures;
|
||||
|
||||
|
||||
@Override
|
||||
public Object getXBannerUrl() {
|
||||
return image;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BaseListData<T> {
|
||||
private List<T> data;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/7/11
|
||||
* @description:支付或者提现方式和状态
|
||||
*/
|
||||
@Data
|
||||
public class BindType {
|
||||
private AllData ali;
|
||||
private AllData wx;
|
||||
private AllData bank;
|
||||
private AllData ali_tl;
|
||||
private AllData wx_tl;
|
||||
|
||||
|
||||
@Data
|
||||
public static class AllData {
|
||||
private String name;//名称
|
||||
private String icon;//图标
|
||||
private String is_with_draw_open;//提现状态是否打开
|
||||
private String is_bind;//是否绑定 1是 0否
|
||||
private String type;// 支付 | 提现类型
|
||||
private String is_pay_open;//是否开启 1是 0否
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BlackUserBean {
|
||||
|
||||
private int type;//0:关注;1:黑名单;2:粉丝
|
||||
private int status;//0:未关注 1:已关注
|
||||
private int user_id;
|
||||
private String createTime;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private int sex;
|
||||
private String user_code;
|
||||
private int is_online;
|
||||
private int is_follow;
|
||||
private List<String> icon;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/16
|
||||
*@description: 房间排行榜
|
||||
*/
|
||||
@Data
|
||||
public class CharmRankingResp {
|
||||
private String user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private List<String> icon;
|
||||
private String total;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
public class CheckTxtResp {
|
||||
|
||||
|
||||
private int result;
|
||||
|
||||
public int getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(int result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/6/3
|
||||
* @description: 这是广场中的列表数据
|
||||
*/
|
||||
@Data
|
||||
public class CircleListBean {
|
||||
private int id;//语圈ID
|
||||
private int user_id;//用户ID
|
||||
private String nickname;//用户昵称
|
||||
private String avatar;//用户头像
|
||||
private int is_like;//我是否点赞(0没有,1点赞)
|
||||
private int sex;//性别 1男2女
|
||||
private String content;//内容
|
||||
private String like_num;//点赞数
|
||||
private String rewards_num; //打赏金额
|
||||
private String is_room;//作者是否在房间中(1在,0不在)
|
||||
private String room_id;//作者所在房间ID (is_room =0 此值小于0 )
|
||||
private String comment_num;//评论数
|
||||
private int is_recommend;//1非推荐2推荐
|
||||
private String ip;//活跃地址
|
||||
private String images;////图片 JSON字符串 封面获取第一张
|
||||
private String createtime;//时间
|
||||
private String topic_id;
|
||||
private String share_url;
|
||||
private List<HeatedBean> title;//话题列表
|
||||
|
||||
private String read_num;//阅读数
|
||||
private List<LikeList> like_list;
|
||||
|
||||
|
||||
@Data
|
||||
public class LikeList {
|
||||
private String user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private int age;//年龄
|
||||
private String sex;
|
||||
private String constellation;//星座
|
||||
private String birthday;//生日
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025-8-1 00:21:22$ $
|
||||
* @Description $
|
||||
*/
|
||||
@Data
|
||||
public class CombinedGiftBean {
|
||||
private int gift_id;
|
||||
private String gift_price;
|
||||
private String gift_name;
|
||||
private String base_image;
|
||||
private String total_count;
|
||||
private int top_users_count;
|
||||
private List<TopUsers> top_users;
|
||||
private boolean is_liang;
|
||||
|
||||
@Data
|
||||
public static class TopUsers {
|
||||
private int user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/30
|
||||
*@description:评论实体
|
||||
*/
|
||||
@Data
|
||||
public class CommentBean {
|
||||
|
||||
private int total;//评论总数
|
||||
private List<CommentDetailsBean> list;
|
||||
@Data
|
||||
public static class CommentDetailsBean {
|
||||
private int id;//评论ID
|
||||
private int zone_id;//动态ID
|
||||
private String content;//评论内容
|
||||
private int createtime;
|
||||
private int user_id;//评论者ID
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private int is_author;//评论者是否作者 0不是,1是
|
||||
private List<Replies> replies;
|
||||
|
||||
@Data
|
||||
public static class Replies {
|
||||
private int id;//评论ID
|
||||
private int zone_id;//动态ID
|
||||
private String content;
|
||||
private int createtime;
|
||||
private int user_id;//评论者ID
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private int pid;//上级评论的ID
|
||||
private int is_author;//评论者是否作者 0不是,1是
|
||||
private int reply_to;//回复给谁的ID
|
||||
private String reply_to_user;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,428 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/5.
|
||||
*/
|
||||
|
||||
public class ConfigBean {
|
||||
private String version;//Android apk安装包 版本号
|
||||
private String downloadApkUrl;//Android apk安装包 下载地址
|
||||
private String updateDes;//版本更新描述
|
||||
private String liveWxShareUrl;//直播间微信分享地址
|
||||
private String liveShareTitle;//直播间分享标题
|
||||
private String liveShareDes;//直播间分享描述
|
||||
private String videoShareTitle;//短视频分享标题
|
||||
private String videoShareDes;//短视频分享描述
|
||||
private int videoAuditSwitch;//短视频审核是否开启
|
||||
private int videoCloudType;//短视频云储存类型 1七牛云 2腾讯云
|
||||
private String videoQiNiuHost;//短视频七牛云域名
|
||||
private String txCosAppId;//腾讯云存储appId
|
||||
private String txCosRegion;//腾讯云存储区域
|
||||
private String txCosBucketName;//腾讯云存储桶名字
|
||||
private String txCosVideoPath;//腾讯云存储视频文件夹
|
||||
private String txCosImagePath;//腾讯云存储图片文件夹
|
||||
private String coinName;//钻石名称
|
||||
private String votesName;//映票名称
|
||||
private String scoreName;//积分名称
|
||||
private String[] liveTimeCoin;//直播间计时收费规则
|
||||
private String[] loginType;//三方登录类型
|
||||
private String[][] liveType;//直播间开播类型
|
||||
private String[] shareType;//分享类型
|
||||
// private List<LiveClassBean> liveClass;//直播分类
|
||||
private String videoClass;//短视频分类
|
||||
private int maintainSwitch;//维护开关
|
||||
private String maintainTips;//维护提示
|
||||
private String mAdInfo;//引导页 广告信息
|
||||
private int priMsgSwitch;//私信开关
|
||||
private int forceUpdate;//强制更新
|
||||
private String mWaterMarkUrl;//水印
|
||||
private String mShopSystemName;//商店名称
|
||||
|
||||
private String beautyAppId;//美颜鉴权AppId
|
||||
private String beautyKey;//美颜鉴权AppKey
|
||||
private int mOpenInstallSwitch;
|
||||
private String teenager_des;
|
||||
private int leaderboard_switch;
|
||||
private String mAgoraAppId;//声网appId
|
||||
|
||||
|
||||
@JSONField(name = "apk_ver")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_ver")
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_url")
|
||||
public String getDownloadApkUrl() {
|
||||
return downloadApkUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_url")
|
||||
public void setDownloadApkUrl(String downloadApkUrl) {
|
||||
this.downloadApkUrl = downloadApkUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_des")
|
||||
public String getUpdateDes() {
|
||||
return updateDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "apk_des")
|
||||
public void setUpdateDes(String updateDes) {
|
||||
this.updateDes = updateDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "wx_siteurl")
|
||||
public void setLiveWxShareUrl(String liveWxShareUrl) {
|
||||
this.liveWxShareUrl = liveWxShareUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "wx_siteurl")
|
||||
public String getLiveWxShareUrl() {
|
||||
return liveWxShareUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_title")
|
||||
public String getLiveShareTitle() {
|
||||
return liveShareTitle;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_title")
|
||||
public void setLiveShareTitle(String liveShareTitle) {
|
||||
this.liveShareTitle = liveShareTitle;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_des")
|
||||
public String getLiveShareDes() {
|
||||
return liveShareDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_des")
|
||||
public void setLiveShareDes(String liveShareDes) {
|
||||
this.liveShareDes = liveShareDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_coin")
|
||||
public String getCoinName() {
|
||||
return coinName;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_coin")
|
||||
public void setCoinName(String coinName) {
|
||||
this.coinName = coinName;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_score")
|
||||
public String getScoreName() {
|
||||
return scoreName;
|
||||
}
|
||||
@JSONField(name = "name_score")
|
||||
public void setScoreName(String scoreName) {
|
||||
this.scoreName = scoreName;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_votes")
|
||||
public String getVotesName() {
|
||||
return votesName;
|
||||
}
|
||||
|
||||
@JSONField(name = "name_votes")
|
||||
public void setVotesName(String votesName) {
|
||||
this.votesName = votesName;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_time_coin")
|
||||
public String[] getLiveTimeCoin() {
|
||||
return liveTimeCoin;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_time_coin")
|
||||
public void setLiveTimeCoin(String[] liveTimeCoin) {
|
||||
this.liveTimeCoin = liveTimeCoin;
|
||||
}
|
||||
|
||||
@JSONField(name = "login_type")
|
||||
public String[] getLoginType() {
|
||||
return loginType;
|
||||
}
|
||||
|
||||
@JSONField(name = "login_type")
|
||||
public void setLoginType(String[] loginType) {
|
||||
this.loginType = loginType;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_type")
|
||||
public String[][] getLiveType() {
|
||||
return liveType;
|
||||
}
|
||||
|
||||
@JSONField(name = "live_type")
|
||||
public void setLiveType(String[][] liveType) {
|
||||
this.liveType = liveType;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_type")
|
||||
public String[] getShareType() {
|
||||
return shareType;
|
||||
}
|
||||
|
||||
@JSONField(name = "share_type")
|
||||
public void setShareType(String[] shareType) {
|
||||
this.shareType = shareType;
|
||||
}
|
||||
|
||||
// @JSONField(name = "liveclass")
|
||||
// public List<LiveClassBean> getLiveClass() {
|
||||
// return liveClass;
|
||||
// }
|
||||
//
|
||||
// @JSONField(name = "liveclass")
|
||||
// public void setLiveClass(List<LiveClassBean> liveClass) {
|
||||
// this.liveClass = liveClass;
|
||||
// }
|
||||
|
||||
|
||||
@JSONField(name = "videoclass")
|
||||
public String getVideoClass() {
|
||||
return videoClass;
|
||||
}
|
||||
|
||||
@JSONField(name = "videoclass")
|
||||
public void setVideoClass(String videoClass) {
|
||||
this.videoClass = videoClass;
|
||||
}
|
||||
|
||||
@JSONField(name = "maintain_switch")
|
||||
public int getMaintainSwitch() {
|
||||
return maintainSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "maintain_switch")
|
||||
public void setMaintainSwitch(int maintainSwitch) {
|
||||
this.maintainSwitch = maintainSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "maintain_tips")
|
||||
public String getMaintainTips() {
|
||||
return maintainTips;
|
||||
}
|
||||
|
||||
@JSONField(name = "maintain_tips")
|
||||
public void setMaintainTips(String maintainTips) {
|
||||
this.maintainTips = maintainTips;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_appid")
|
||||
public String getBeautyAppId() {
|
||||
return beautyAppId;
|
||||
}
|
||||
@JSONField(name = "sprout_appid")
|
||||
public void setBeautyAppId(String beautyAppId) {
|
||||
this.beautyAppId = beautyAppId;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_key")
|
||||
public String getBeautyKey() {
|
||||
return beautyKey;
|
||||
}
|
||||
|
||||
@JSONField(name = "sprout_key")
|
||||
public void setBeautyKey(String beautyKey) {
|
||||
this.beautyKey = beautyKey;
|
||||
}
|
||||
|
||||
|
||||
public String[] getVideoShareTypes() {
|
||||
return shareType;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_share_title")
|
||||
public String getVideoShareTitle() {
|
||||
return videoShareTitle;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_share_title")
|
||||
public void setVideoShareTitle(String videoShareTitle) {
|
||||
this.videoShareTitle = videoShareTitle;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_share_des")
|
||||
public String getVideoShareDes() {
|
||||
return videoShareDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_share_des")
|
||||
public void setVideoShareDes(String videoShareDes) {
|
||||
this.videoShareDes = videoShareDes;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_audit_switch")
|
||||
public int getVideoAuditSwitch() {
|
||||
return videoAuditSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_audit_switch")
|
||||
public void setVideoAuditSwitch(int videoAuditSwitch) {
|
||||
this.videoAuditSwitch = videoAuditSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "cloudtype")
|
||||
public int getVideoCloudType() {
|
||||
return videoCloudType;
|
||||
}
|
||||
|
||||
@JSONField(name = "cloudtype")
|
||||
public void setVideoCloudType(int videoCloudType) {
|
||||
this.videoCloudType = videoCloudType;
|
||||
}
|
||||
|
||||
@JSONField(name = "qiniu_domain")
|
||||
public String getVideoQiNiuHost() {
|
||||
return videoQiNiuHost;
|
||||
}
|
||||
|
||||
@JSONField(name = "qiniu_domain")
|
||||
public void setVideoQiNiuHost(String videoQiNiuHost) {
|
||||
this.videoQiNiuHost = videoQiNiuHost;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_appid")
|
||||
public String getTxCosAppId() {
|
||||
return txCosAppId;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_appid")
|
||||
public void setTxCosAppId(String txCosAppId) {
|
||||
this.txCosAppId = txCosAppId;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_region")
|
||||
public String getTxCosRegion() {
|
||||
return txCosRegion;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_region")
|
||||
public void setTxCosRegion(String txCosRegion) {
|
||||
this.txCosRegion = txCosRegion;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_bucket")
|
||||
public String getTxCosBucketName() {
|
||||
return txCosBucketName;
|
||||
}
|
||||
|
||||
@JSONField(name = "txcloud_bucket")
|
||||
public void setTxCosBucketName(String txCosBucketName) {
|
||||
this.txCosBucketName = txCosBucketName;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_watermark")
|
||||
public String getWaterMarkUrl() {
|
||||
return mWaterMarkUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "video_watermark")
|
||||
public void setWaterMarkUrl(String waterMarkUrl) {
|
||||
mWaterMarkUrl = waterMarkUrl;
|
||||
}
|
||||
|
||||
@JSONField(name = "txvideofolder")
|
||||
public String getTxCosVideoPath() {
|
||||
return txCosVideoPath;
|
||||
}
|
||||
|
||||
@JSONField(name = "txvideofolder")
|
||||
public void setTxCosVideoPath(String txCosVideoPath) {
|
||||
this.txCosVideoPath = txCosVideoPath;
|
||||
}
|
||||
|
||||
@JSONField(name = "tximgfolder")
|
||||
public String getTxCosImagePath() {
|
||||
return txCosImagePath;
|
||||
}
|
||||
|
||||
@JSONField(name = "tximgfolder")
|
||||
public void setTxCosImagePath(String txCosImagePath) {
|
||||
this.txCosImagePath = txCosImagePath;
|
||||
}
|
||||
|
||||
@JSONField(name = "guide")
|
||||
public String getAdInfo() {
|
||||
return mAdInfo;
|
||||
}
|
||||
|
||||
@JSONField(name = "guide")
|
||||
public void setAdInfo(String adInfo) {
|
||||
mAdInfo = adInfo;
|
||||
}
|
||||
|
||||
@JSONField(name = "letter_switch")
|
||||
public int getPriMsgSwitch() {
|
||||
return priMsgSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "letter_switch")
|
||||
public void setPriMsgSwitch(int priMsgSwitch) {
|
||||
this.priMsgSwitch = priMsgSwitch;
|
||||
}
|
||||
|
||||
@JSONField(name = "isup")
|
||||
public int getForceUpdate() {
|
||||
return forceUpdate;
|
||||
}
|
||||
|
||||
@JSONField(name = "isup")
|
||||
public void setForceUpdate(int forceUpdate) {
|
||||
this.forceUpdate = forceUpdate;
|
||||
}
|
||||
|
||||
|
||||
@JSONField(name = "shop_system_name")
|
||||
public String getShopSystemName() {
|
||||
return mShopSystemName;
|
||||
}
|
||||
@JSONField(name = "shop_system_name")
|
||||
public void setShopSystemName(String shopSystemName) {
|
||||
mShopSystemName = shopSystemName;
|
||||
}
|
||||
|
||||
@JSONField(name = "openinstall_switch")
|
||||
public int getOpenInstallSwitch() {
|
||||
return mOpenInstallSwitch;
|
||||
}
|
||||
@JSONField(name = "openinstall_switch")
|
||||
public void setOpenInstallSwitch(int openInstallSwitch) {
|
||||
mOpenInstallSwitch = openInstallSwitch;
|
||||
}
|
||||
|
||||
|
||||
public String getTeenager_des() {
|
||||
return teenager_des;
|
||||
}
|
||||
|
||||
public void setTeenager_des(String teenager_des) {
|
||||
this.teenager_des = teenager_des;
|
||||
}
|
||||
|
||||
public int getLeaderboard_switch() {
|
||||
return leaderboard_switch;
|
||||
}
|
||||
|
||||
public void setLeaderboard_switch(int leaderboard_switch) {
|
||||
this.leaderboard_switch = leaderboard_switch;
|
||||
}
|
||||
@JSONField(name = "sw_app_id")
|
||||
public String getAgoraAppId() {
|
||||
return mAgoraAppId;
|
||||
}
|
||||
@JSONField(name = "sw_app_id")
|
||||
public void setAgoraAppId(String agoraAppId) {
|
||||
mAgoraAppId = agoraAppId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigThemeBean {
|
||||
// 普通字体黑色 default is # 000000
|
||||
private String textColor;
|
||||
// 主题色 default is # 0dffb9
|
||||
private String themeColor;
|
||||
// 提示字体颜色 default is #9b9b9b
|
||||
private String placehoulderTextColor;
|
||||
// 按钮字体颜色 default is #333333
|
||||
private String btnTextColor;
|
||||
// 背景图片 default is green
|
||||
private String backgroundImage;
|
||||
// 底部工具栏
|
||||
// @property (nonatomic,strong)NSArray <QXTabbarModel*>*tabbarArray;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.widget.picker.PickerView;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DateBean implements PickerView.PickerItem {
|
||||
|
||||
private String text;
|
||||
private int date;
|
||||
|
||||
public DateBean(String text, int date) {
|
||||
this.text = text;
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public int getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(int date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DateBean{" +
|
||||
"text='" + text + '\'' +
|
||||
", date=" + date +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/29
|
||||
*@description: 扩列数据
|
||||
*/
|
||||
@Data
|
||||
public class ExpandColumnBean {
|
||||
private String user_id;
|
||||
private String sex;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String birthday;
|
||||
private String loginip;
|
||||
private String home_bgimages;
|
||||
private int room_id;//房间id,当有参数的时候,就显示跟随,当没有的时候,就显示私信控件
|
||||
private String agree;
|
||||
private List<String> icon;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
public class FaceBean {
|
||||
|
||||
|
||||
/**
|
||||
* number : 0
|
||||
* face_spectial : https://gudao-prod.oss-cn-hangzhou.aliyuncs.com/user-dir/N4WsWKm4pS.gif
|
||||
* pit : 9
|
||||
* type : 1
|
||||
*/
|
||||
|
||||
private int number;
|
||||
private String face_spectial;
|
||||
private String pit;
|
||||
private int type;
|
||||
private int millTime;
|
||||
|
||||
public FaceBean(int number, int type) {
|
||||
this.number = number;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public FaceBean() {
|
||||
}
|
||||
|
||||
public FaceBean(String face_spectial, double time, int type) {
|
||||
this.face_spectial = face_spectial;
|
||||
this.type = type;
|
||||
this.millTime = (int) (time * 1000);
|
||||
}
|
||||
|
||||
public int getMillTime() {
|
||||
return millTime;
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getFace_spectial() {
|
||||
return face_spectial;
|
||||
}
|
||||
|
||||
public void setFace_spectial(String face_spectial) {
|
||||
this.face_spectial = face_spectial;
|
||||
}
|
||||
|
||||
public String getPit() {
|
||||
return pit;
|
||||
}
|
||||
|
||||
public void setPit(String pit) {
|
||||
this.pit = pit;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025-8-2 09:13:25$ $
|
||||
* @Description 首页判断参数$
|
||||
*/
|
||||
@Data
|
||||
public class FirstChargeBean {
|
||||
private int permission;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025-8-2 10:46:27$ $
|
||||
* @Description 首充好礼列表$
|
||||
*/
|
||||
@Data
|
||||
public class FirstChargeGiftBean {
|
||||
private String name;
|
||||
private List<GiftBag> gift_bag;
|
||||
@Data
|
||||
public static class GiftBag {
|
||||
private String name;
|
||||
private String title1;
|
||||
private String title2;
|
||||
private String money;
|
||||
private List<RoonGiftModel> gift_list;
|
||||
|
||||
// @Data
|
||||
// public static class GiftList {
|
||||
// private String gift_name;
|
||||
// private int num;
|
||||
// private int gift_price;
|
||||
// private int type;
|
||||
// private String base_image;
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FromUserInfo {
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String user_id;
|
||||
private List<String> icon;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GiftBean {
|
||||
|
||||
private String gift_id;
|
||||
private String gift_name;
|
||||
private String gift_price;
|
||||
private int file_type;
|
||||
private String play_image;
|
||||
private String base_image;
|
||||
private String gift_type;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/27
|
||||
*@description: 礼盒数据
|
||||
*/
|
||||
@Data
|
||||
public class GiftBoxBean {
|
||||
private String user_gold;//累计获取的金币
|
||||
private List<GiftBean> gift_box_list;
|
||||
private TaskDataBean tasks;
|
||||
@Data
|
||||
public static class GiftBean {
|
||||
// private String giftName; //初级礼盒、高级礼盒
|
||||
// private String giftTitle; //最高可以获得的金币数
|
||||
// private String getGiftTypeName; //满多少个金币
|
||||
// private String giftTypeNumber; //当前的百分比
|
||||
// private String giftTypeStatus; //是否已经可以
|
||||
|
||||
private String id;//礼盒ID
|
||||
private String name;//礼盒名称
|
||||
private String title; //标题
|
||||
private String icon ;//图标
|
||||
private String highest_gain;//最高获得金币数
|
||||
private String meet;//满多少金币可抽
|
||||
private String unlock_progress;// //解锁进度
|
||||
private String all_number;// //今日可抽奖次数
|
||||
private String taday_number;////今日剩余抽奖次数
|
||||
private String taday_number_left;// //今日剩余抽奖次数
|
||||
private String status;////状态:0 '未解锁 1已解锁 2抽奖次数已用完
|
||||
private String status_str;//"已解锁(0/2)"
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class TaskDataBean {
|
||||
private List<DailyTasksBean> daily_tasks;
|
||||
private List<DailyTasksBean> daily_tasks_special;
|
||||
private List<DailyTasksBean> usual_tasks;
|
||||
|
||||
@Data
|
||||
public static class DailyTasksBean {
|
||||
private int task_id;////任务Id
|
||||
private String task_name;//任务名称
|
||||
private String icon;//图标
|
||||
private int gold_reward; //奖励金币
|
||||
private int target_quantity;//目标完成数量
|
||||
private int task_type;//任务类型 1每日任务 2每日特殊任务 3平台常规任务
|
||||
private int task_status;//任务状态:1完成 2去领取 3已领取
|
||||
private String task_type_str; //任务状态
|
||||
private int processing_type;//跳转状态:
|
||||
private String processing_type_str;//跳转状态
|
||||
private String from_id;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/12
|
||||
*@description: 礼盒记录
|
||||
*/
|
||||
@Data
|
||||
public class GiftBoxRecordBean {
|
||||
private String gift_bag_name;
|
||||
private String gift_name;
|
||||
private String createtime;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GiftLabelBean {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/12
|
||||
*@description: 开启礼盒后获取的礼物名称
|
||||
*/
|
||||
@Data
|
||||
public class GiftName {
|
||||
private String gift_name;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/30
|
||||
*@description: 礼物打赏数量
|
||||
*/
|
||||
public class GiftNumBean {
|
||||
private String number;
|
||||
private String text;
|
||||
|
||||
public GiftNumBean() {
|
||||
}
|
||||
|
||||
public GiftNumBean(String number, String text) {
|
||||
this.number = number;
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/12
|
||||
*@description: 获取背包礼物列表
|
||||
*/
|
||||
@Data
|
||||
public class GiftPackBean {
|
||||
private String gift_id;
|
||||
private String gift_name;
|
||||
private String base_image;
|
||||
private String gift_price;
|
||||
private String num;
|
||||
|
||||
private boolean isChecked;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time $ $
|
||||
* @Description $ 礼物墙展示接口
|
||||
*/
|
||||
@Data
|
||||
public class GiftUserWallBean {
|
||||
private List<GiftWallBean> liang;
|
||||
private List<GiftWallBean> no_liang;
|
||||
@Data
|
||||
public static class GiftWallBean {
|
||||
private int gift_id;
|
||||
private String gift_price;
|
||||
private String gift_name;
|
||||
private String base_image;
|
||||
private String total_count;
|
||||
private int top_users_count;
|
||||
private List<CombinedGiftBean.TopUsers> top_users;
|
||||
private boolean is_liang;
|
||||
|
||||
// @Data
|
||||
// public static class TopUsers {
|
||||
// private int user_id;
|
||||
// private String nickname;
|
||||
// private String avatar;
|
||||
// private String count;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/10
|
||||
*@description:发布头条需要的参数
|
||||
*/
|
||||
@Data
|
||||
public class HeadlineBean implements Serializable {
|
||||
private String countdown;
|
||||
private String now_money;
|
||||
private String next_money;
|
||||
|
||||
|
||||
private String id;
|
||||
private String user_id;//用户ID
|
||||
private String content;//内容
|
||||
private String money;//花了多钱发的这个头条
|
||||
private String nickname;//昵称
|
||||
private String avatar;//头像
|
||||
private String end_time;//倒计时时间
|
||||
private String room_id;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/16
|
||||
*@description:抢头条推送过来的参数
|
||||
*/
|
||||
@Data
|
||||
public class HeadlineEvent {
|
||||
private int type;
|
||||
private String content;
|
||||
private UserInfo user_info;
|
||||
private String room_id;
|
||||
private String end_time;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/30
|
||||
*@description: 话题实体
|
||||
*/
|
||||
@Data
|
||||
public class HeatedBean implements Parcelable {
|
||||
private String title;//话题
|
||||
private String topic_id;//话题id
|
||||
private String count;//引用数量
|
||||
private String pic; //图片
|
||||
private String content;//内容
|
||||
protected HeatedBean(Parcel in) {
|
||||
title = in.readString();
|
||||
topic_id = in.readString();
|
||||
count = in.readString();
|
||||
pic = in.readString();
|
||||
content = in.readString();
|
||||
}
|
||||
|
||||
public static final Creator<HeatedBean> CREATOR = new Creator<HeatedBean>() {
|
||||
@Override
|
||||
public HeatedBean createFromParcel(Parcel in) {
|
||||
return new HeatedBean(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HeatedBean[] newArray(int size) {
|
||||
return new HeatedBean[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(title);
|
||||
dest.writeString(topic_id);
|
||||
dest.writeString(count);
|
||||
dest.writeString(pic);
|
||||
dest.writeString(content);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HeavenGiftBean {
|
||||
private String title;
|
||||
private String picture;
|
||||
private int type;
|
||||
private String quantity;
|
||||
private String gold;
|
||||
private String days;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HomeBean implements MultiItemEntity {
|
||||
private int itemViewType = 2;
|
||||
private String user_id;
|
||||
private String head_picture;
|
||||
private String nickname;
|
||||
private String sex;
|
||||
private String signature;
|
||||
private String constellation;
|
||||
private String birthday;
|
||||
private String intro_voice;
|
||||
private String intro_voice_time;
|
||||
private String offline_time;
|
||||
private int age;
|
||||
private int is_online;
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return itemViewType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
|
||||
import com.example.moduletablayout.listener.CustomTabEntity;
|
||||
|
||||
/**
|
||||
* 项目名称 qipao-android
|
||||
* 包名:com.qpyy.module.me.bean
|
||||
* 创建人 黄强
|
||||
* 创建时间 2020/12/1 17:40
|
||||
* 描述 describe
|
||||
*/
|
||||
public class HomePageTabBean implements CustomTabEntity {
|
||||
public HomePageTabBean(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
private String title;
|
||||
|
||||
@Override
|
||||
public String getTabTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTabSelectedIcon() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTabUnselectedIcon() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HomeRoomInfo {
|
||||
private String room_name;
|
||||
private String cover_picture;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HostBean {
|
||||
private String id;
|
||||
private String user_id;
|
||||
private String room_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String sex;
|
||||
private String type;//类型 1:主持人 2:管理员
|
||||
private String ratio;//主持人收益比
|
||||
private List<String> icon;//
|
||||
private String earnings;//收益
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
public class ManageRoomResp {
|
||||
|
||||
private String id;
|
||||
private String room_id;
|
||||
private String room_name;
|
||||
private String room_code;
|
||||
private String popularity;
|
||||
private String label_name;
|
||||
private String label_icon;
|
||||
private String owner_picture;
|
||||
private String owner_nickname;
|
||||
private int sys_type_id;
|
||||
private int locked;
|
||||
private String label_id;
|
||||
|
||||
public String getLabel_id() {
|
||||
return label_id;
|
||||
}
|
||||
|
||||
public void setLabel_id(String label_id) {
|
||||
this.label_id = label_id;
|
||||
}
|
||||
|
||||
private String cover_picture;
|
||||
|
||||
public String getRoomPicture() {
|
||||
if (!TextUtils.isEmpty(cover_picture)) {
|
||||
return cover_picture;
|
||||
}
|
||||
return owner_picture;
|
||||
}
|
||||
|
||||
public String getCover_picture() {
|
||||
return cover_picture;
|
||||
}
|
||||
|
||||
public void setCover_picture(String cover_picture) {
|
||||
this.cover_picture = cover_picture;
|
||||
}
|
||||
|
||||
public int getLocked() {
|
||||
return locked;
|
||||
}
|
||||
|
||||
public void setLocked(int locked) {
|
||||
this.locked = locked;
|
||||
}
|
||||
|
||||
public int getSys_type_id() {
|
||||
return sys_type_id;
|
||||
}
|
||||
|
||||
public void setSys_type_id(int sys_type_id) {
|
||||
this.sys_type_id = sys_type_id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRoom_id() {
|
||||
return room_id;
|
||||
}
|
||||
|
||||
public void setRoom_id(String room_id) {
|
||||
this.room_id = room_id;
|
||||
}
|
||||
|
||||
public String getRoom_name() {
|
||||
return room_name;
|
||||
}
|
||||
|
||||
public void setRoom_name(String room_name) {
|
||||
this.room_name = room_name;
|
||||
}
|
||||
|
||||
public String getRoom_code() {
|
||||
return room_code;
|
||||
}
|
||||
|
||||
public void setRoom_code(String room_code) {
|
||||
this.room_code = room_code;
|
||||
}
|
||||
|
||||
public String getPopularity() {
|
||||
return popularity;
|
||||
}
|
||||
|
||||
public void setPopularity(String popularity) {
|
||||
this.popularity = popularity;
|
||||
}
|
||||
|
||||
public String getLabel_name() {
|
||||
return label_name;
|
||||
}
|
||||
|
||||
public void setLabel_name(String label_name) {
|
||||
this.label_name = label_name;
|
||||
}
|
||||
|
||||
public String getLabel_icon() {
|
||||
return label_icon;
|
||||
}
|
||||
|
||||
public void setLabel_icon(String label_icon) {
|
||||
this.label_icon = label_icon;
|
||||
}
|
||||
|
||||
public String getOwner_picture() {
|
||||
return owner_picture;
|
||||
}
|
||||
|
||||
public void setOwner_picture(String owner_picture) {
|
||||
this.owner_picture = owner_picture;
|
||||
}
|
||||
|
||||
public String getOwner_nickname() {
|
||||
return owner_nickname;
|
||||
}
|
||||
|
||||
public void setOwner_nickname(String owner_nickname) {
|
||||
this.owner_nickname = owner_nickname;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class MixerResp {
|
||||
private int id;
|
||||
private String name;
|
||||
private int imgUrtl;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/19
|
||||
*@description: 已点歌曲实体
|
||||
*/
|
||||
@Data
|
||||
public class MusicSongBean implements Serializable {
|
||||
|
||||
private String did;//歌曲id
|
||||
private String room_id;
|
||||
private String song_code;//歌曲唯一标识
|
||||
private String song_name;//歌曲名称
|
||||
private String singer;//歌手
|
||||
private String poster;//封面
|
||||
private String duration;//播放时长
|
||||
private int sort;//
|
||||
private String user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String dress;
|
||||
private String charm;
|
||||
private int is_hot;//是否是主持,并且是在9号麦位上
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MyBagBean {
|
||||
private String myBagTitle;
|
||||
private String myBagType;
|
||||
|
||||
public MyBagBean(String myBagTitle, String myBagType) {
|
||||
this.myBagTitle = myBagTitle;
|
||||
this.myBagType = myBagType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MyBagDataBean {
|
||||
private String title;
|
||||
private String giftName;
|
||||
private String time;
|
||||
private String base_image;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/1
|
||||
*@description: cp房实体类
|
||||
*/
|
||||
@Data
|
||||
public class MyCpRoom {
|
||||
private String room_name;
|
||||
private int room_number;
|
||||
private String end_time;
|
||||
private String user1_avatar;
|
||||
private String user2_avatar;
|
||||
private int earnings;
|
||||
private String relation;
|
||||
private String room_id;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MyFootResp {
|
||||
|
||||
private String room_number;//房间号
|
||||
private String room_name;//房间名称
|
||||
private String room_code;
|
||||
private String popularity;
|
||||
private String hot_value;
|
||||
private String label_name;
|
||||
private String label_icon;//房间标签图标
|
||||
private String owner_picture;
|
||||
private String owner_nickname;
|
||||
private String room_id;//房间id
|
||||
private int locked;
|
||||
private String label_id; //房间标签id
|
||||
private String room_intro; //房间简介
|
||||
private String room_cover;//房间封面
|
||||
|
||||
private String user_count;//人数
|
||||
|
||||
private String room_password;//密码
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/6/11
|
||||
* @description: 我创建的房间
|
||||
*/
|
||||
@Data
|
||||
public class MyRoomBean {
|
||||
|
||||
/*
|
||||
"room_id": "10184180",
|
||||
"cover_picture": "httpss://osschumeng.oss-cn-beijing.aliyuncs.com/img/e86e2efe3f4412561e9c30326162d946.jpg",
|
||||
"room_name": "钊的房间",
|
||||
"online_num": 0,
|
||||
"label_id": "23",
|
||||
"label_name": "聊天",
|
||||
"label_icon": "",
|
||||
"favorite_count": "0",
|
||||
"come_count": "161",
|
||||
"today_income": 0
|
||||
*/
|
||||
|
||||
private String room_id;
|
||||
private String room_number;
|
||||
private String user_id;
|
||||
private String nickname;
|
||||
private String room_name; //房间名称
|
||||
private String room_cover;//房间封面
|
||||
private String apply_status;//房间状态,1:申请中,2:申请通过,3:申请被拒绝
|
||||
private String room_status;//房间状态,1:正常,2:封禁3:关闭
|
||||
private String room_password;//房间密码
|
||||
private String type_id;//房间类型id
|
||||
private String type_name;//类型名称
|
||||
private String label_icon; //分类图标
|
||||
private String label_id; //分类id
|
||||
private String is_user_code;//是否使用靓号1:是,0:否
|
||||
private String today_profit;//今日收益
|
||||
private int online_num; //房间在线人数
|
||||
private int visit_num;//访问人数
|
||||
private int follow_num;//房间关注人数
|
||||
private String ratio;//房间提成
|
||||
|
||||
private List<CpRoom> cp_room;
|
||||
|
||||
private String room_intro;//房间介绍
|
||||
private String user_count;//房间人数
|
||||
private String label_name; //房间类型名称
|
||||
private String favorite_count; //房间收藏数
|
||||
private String come_count; //房间进入数
|
||||
private Double today_income; //今日收益;
|
||||
private int earnings_ratio;//房间收益比例
|
||||
|
||||
@Data
|
||||
static class CpRoom {
|
||||
private String id;
|
||||
private String room_name;
|
||||
private String room_number;
|
||||
|
||||
private String end_time;
|
||||
|
||||
private String earnings;
|
||||
|
||||
private String user1_avatar;
|
||||
|
||||
private String user2_avatar;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NewsDataBean {
|
||||
private int system_no_read_count; //系统消息未读总数
|
||||
private SystemMessage system_last_message;//最后一条未读系统消息
|
||||
private int announcement_read_count; //未读官方公告总数
|
||||
private SystemMessage announcement_last_message;//最后一条未读官方公告
|
||||
|
||||
|
||||
@Data
|
||||
public static class SystemMessage {
|
||||
private int id; //消息ID
|
||||
private int type; //消息类型
|
||||
private int admin_id; //管理员ID
|
||||
private String content; //内容
|
||||
private String title; //标题
|
||||
private String image;
|
||||
private int room_id; //房间ID
|
||||
private String url;
|
||||
private String updatetime; //更新时间
|
||||
private String delete_time; //删除时间
|
||||
private String createtime; //创建时间
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025年7月23日$ $
|
||||
* @Description 消息列表$
|
||||
*/
|
||||
@Data
|
||||
public class NewsMessageList {
|
||||
private int id;
|
||||
private int type;//类型 1:系统消息 2:官方公告 3:活动中心
|
||||
private int admin_id;
|
||||
private String title;//标题
|
||||
private String content;//内容
|
||||
private String source_id;//来源id
|
||||
private String is_read;//是否已读 0:未读 1:已读
|
||||
private String image;
|
||||
private int room_id; //大于0的时候,点击进入房间 等于0的时候,url不为空,跳转单页
|
||||
private String url;
|
||||
private String createtime;
|
||||
private String updatetime;
|
||||
private String delete_time;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/7
|
||||
*@description: 装扮类型表
|
||||
*/
|
||||
@Data
|
||||
public class PersonaltyBean {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class PhotoWallResp implements Serializable {
|
||||
|
||||
public String getVedio() {
|
||||
return vedio;
|
||||
}
|
||||
|
||||
public void setVedio(String vedio) {
|
||||
this.vedio = vedio;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getVedio_cover() {
|
||||
return vedio_cover;
|
||||
}
|
||||
|
||||
public void setVedio_cover(String vedio_cover) {
|
||||
this.vedio_cover = vedio_cover;
|
||||
}
|
||||
|
||||
public List<GiftResp> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<GiftResp> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
private String vedio;
|
||||
private String avatar;
|
||||
private String vedio_cover;
|
||||
private List<GiftResp> list;
|
||||
|
||||
public static class GiftResp implements Serializable {
|
||||
public GiftResp(String id, String url, int width, int height) {
|
||||
this.id = id;
|
||||
this.url = url;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
private String id;
|
||||
private String url;
|
||||
private int width;
|
||||
private int height;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025-8-5 01:38:04$ $
|
||||
* @Description 更新用户声网token$
|
||||
*/
|
||||
@Data
|
||||
public class PkSwTokenBean {
|
||||
private String agora_token;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/11
|
||||
*@description: 榜单实体类
|
||||
*/
|
||||
@Data
|
||||
public class PlaceholderBean {
|
||||
|
||||
private MyRanking my_ranking;//自己的排行信息
|
||||
private List<ListsBean> lists;//榜单信息
|
||||
|
||||
|
||||
@Data
|
||||
public static class MyRanking {
|
||||
private String avatar;
|
||||
private String nickname;
|
||||
private String user_id;
|
||||
private String user_code;//
|
||||
private String sex;//性别
|
||||
private List<String> icon;//
|
||||
private String total;//值
|
||||
private String rank;//排名
|
||||
private String diff;//差上榜需要这么多
|
||||
|
||||
private String room_name;
|
||||
private String room_id;
|
||||
private String room_cover;
|
||||
|
||||
private int id;//公会id
|
||||
private String guild_special_id;
|
||||
private String guild_name;
|
||||
private String cover;
|
||||
private int num;
|
||||
private int expenditure;
|
||||
private String intro;
|
||||
private String createtime;
|
||||
private String updatetime;
|
||||
private String delete_time;
|
||||
private int is_show;
|
||||
private int status;
|
||||
|
||||
private String user_id1;
|
||||
private String user_avatar;
|
||||
private String user_avatar1;
|
||||
|
||||
}
|
||||
@Data
|
||||
public static class ListsBean {
|
||||
private String user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String total;
|
||||
private String rank;
|
||||
private List<String> icon;
|
||||
private String room_name;
|
||||
private String room_id;
|
||||
private String room_cover;
|
||||
|
||||
private int id;//公会id
|
||||
private String guild_special_id;
|
||||
private String guild_name;
|
||||
private String cover;
|
||||
private int num;
|
||||
private int expenditure;
|
||||
private String intro;
|
||||
private String createtime;
|
||||
private String updatetime;
|
||||
private String delete_time;
|
||||
private int is_show;
|
||||
private int status;
|
||||
private int income;
|
||||
|
||||
private String user_id1;
|
||||
private String user_avatar;
|
||||
private String user_avatar1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/27
|
||||
*@description: 实名认证点击获取返回的参数
|
||||
*/
|
||||
@Data
|
||||
public class RealNameBean {
|
||||
private String userid;
|
||||
private String nonce;
|
||||
private String sign;
|
||||
private String appid;
|
||||
private String orderNo;
|
||||
private String apiVersion;
|
||||
private String licence;
|
||||
private String faceId;
|
||||
|
||||
private String id;
|
||||
private String mobile;
|
||||
private int is_real;
|
||||
private String real_name;
|
||||
private String card_id;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* ProjectName: isolated-island
|
||||
* Package: com.yutang.xqipao.data
|
||||
* Description: java类作用描述
|
||||
* Author: 姚闻达
|
||||
* CreateDate: 2020/11/1 10:14
|
||||
* UpdateUser: 更新者
|
||||
* UpdateDate: 2020/11/1 10:14
|
||||
* UpdateRemark: 更新说明
|
||||
* Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class RechargeBean implements MultiItemEntity {
|
||||
private int itemViewType;
|
||||
private String coins;
|
||||
private String money;
|
||||
private boolean isCustom; // 是否为自定义项
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.chad.library.adapter.base.entity.SectionEntity;
|
||||
|
||||
public class RecordSection extends SectionEntity<String> {
|
||||
|
||||
public RecordSection(boolean isHeader, String header) {
|
||||
super(isHeader, header);
|
||||
}
|
||||
|
||||
public RecordSection(String name) {
|
||||
super(name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
public class RefreshEvent {
|
||||
private String roomId;
|
||||
|
||||
public RefreshEvent(String roomId) {
|
||||
this.roomId = roomId;
|
||||
}
|
||||
|
||||
public String getRoomId() {
|
||||
return roomId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025-8-2 02:11:32$ $
|
||||
* @Description 获取关系的列表$
|
||||
*/
|
||||
@Data
|
||||
public class RelationCardBean {
|
||||
private List<RelationshipBean> qinmi;
|
||||
private List<RelationshipBean> zhenai;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/6/16
|
||||
* @description: 关系信息
|
||||
*/
|
||||
@Data
|
||||
public class RelationshipBean implements Serializable {
|
||||
|
||||
|
||||
private int relation_id;//关系id 3,
|
||||
private int id;// 39,
|
||||
private int user_id1;// 31,
|
||||
private int user_id2;// 12,
|
||||
private String updatetime;// " 1754038468,
|
||||
private String time_day;// " 2025-: 54000,
|
||||
private String end_time;// 1754092468,
|
||||
private String nickname1;// "坦率的摩托",
|
||||
private String avatar1;// "https://qx-yusheng.oss-cn-hangzhou.aliyuncs.com/img/53a7320dbf4ed24c204291b1cb3f07f7.jpg",
|
||||
private String cp_room_id;// null,
|
||||
private String nickname2;// "暴躁的金针菇",
|
||||
private String avatar2;//https://qx-yusheng.oss-cn-hangzhou.aliyuncs.com/audio/4354fff51c3ff20c8ffdcfb7fe55d843.jpg",
|
||||
private String relation_name;// ": "闺蜜1",
|
||||
private String image;// "http://111111111",
|
||||
private String delete_me_coin;// " "100",
|
||||
private int heart_value;// 0,
|
||||
private int is_top;// 0
|
||||
private int type;// 1,亲密;2:真爱
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RevenueBean {
|
||||
private String id;
|
||||
private String user_id;
|
||||
private String change_type;
|
||||
private String change_type_name;
|
||||
private String change_value;
|
||||
private String remarks;
|
||||
private String createtime;
|
||||
private int type; //1:金币 2:钻石
|
||||
// private String title;
|
||||
// private String time;
|
||||
// private String money;
|
||||
// private String type;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RewardUserBean {
|
||||
private String user_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String is_online;
|
||||
private String total_price;
|
||||
private String pit_number;
|
||||
private boolean isSelect = false;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity;
|
||||
import com.xscm.moduleutil.RoomAutionTimeBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/28
|
||||
*@description: 拍卖房中选择对应的关系和礼物、时间
|
||||
*/
|
||||
@Data
|
||||
public class RoomAuctionABean implements MultiItemEntity {
|
||||
|
||||
private int itemType;
|
||||
|
||||
private List<RoomRelationBean> roomRelationBeanList;
|
||||
private List<RoomAutionTimeBean> roomTimeBeanList;
|
||||
private List<RoonGiftModel> roomGiftBeanList;
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomBgBean {
|
||||
private List<RoomBg> public_bg;
|
||||
private List<RoomBg> private_bg;
|
||||
|
||||
|
||||
@Data
|
||||
public static class RoomBg{
|
||||
private String id;//图片id
|
||||
private String image_name;//图片名称
|
||||
private String image_url;//图片地址
|
||||
private String upload_user;//上传用户id
|
||||
private String image_size;//大小
|
||||
private String status;//状态 1 正常 2 删除
|
||||
private String createtime;//创建时间
|
||||
|
||||
private boolean isPublic; // 是否是公共背景
|
||||
private boolean isAddButton; // 是否是添加按钮项
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user