120 lines
3.6 KiB
Java
120 lines
3.6 KiB
Java
package com.web.dmcslot;
|
|
|
|
import android.app.Dialog;
|
|
import android.content.Context;
|
|
import android.graphics.drawable.ColorDrawable;
|
|
import android.os.Bundle;
|
|
import android.view.Gravity;
|
|
import android.view.View;
|
|
import android.view.Window;
|
|
import android.view.WindowManager;
|
|
import android.widget.TextView;
|
|
|
|
|
|
public class ActionSelectDialog extends Dialog {
|
|
|
|
private TextView shareTv;
|
|
private TextView checkTv;
|
|
OnToActionListener onToLoginListener;
|
|
private Context mContext;
|
|
|
|
public interface OnToActionListener {
|
|
void toShare();
|
|
|
|
void toCheck();
|
|
|
|
void toWithDrawRecords();
|
|
|
|
void toWithDrawApply();
|
|
|
|
void toBankInfo();
|
|
}
|
|
|
|
public void setOnToActionListener(OnToActionListener onNextCallListener) {
|
|
this.onToLoginListener = onNextCallListener;
|
|
}
|
|
|
|
|
|
public ActionSelectDialog(Context context) {
|
|
super(context, R.style.MaterialDesignDialog);
|
|
this.mContext = context;
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.dialog_select_action);
|
|
|
|
shareTv = (TextView) findViewById(R.id.share);
|
|
checkTv = (TextView) findViewById(R.id.check);
|
|
|
|
shareTv.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
public void onClick(View view) {
|
|
dismiss();
|
|
if (onToLoginListener != null) {
|
|
onToLoginListener.toShare();
|
|
}
|
|
}
|
|
});
|
|
checkTv.setOnClickListener(view -> {
|
|
dismiss();
|
|
if (onToLoginListener != null) {
|
|
onToLoginListener.toCheck();
|
|
}
|
|
});
|
|
//提现记录
|
|
findViewById(R.id.withdraw).setOnClickListener(view -> {
|
|
dismiss();
|
|
if (onToLoginListener != null) {
|
|
onToLoginListener.toWithDrawRecords();
|
|
}
|
|
});
|
|
//提现申请
|
|
findViewById(R.id.withdraw_apply).setOnClickListener(view -> {
|
|
dismiss();
|
|
if (onToLoginListener != null) {
|
|
onToLoginListener.toWithDrawApply();
|
|
}
|
|
});
|
|
//银行卡信息
|
|
findViewById(R.id.bankinfo).setOnClickListener(view -> {
|
|
dismiss();
|
|
if (onToLoginListener != null) {
|
|
onToLoginListener.toBankInfo();
|
|
}
|
|
});
|
|
Window window = getWindow();
|
|
WindowManager.LayoutParams wlp = window.getAttributes();
|
|
wlp.gravity = Gravity.BOTTOM;
|
|
wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
|
window.setAttributes(wlp);
|
|
}
|
|
|
|
// private void fullScreenImmersive(View view) {
|
|
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
// int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
|
// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
// | View.SYSTEM_UI_FLAG_FULLSCREEN;
|
|
// view.setSystemUiVisibility(uiOptions);
|
|
// }
|
|
// }
|
|
//
|
|
// @Override
|
|
// public void show() {
|
|
// this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
|
// super.show();
|
|
// fullScreenImmersive(getWindow().getDecorView());
|
|
// this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
|
|
// }
|
|
|
|
|
|
}
|