Package com.inmobi.commons.utils.info
Object DisplayInfo
-
- All Implemented Interfaces:
public class DisplayInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interfaceDisplayInfo.ORIENTATION_VALUESpublic @interfaceDisplayInfo.NavigationBarRepresents the different types of Navigation bar that Android devices have. Note - The two and three button navigation bar are treated same as NavigationBar.BUTTON and the gesture navigation bar is treated as NavigationBar.GESTURE
public final classDisplayInfo.Size
-
Field Summary
Fields Modifier and Type Field Description public final static StringOLD_SHARED_PREF_FILEpublic final static StringSHARED_PREF_FILEpublic final static StringPREF_KEY_GESTURE_MARGINpublic final static StringPREF_KEY_SAFE_AREApublic final static StringPREF_KEY_NAV_BARpublic final static StringSETTINGS_NAVIGATION_MODEprivate final FloatdeviceDensityprivate JSONObjectsafeAreaprivate IntegernavBarTypeViaInsetsprivate final DisplayPropertiesdisplayPropertiesprivate final DisplayPropertiesrealDisplayPropertiesprivate final Byteorientationprivate final Map<String, String>displayInfoMapprivate final StringgestureMarginsprivate final BooleanisImmersiveCapablepublic final static DisplayInfoINSTANCE
-
Method Summary
-
-
Method Detail
-
initDisplayInfo
@WorkerThread() final Unit initDisplayInfo()
-
convertDpToPixels
final Integer convertDpToPixels(Integer dpUnits)
-
convertPixelsToDp
final static Integer convertPixelsToDp(Integer pixels)
-
convertPixelsToDp
final static Float convertPixelsToDp(Float pixels)
-
computeDefaultTextSize
@UiThread() final Unit computeDefaultTextSize(Context context)
-
updateInsets
@RequiresApi(api = 29)@Deprecated(message = "This method is deprecated and will be removed in future releases") final static Unit updateInsets(Context context)
-
storeGestureMargins
@RequiresApi(api = 29)@Deprecated(message = "This method is deprecated and will be removed in future releases") final Unit storeGestureMargins(Context context, WindowInsets insets)
-
getScreenSize
final DisplayInfo.Size getScreenSize(Context context)
-
getRealScreenSize
final DisplayInfo.Size getRealScreenSize(Context context)
-
getNavigationBarTypeViaSettings
final Integer getNavigationBarTypeViaSettings()
Gets the type of navigation bar that the device has.
- Returns:
NavigationBar.BUTTON if the device has a two or three button navigation bar, NavigationBar.GESTURE if the device has a gesture navigation bar, null if the type cannot be determined.
-
getNavigationBarTypeByInsets
final Integer getNavigationBarTypeByInsets(WindowInsets insets)
Gets the type of navigation bar via WindowInsets. This method is used only when getNavigationBarTypeViaSettings returns null.
- Parameters:
insets- The WindowInsets object that contains the information about the insets.
-
putSafeArea
final Unit putSafeArea(Map<Integer, JSONObject> value)
-
putNavigationBarType
final Unit putNavigationBarType(Integer value)
-
replenishSafeAreaInMemory
final Unit replenishSafeAreaInMemory()
-
replenishNavigationBarTypeInMemory
final Unit replenishNavigationBarTypeInMemory()
-
getDeviceDensity
final Float getDeviceDensity()
-
getSafeArea
final JSONObject getSafeArea()
-
setSafeArea
final Unit setSafeArea(JSONObject safeArea)
-
getNavBarTypeViaInsets
final Integer getNavBarTypeViaInsets()
-
setNavBarTypeViaInsets
final Unit setNavBarTypeViaInsets(Integer navBarTypeViaInsets)
-
getDisplayProperties
final DisplayProperties getDisplayProperties()
-
getRealDisplayProperties
final DisplayProperties getRealDisplayProperties()
-
getOrientation
final Byte getOrientation()
-
getDisplayInfoMap
final Map<String, String> getDisplayInfoMap()
-
getGestureMargins
final String getGestureMargins()
-
isImmersiveCapable
final Boolean isImmersiveCapable()
-
-
-
-