Struct android_manifest::Screen[][src]

pub struct Screen {
    pub screen_size: ScreenSize,
    pub screen_density: String,
}
Expand description

Specifies a single screen configuration with which the application is compatible.

At least one instance of this element must be placed inside the <compatible-screens> element. This element must include both the android:screenSize and android:screenDensity attributes (if you do not declare both attributes, then the element is ignored).

XML Example

If your application is compatible with only small and normal screens, regardless of screen density, then you must specify twelve different elements, because each screen size has six different density configurations. You must declare each one of these; any combination of size and density that you do not specify is considered a screen configuration with which your application is not compatible. Here’s what the manifest entry looks like if your application is compatible with only small and normal screens:

<manifest ... >
    ...
    <compatible-screens>
       <!-- all small size screens -->
       <screen android:screenSize="small" android:screenDensity="ldpi" />
       <screen android:screenSize="small" android:screenDensity="mdpi" />
       <screen android:screenSize="small" android:screenDensity="hdpi" />
       <screen android:screenSize="small" android:screenDensity="xhdpi" />
       <screen android:screenSize="small" android:screenDensity="xxhdpi" />
       <screen android:screenSize="small" android:screenDensity="xxxhdpi" />
       <!-- all normal size screens -->
       <screen android:screenSize="normal" android:screenDensity="ldpi" />
       <screen android:screenSize="normal" android:screenDensity="mdpi" />
       <screen android:screenSize="normal" android:screenDensity="hdpi" />
       <screen android:screenSize="normal" android:screenDensity="xhdpi" />
       <screen android:screenSize="normal" android:screenDensity="xxhdpi" />
       <screen android:screenSize="normal" android:screenDensity="xxxhdpi" />
    </compatible-screens>
    <application ... >
       ...
    <application>
</manifest>

Contained in: <compatible-screens>

Fields

screen_size: ScreenSize

Required. Specifies the screen size for this screen configuration.

For information about the different screen sizes, see Supporting Multiple Screens.

screen_density: String

Required. Specifies the screen density for this screen configuration.

For information about the different screen densities, see Supporting Multiple Screens.

Accepted values:

  • “ldpi” (approximately 120 dpi)
  • “mdpi” (approximately 160 dpi)
  • “hdpi” (approximately 240 dpi)
  • “xhdpi” (approximately 320 dpi)
  • “280”
  • “360”
  • “420”
  • “480”
  • “560”

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.