-
public class DisplayMetricsHolder
Holds an instance of the current DisplayMetrics so we don't have to thread it through all the classes that need it. Note: windowDisplayMetrics are deprecated in favor of ScreenDisplayMetrics: window metrics are supposed to return the drawable area but there's no guarantee that they correspond to the actual size of the ReactRootView. Moreover, they are not consistent with what iOS returns. Screen metrics returns the metrics of the entire screen, is consistent with iOS and should be used instead.
-
-
Method Summary
Modifier and Type Method Description static void
setWindowDisplayMetrics(DisplayMetrics displayMetrics)
static void
initDisplayMetricsIfNotInitialized(Context context)
static void
initDisplayMetrics(Context context)
static DisplayMetrics
getWindowDisplayMetrics()
static void
setScreenDisplayMetrics(DisplayMetrics screenDisplayMetrics)
static DisplayMetrics
getScreenDisplayMetrics()
static WritableMap
getDisplayMetricsWritableMap(double fontScale)
-
-
Method Detail
-
setWindowDisplayMetrics
static void setWindowDisplayMetrics(DisplayMetrics displayMetrics)
-
initDisplayMetricsIfNotInitialized
static void initDisplayMetricsIfNotInitialized(Context context)
-
initDisplayMetrics
static void initDisplayMetrics(Context context)
-
getWindowDisplayMetrics
@Deprecated() static DisplayMetrics getWindowDisplayMetrics()
-
setScreenDisplayMetrics
static void setScreenDisplayMetrics(DisplayMetrics screenDisplayMetrics)
-
getScreenDisplayMetrics
static DisplayMetrics getScreenDisplayMetrics()
-
getDisplayMetricsWritableMap
static WritableMap getDisplayMetricsWritableMap(double fontScale)
-
-
-
-