Example usage for android.view Gravity FILL_VERTICAL

List of usage examples for android.view Gravity FILL_VERTICAL

Introduction

In this page you can find the example usage for android.view Gravity FILL_VERTICAL.

Prototype

int FILL_VERTICAL

To view the source code for android.view Gravity FILL_VERTICAL.

Click Source Link

Document

Grow the vertical size of the object if needed so it completely fills its container.

Usage

From source file:org.catrobat.catroid.ui.dialogs.AddBrickDialog.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.dialog_brick_add, null);

    ImageButton closeButton = (ImageButton) rootView.findViewById(R.id.dialog_brick_title_button_close);
    TextView textView = (TextView) rootView.findViewById(R.id.dialog_brick_title_text_view_title);
    listView = (ListView) rootView.findViewById(R.id.dialog_brick_add_list_view);

    closeButton.setOnClickListener(new View.OnClickListener() {
        @Override/*from w w  w. j a va2 s .co  m*/
        public void onClick(View v) {
            dismiss();
        }
    });

    textView.setText(selectedCategory);

    Window window = getDialog().getWindow();
    window.requestFeature(Window.FEATURE_NO_TITLE);
    window.setGravity(Gravity.CENTER | Gravity.FILL_HORIZONTAL | Gravity.FILL_VERTICAL);
    window.setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    return rootView;
}