次の方法で共有


IWindowManager.MaximumWindowMetrics Property

Definition

Returns the largest WindowMetrics an app may expect in the current system state.

public virtual Android.Views.WindowMetrics MaximumWindowMetrics { [Android.Runtime.Register("getMaximumWindowMetrics", "()Landroid/view/WindowMetrics;", "GetGetMaximumWindowMetricsHandler:Android.Views.IWindowManager, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=30)] get; }
[<get: Android.Runtime.Register("getMaximumWindowMetrics", "()Landroid/view/WindowMetrics;", "GetGetMaximumWindowMetricsHandler:Android.Views.IWindowManager, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=30)>]
member this.MaximumWindowMetrics : Android.Views.WindowMetrics

Property Value

Attributes

Remarks

Returns the largest WindowMetrics an app may expect in the current system state.

The value of this is based on the largest <b>potential</b> windowing state of the system.

For example, for activities in multi-window mode, the metrics returned are based on the what the bounds would be if the user expanded the android.app.Activity Activity's task to cover the entire screen.

The metrics describe the size of the largest potential area the window might occupy with LayoutParams#MATCH_PARENT MATCH_PARENT width and height, and the WindowInsets such a window would have.

Note that this might still be smaller than the size of the physical display if certain areas of the display are not available to windows created in this Context.

For example, given that there's a device which have a multi-task mode to limit activities to a half screen. In this case, #getMaximumWindowMetrics() reports the bounds of the half screen which the activity is located.

<b>Generally #getCurrentWindowMetrics() is the correct API to use</b> for choosing UI layouts. #getMaximumWindowMetrics() are only appropriate when the application needs to know the largest possible size it can occupy if the user expands/maximizes it on the screen.

Java documentation for android.view.WindowManager.getMaximumWindowMetrics().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to