1:修改所有的充值自定义金额
2:修改小时榜滑动出现的图片复用问题
This commit is contained in:
@@ -761,7 +761,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
// 发送广播通知所有Activity刷新状态
|
||||
Intent refreshIntent = new Intent("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
sendBroadcast(refreshIntent);
|
||||
Intent intent = new Intent("com.xscm.action.LAUNCH_PAGE");
|
||||
Intent intent = new Intent("com.xscm.midi.LAUNCH_PAGE");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getApplicationContext().startActivity(intent);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
if (type!=null){
|
||||
mBinding.r4.setVisibility(View.GONE);
|
||||
}else{
|
||||
mBinding.r4.setVisibility(View.VISIBLE);
|
||||
mBinding.r4.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,11 +137,11 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
|
||||
@Override
|
||||
public void setRechargeData(List<RechargeBean> rechargeData) {
|
||||
RechargeBean customItem = new RechargeBean();
|
||||
customItem.setCoins("自定义");
|
||||
customItem.setMoney("");
|
||||
customItem.setItemViewType(1);
|
||||
rechargeData.add(customItem);
|
||||
// RechargeBean customItem = new RechargeBean();
|
||||
// customItem.setCoins("自定义");
|
||||
// customItem.setMoney("");
|
||||
// customItem.setItemViewType(1);
|
||||
// rechargeData.add(customItem);
|
||||
rechargeAdapter = new BalanceRechargeAdapter(rechargeData);
|
||||
rechargeAdapter.setNewData(rechargeData);
|
||||
rechargeAdapter.setListener(new BalanceRechargeAdapter.OnRechargeItemClickListener() {
|
||||
|
||||
@@ -51,11 +51,11 @@ public class EnvironmentPrefs {
|
||||
// }
|
||||
|
||||
// 默认使用生产环境
|
||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.TEST.name());
|
||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.PRODUCTION.name());
|
||||
try {
|
||||
return EnvironmentEnum.valueOf(envName);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return EnvironmentEnum.TEST; // 出错时默认返回生产环境
|
||||
return EnvironmentEnum.PRODUCTION; // 出错时默认返回生产环境
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ public class DropHourlView extends LinearLayout {
|
||||
private int rightMargin = 0;
|
||||
private float lastX, lastY;
|
||||
private int screenWidth;
|
||||
private int screenHeight; // 添加屏幕高度变量
|
||||
|
||||
public DropHourlView(Context context) {
|
||||
super(context);
|
||||
@@ -42,6 +43,9 @@ public class DropHourlView extends LinearLayout {
|
||||
|
||||
|
||||
void init() {
|
||||
// 初始化屏幕尺寸
|
||||
screenWidth = ScreenUtils.getScreenWidth();
|
||||
screenHeight = ScreenUtils.getScreenHeight();
|
||||
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
@@ -51,6 +55,8 @@ public class DropHourlView extends LinearLayout {
|
||||
int sw = ScreenUtils.getScreenWidth()-200;
|
||||
// setBackgroundResource(R.drawable.bg_home_drop_view);
|
||||
int y = (int) (0.5f * sh) - getHeight();
|
||||
// 确保Y坐标不会超出屏幕范围
|
||||
y = Math.max(0, Math.min(y, sh - getHeight()));
|
||||
int x = sw - getWidth();
|
||||
setTranslationX(x);
|
||||
setTranslationY(y);
|
||||
@@ -64,19 +70,25 @@ public class DropHourlView extends LinearLayout {
|
||||
float X2;
|
||||
float Y1;
|
||||
float Y2;
|
||||
// 记录视图初始位置
|
||||
private float originalX;
|
||||
private float originalY;
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent event) {
|
||||
if (starDrap) return true;
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
X1 = event.getX();
|
||||
Y1 = event.getY();
|
||||
X1 = event.getRawX();
|
||||
Y1 = event.getRawY();
|
||||
// 记录视图当前位置
|
||||
originalX = getTranslationX();
|
||||
originalY = getTranslationY();
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
X2 = event.getX();//当手指抬起时,再次获取屏幕位置的X值
|
||||
Y2 = event.getY();//同理
|
||||
X2 = event.getRawX();
|
||||
Y2 = event.getRawY();
|
||||
Action(X1, X2, Y1, Y2);
|
||||
break;
|
||||
|
||||
@@ -111,17 +123,35 @@ public class DropHourlView extends LinearLayout {
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
// setBackgroundResource(R.drawable.bg_home_drop_view);
|
||||
setTranslationX(getX() + (event.getX() - X1));
|
||||
setTranslationY(getY() + (event.getY() - Y1));
|
||||
X2 = event.getX();
|
||||
// 使用屏幕绝对坐标计算新位置
|
||||
float newX = originalX + (event.getRawX() - X1);
|
||||
float newY = originalY + (event.getRawY() - Y1);
|
||||
|
||||
// 限制X和Y坐标在屏幕范围内
|
||||
newX = Math.max(0, Math.min(newX, screenWidth - getWidth()));
|
||||
newY = Math.max(0, Math.min(newY, screenHeight - getHeight()));
|
||||
|
||||
setTranslationX(newX);
|
||||
setTranslationY(newY);
|
||||
X2 = event.getRawX();
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
starDrap = false;
|
||||
int sw = ScreenUtils.getScreenWidth();
|
||||
Log.i(TAG, "onTouchEvent: " + sw + "," + X2);
|
||||
boolean isR = getTranslationX() + getWidth() / 2 >= sw / 2;//贴边方向
|
||||
ObjectAnimator anim = ObjectAnimator.ofFloat(this, "translationX", isR ? sw - getWidth()+10 : 0f).setDuration(200);
|
||||
anim.start();
|
||||
|
||||
// 获取当前Y坐标
|
||||
float currentY = getTranslationY();
|
||||
|
||||
// 创建X轴和Y轴的动画
|
||||
ObjectAnimator animX = ObjectAnimator.ofFloat(this, "translationX", isR ? sw - getWidth() : 0f).setDuration(200);
|
||||
// Y轴保持当前位置,但确保在屏幕范围内
|
||||
currentY = Math.max(0, Math.min(currentY, screenHeight - getHeight()));
|
||||
ObjectAnimator animY = ObjectAnimator.ofFloat(this, "translationY", currentY).setDuration(200);
|
||||
|
||||
animX.start();
|
||||
animY.start();
|
||||
|
||||
break;
|
||||
|
||||
@@ -186,4 +216,4 @@ public class DropHourlView extends LinearLayout {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user