Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.app.Dialog;

import android.content.Context;

import android.view.WindowManager;

public class Main {
    /**
     * update Window attributes
     * 
     * windowParams.width = WindowManager.LayoutParams.MATCH_PARENT
     * windowParams.height = WindowManager.LayoutParams.WRAP_CONTENT
     *
     * @param context
     * @param d
     */
    public static void updatewWindowParamsWH4PupfromBottom(Context context, Dialog d) {
        if (null == d)
            return;

        WindowManager.LayoutParams windowParams = d.getWindow().getAttributes();
        if (null == windowParams)
            return;

        windowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
        windowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
        d.getWindow().setAttributes(windowParams);
    }
}