BottomDialog.java 735 B

12345678910111213141516171819202122232425262728
  1. package com.zqx.kedaxunfei.view;
  2. import android.app.Dialog;
  3. import android.content.Context;
  4. import android.view.Gravity;
  5. import android.view.Window;
  6. import android.view.WindowManager;
  7. import com.zqx.kedaxunfei.R;
  8. /**
  9. * Created by ZhangQixiang on 2017/1/5.
  10. */
  11. public class BottomDialog extends Dialog {
  12. public BottomDialog(Context context) {
  13. super(context, R.style.dialog_bottom_style);
  14. Window window = getWindow();
  15. if (window != null) {
  16. WindowManager.LayoutParams attributes = window.getAttributes();
  17. attributes.height = WindowManager.LayoutParams.WRAP_CONTENT;
  18. attributes.gravity = Gravity.BOTTOM;
  19. window.setAttributes(attributes);
  20. }
  21. }
  22. }