package com.rv.home.rv.module.ui.main.home.dialog;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.ViewGroup;

import com.ruiwenliu.wrapper.dialog.BaseDialog;
import com.rv.home.R;
import com.rv.home.R2;

/**
 * Created :Auser
 * Date: 2019/5/16.
 * Desc:选择属性Dialog
 */

public class SelectAttributeDialog extends BaseDialog {
    public SelectAttributeDialog(@NonNull Context context) {
        super(context);
        setDialogParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.MATCH_PARENT,Gravity.RIGHT);
    }

//    public void showDialog(View view){
//        Window window=this.getWindow();
//        WindowManager.LayoutParams wlp = window.getAttributes();
//        int notificationBar = Resources.getSystem().getDimensionPixelSize(Resources.getSystem().getIdentifier("status_bar_height", "dimen", "android"));
//        int[] location = new int[2] ;
//        view.getLocationInWindow(location); //获取在当前窗体内的绝对坐标
//        view.getLocationOnScreen(location);//获取在整个屏幕内的绝对坐标
//        wlp.x=0;//对 dialog 设置 x 轴坐标
//        wlp.y = location [1] + view.getHeight()- notificationBar; //对dialog设置y轴坐标
//        wlp.gravity = Gravity.TOP;
//        wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
//        window.setAttributes(wlp);
//        show();
//    }

    @Override
    public int getViewLayout() {
        return R.layout.rv_dialog_select_attribute;
    }


}
