Merge remote-tracking branch 'origin/dev_6.6.4_战令' into dev_6.6.4_战令

This commit is contained in:
zlzw 2023-12-18 16:54:05 +08:00
commit d001712067
3 changed files with 38 additions and 5 deletions

View File

@ -1,7 +1,7 @@
package com.yunbao.common.dialog;
import android.content.Context;
import android.widget.EditText;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -9,12 +9,16 @@ import androidx.annotation.NonNull;
import com.lxj.xpopup.core.CenterPopupView;
import com.yunbao.common.R;
import java.math.BigDecimal;
/**
* 战令等级
*/
public class OrderLevelPopupWindow extends CenterPopupView {
private EditText orderLevel;
private TextView orderLevelDiamond,balanceDiamond;
private TextView orderLevel, orderLevelDiamond, balanceDiamond;
private String buyExp = "100";
public OrderLevelPopupWindow(@NonNull Context context) {
super(context);
}
@ -31,5 +35,31 @@ public class OrderLevelPopupWindow extends CenterPopupView {
orderLevel = findViewById(R.id.tickets_plus_minus);
orderLevelDiamond = findViewById(R.id.order_level_diamond);
balanceDiamond = findViewById(R.id.balance_diamond);
orderLevel.setText(buyExp);
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
float exp = new BigDecimal(buyExp).floatValue();
if (exp > 100) {
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).subtract(new BigDecimal("100"));
buyExp = String.valueOf(buyExpBigDecimal.intValue());
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
orderLevel.setText(buyExp);
}
}
});
findViewById(R.id.add).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
float exp = new BigDecimal(buyExp).floatValue();
if (exp < 10000) {
BigDecimal buyExpBigDecimal = new BigDecimal(buyExp).add(new BigDecimal("100"));
buyExp = String.valueOf(buyExpBigDecimal.intValue());
orderLevelDiamond.setText(String.valueOf(buyExpBigDecimal.floatValue()));
orderLevel.setText(buyExp);
}
}
});
}
}

View File

@ -77,12 +77,14 @@
android:layout_height="match_parent"
android:layout_weight="1" />
<EditText
<TextView
android:id="@+id/tickets_plus_minus"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:inputType="number"
android:imeOptions="actionSend"
android:background="@null"
android:singleLine="true"
android:text="0"

View File

@ -40,6 +40,7 @@ import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.NativeCallbackModel;
import com.yunbao.common.dialog.CinemaTicketPopupWindow;
import com.yunbao.common.dialog.OrderLevelPopupWindow;
import com.yunbao.common.dialog.PromotionElitePopupWindow;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
@ -234,7 +235,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
new XPopup.Builder(mContext)
.enableDrag(false)
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
.asCustom(new OrderLevelPopupWindow(mContext))
.asCustom(new PromotionElitePopupWindow(mContext,"62,888","12,888"))
.show();
}
});