I'm trying to locate my dialog in a specific location on screen. Here is my dialog implementation :
public class DayDialog extends android.support.v4.app.DialogFragment {
public static DayDialog newInstance() {
DayDialog f = new DayDialog();
f.setCancelable(true);
f.setStyle(STYLE_NO_TITLE, 0);
return f;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View layout = inflater.inflate(R.layout.dialog_calendar_day, container);
WindowManager.LayoutParams params = getDialog().getWindow()
.getAttributes();
params.gravity = Gravity.TOP | Gravity.LEFT;
params.x = 0;//b.getInt("x");
params.y = 0;//b.getInt("y");
getDialog().getWindow().setAttributes(params);
return layout;
}
here is how my dialog shown! how can I locate it (0,0) ? it's like there is a frame or something around it!