zhanling dengji
This commit is contained in:
parent
215a2f8927
commit
dc28a3d81e
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user