| | |
| | | import android.annotation.SuppressLint; |
| | | import android.app.Dialog; |
| | | import android.content.Context; |
| | | import android.graphics.Color; |
| | | import android.graphics.PixelFormat; |
| | | import android.graphics.drawable.ColorDrawable; |
| | | import android.os.Bundle; |
| | | import android.view.Gravity; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.view.Window; |
| | | import android.view.WindowManager; |
| | | import android.widget.LinearLayout; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | |
| | | import com.hdl.photovoltaic.widget.adapter.TypeListDialogAdapter; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.dcloud.common.util.DensityUtils; |
| | | |
| | | public class TypeTitleListDialog extends BaseDialog { |
| | | |
| | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | protected void onStart() { |
| | | super.onStart(); |
| | | // 获取窗口对象 |
| | | Window dialogWindow = this.getWindow(); |
| | | if (dialogWindow != null) { |
| | | // 获取对话框当前的参数值 |
| | | WindowManager.LayoutParams p = dialogWindow.getAttributes(); |
| | | p.width = LinearLayout.LayoutParams.MATCH_PARENT; |
| | | p.height = LinearLayout.LayoutParams.WRAP_CONTENT; |
| | | p.dimAmount = 0.6f; |
| | | dialogWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); |
| | | p.gravity = Gravity.BOTTOM; |
| | | p.y = DensityUtils.dip2px(mContext, 70); |
| | | // //这里设置的宽高优先级高于XML中的布局设置 |
| | | // if (this.enumBoxType == BoxType.PhotoAlbumBox) { |
| | | // p.gravity = Gravity.BOTTOM; |
| | | // } else if (this.enumBoxType == BoxType.FlashingBox) { |
| | | // p.dimAmount = 0f; |
| | | // } |
| | | // 设置到属性配置中 |
| | | dialogWindow.setAttributes(p); |
| | | } |
| | | |
| | | } |
| | | |