mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 16:35:33 +00:00
34 lines
703 B
Markdown
34 lines
703 B
Markdown
---
|
|
title: KMManager.getWindowDensity()
|
|
---
|
|
|
|
## Summary
|
|
|
|
The `getWindowDensity()` method returns the density of the window.
|
|
|
|
## Syntax
|
|
|
|
```java
|
|
KMManager.getWindowDensity(Context context)
|
|
```
|
|
|
|
`context`
|
|
: The context.
|
|
|
|
### Returns
|
|
Returns the density
|
|
|
|
## Description
|
|
Use this method to get the [density](https://developer.android.com/reference/android/util/DisplayMetrics#density) of the window. This is a scaling factor for the Density Independent Pixel (DIP) unit.
|
|
|
|
## Examples
|
|
|
|
### Example: Using `getWindowDensity()`
|
|
|
|
The following code illustrates the use of `getWindowDensity()`:
|
|
```java
|
|
float density = KMManager.getWindowDensity(context);
|
|
```
|
|
|
|
## See Also
|
|
* [getWindowSize](getWindowSize)
|