Register now for Android Dev Summit 2019!

ConfigurationHelper

class ConfigurationHelper
kotlin.Any
   ↳ androidx.core.content.res.ConfigurationHelper

Helper class which allows access to properties of Configuration in a backward compatible fashion.

Summary

Public methods

static Int
getDensityDpi(@NonNull resources: Resources)

Returns the target screen density being rendered to.

Public methods

getDensityDpi

static fun getDensityDpi(@NonNull resources: Resources): Int

Returns the target screen density being rendered to.

Uses Configuration.densityDpi when available, otherwise an approximation is computed and returned.