光环助手V4.6.0-积分体系(第1期)--光能中心(首页部分)https://git.ghzs.com/pm/halo-app-issues/-/issues/1065 和 光环助手V4.6.0-积分体系(第1期)--光能屋(首页部分)https://git.ghzs.com/pm/halo-app-issues/-/issues/1062

This commit is contained in:
lyr
2020-12-22 17:15:32 +08:00
parent 7d194c7078
commit b2433cf13a
133 changed files with 3569 additions and 76 deletions

View File

@ -1902,6 +1902,52 @@ public class DialogUtils {
dialog.show();
}
public static void showEnergyDialog(Context context, String userName, String energy) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_energy, null);
((TextView)contentView.findViewById(R.id.userName)).setText("\"" + userName + "\"");
((TextView)contentView.findViewById(R.id.energy)).setText(energy + "");
contentView.findViewById(R.id.dialog_positive).setOnClickListener(v -> {
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showEnergyTaskNoticeDialog(Context context, String title, String content) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_notice, null);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
TextView okTv = contentView.findViewById(R.id.dialog_ok);
if (title == null) {
titleTv.setVisibility(View.GONE);
} else {
titleTv.setVisibility(View.VISIBLE);
titleTv.setText(title);
}
contentTv.setText(content);
okTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font));
okTv.setOnClickListener(v -> {
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
/**
* @param context may be is application context
* @return activity context