| | |
| | | |
| | | package com.hdl.photovoltaic.widget; |
| | | |
| | | import android.app.Dialog; |
| | | import android.content.Context; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.os.Bundle; |
| | |
| | | private int mMillisecond = 1500; |
| | | |
| | | public FlashingBoxDialog(@NonNull Context context) { |
| | | super(context, R.style.Custom_Dialog); |
| | | super(context, R.style.Custom_List_Dialog); |
| | | } |
| | | |
| | | /** |
| | |
| | | super.onCreate(savedInstanceState); |
| | | viewBinding = DialogFlashingBoxBinding.inflate(getLayoutInflater()); |
| | | setContentView(viewBinding.getRoot()); |
| | | if (this.mDrawable != null) { |
| | | viewBinding.tipImageTv.setBackground(this.mDrawable); |
| | | } |
| | | |
| | | if (!TextUtils.isEmpty(this.mContentStr)) { |
| | | viewBinding.tipContentTv.setText(this.mContentStr); |
| | | } |
| | | flashing(); |
| | | } |
| | | |
| | | /** |
| | | * 设置图标 |
| | | * |
| | | * @param drawable 成功或者失败图标 |
| | | */ |
| | | public void setImage(Drawable drawable) { |
| | | this.mDrawable = drawable; |
| | | if (viewBinding != null && this.mDrawable != null) { |
| | | viewBinding.tipImageTv.setBackground(drawable); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置提示文本 |