checkUpdateDimension method

  1. @override
void checkUpdateDimension(
  1. BuildContext uiContext,
  2. VoltronMap dimensionMap,
  3. int windowWidth,
  4. int windowHeight,
  5. bool shouldUseScreenDisplay,
  6. bool systemUiVisibilityChanged,
)
override

Implementation

@override
void checkUpdateDimension(
  BuildContext uiContext,
  VoltronMap dimensionMap,
  int windowWidth,
  int windowHeight,
  bool shouldUseScreenDisplay,
  bool systemUiVisibilityChanged,
) {
  // 如果windowHeight是无效值,则允许客户端定制
  if (windowHeight < 0) {
    deviceAdapter?.reviseDimensionIfNeed(
      uiContext,
      dimensionMap,
      shouldUseScreenDisplay,
      systemUiVisibilityChanged,
    );
  }
  moduleManager
      .getJavaScriptModule<Dimensions>(
        enumValueToString(
          JavaScriptModuleType.Dimensions,
        ),
      )
      ?.set(
        dimensionMap,
      );
}