1:修改交友房

2:修改拍卖房
3:修改飘屏(没有修改成功)
This commit is contained in:
2025-09-24 00:30:40 +08:00
parent 1c54f0c072
commit 5f573e607d
43 changed files with 1172 additions and 307 deletions

View File

@@ -2,6 +2,8 @@ package com.xscm.moduleutil.activity;
import static androidx.core.content.ContextCompat.getSystemService;
import static com.xscm.moduleutil.base.CommonAppContext.postDelayed;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
@@ -23,7 +25,9 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.TranslateAnimation;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.FrameLayout;
@@ -53,6 +57,8 @@ import com.xscm.moduleutil.utils.ColorManager;
import com.xscm.moduleutil.utils.DisplayUtil;
import com.xscm.moduleutil.utils.ImageUtils;
import com.xscm.moduleutil.utils.SpUtil;
import com.xscm.moduleutil.utils.SystemUtils;
import com.xscm.moduleutil.widget.QXGiftDriftView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@@ -98,7 +104,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
ActivityUtils.finishAllActivities();
}
QXGiftDriftView qxGiftDriftView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -141,7 +147,6 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
EventBus.getDefault().register(this);
}
}
// 在Activity中
@@ -414,10 +419,10 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
synchronized (mqttQueueLock) {
mqttMessageQueue.addAll(mqttBean.getList());
if (!isMqttPlaying) {
isMqttPlaying = true;
// if (!isMqttPlaying) {
// isMqttPlaying = true;
processNextMqttMessage();
}
// }
}
}else {
mqttMessageQueue.clear();
@@ -472,6 +477,11 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
ViewGroup decorView1;
private void showFloatingMessage(MqttBean.ListBean mqttBean) {
// QXGiftDriftView.getInstance( this).addGiftModel(mqttBean);
try {
// 清理之前的视图(如果存在)
if (currentMqttView != null && currentMqttView.getParent() != null) {
@@ -569,35 +579,92 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
view.setTranslationX(screenWidth);
ObjectAnimator animator1 = ObjectAnimator.ofFloat(view, "translationX", view.getWidth(), 0f);
// ObjectAnimator animator1 = ObjectAnimator.ofFloat(view, "translationX", getScreenWidth(), (getScreenWidth() - view.getMeasuredWidth()) / 2f);
animator1.setDuration(1500);
animator1.setInterpolator(new DecelerateInterpolator(2.0f));
animator1.start();
TranslateAnimation enterAnim = new TranslateAnimation(
Animation.ABSOLUTE, screenWidth,
Animation.ABSOLUTE, (screenWidth - SystemUtils.getWidth(316)) / 2,
Animation.ABSOLUTE, 0,
Animation.ABSOLUTE, 0
);
enterAnim.setDuration(1500);
enterAnim.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {}
view.postDelayed(() -> {
try {
ObjectAnimator animator2 = ObjectAnimator.ofFloat(view, "translationX", 0f, -view.getWidth());
// ObjectAnimator animator2 = ObjectAnimator.ofFloat(view, "translationX", (getScreenWidth() - view.getMeasuredWidth()) / 2f, -view.getMeasuredWidth());
animator2.setDuration(1500);
animator2.setInterpolator(new DecelerateInterpolator(2.0f));
animator2.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
onAnimationEnd.run();
}
@Override
public void onAnimationEnd(Animation animation) {
// 停留后退出
postDelayed(() -> {
TranslateAnimation exitAnim = new TranslateAnimation(
Animation.ABSOLUTE, (screenWidth - SystemUtils.getWidth(316)) / 2,
Animation.ABSOLUTE, -screenWidth,
Animation.ABSOLUTE, 0,
Animation.ABSOLUTE, 0
);
exitAnim.setDuration(2000);
exitAnim.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {}
@Override
public void onAnimationCancel(Animator animation) {
onAnimationEnd.run();
}
});
animator2.start();
} catch (Exception e) {
LogUtils.e("MQTT动画执行失败", e);
onAnimationEnd.run();
@Override
public void onAnimationEnd(Animation animation) {
// 移除视图并处理下一个
// ViewGroup rootView = (ViewGroup) getParent();
// if (rootView != null) {
// rootView.removeView(QXGiftDriftView.this);
// }
//
// if (!dataArray.isEmpty()) {
// dataArray.remove(0);
// }
// isPlaying = false;
//
// if (!dataArray.isEmpty()) {
// giftAction();
// }
onAnimationEnd.run();
}
@Override
public void onAnimationRepeat(Animation animation) {}
});
view.startAnimation(exitAnim);
}, 3000); // 停留1秒
}
}, 3000);
@Override
public void onAnimationRepeat(Animation animation) {}
});
view.startAnimation(enterAnim);
// ObjectAnimator animator1 = ObjectAnimator.ofFloat(view, "translationX", view.getWidth(), 0f);
// animator1.setDuration(1500);
// animator1.setInterpolator(new DecelerateInterpolator(1f));
// animator1.start();
// view.postDelayed(() -> {
// try {
// ObjectAnimator animator2 = ObjectAnimator.ofFloat(view, "translationX", 0f, -view.getWidth());
// animator2.setDuration(3000);
// animator2.setInterpolator(new DecelerateInterpolator(2.0f));
// animator2.addListener(new AnimatorListenerAdapter() {
// @Override
// public void onAnimationEnd(Animator animation) {
// onAnimationEnd.run();
// }
//
// @Override
// public void onAnimationCancel(Animator animation) {
// onAnimationEnd.run();
// }
// });
// animator2.start();
// } catch (Exception e) {
// LogUtils.e("MQTT动画执行失败", e);
// onAnimationEnd.run();
// }
// }, 3000);
} catch (Exception e) {
LogUtils.e("MQTT动画启动失败", e);
onAnimationEnd.run();