AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.ScreenDensityUtil Class Reference

Static Public Member Functions

static float computeCompatibleScaling (Context context)
 

Static Public Attributes

static final int DEFAULT_NORMAL_SHORT_DIMENSION = 320
 
static final float MAXIMUM_ASPECT_RATIO = (854f/480f)
 

Detailed Description

Helper methods for computing scaled sizes for screen compatibility mode

Definition at line 23 of file ScreenDensityUtil.java.

Member Function Documentation

◆ computeCompatibleScaling()

static float com.google.appinventor.components.runtime.util.ScreenDensityUtil.computeCompatibleScaling ( Context  context)
static

Compute the scaling for applications runs under compatibility mode. This code is partially taken from CompatibilityInfo.java from the Android 5.0 source

Parameters
contextContext in the screen to get the density of
Returns
Returns the scaling factor for the window.

Definition at line 43 of file ScreenDensityUtil.java.

Member Data Documentation

◆ DEFAULT_NORMAL_SHORT_DIMENSION

final int com.google.appinventor.components.runtime.util.ScreenDensityUtil.DEFAULT_NORMAL_SHORT_DIMENSION = 320
static

Definition at line 29 of file ScreenDensityUtil.java.

◆ MAXIMUM_ASPECT_RATIO

final float com.google.appinventor.components.runtime.util.ScreenDensityUtil.MAXIMUM_ASPECT_RATIO = (854f/480f)
static

Definition at line 30 of file ScreenDensityUtil.java.


The documentation for this class was generated from the following file: