Java 类com.facebook.react.bridge.MemoryPressure 实例源码

项目:RNLearn_Project1    文件:CatalystInstanceImpl.java   
@Override
public void handleMemoryPressure(MemoryPressure level) {
  if (mDestroyed) {
    return;
  }
  switch (level) {
    case UI_HIDDEN:
      handleMemoryPressureUiHidden();
      break;
    case MODERATE:
      handleMemoryPressureModerate();
      break;
    case CRITICAL:
      handleMemoryPressureCritical();
      break;
  }
}
项目:RNLearn_Project1    文件:CatalystInstanceImpl.java   
@Override
public void handleMemoryPressure(MemoryPressure level) {
  if (mDestroyed) {
    return;
  }
  switch (level) {
    case UI_HIDDEN:
      handleMemoryPressureUiHidden();
      break;
    case MODERATE:
      handleMemoryPressureModerate();
      break;
    case CRITICAL:
      handleMemoryPressureCritical();
      break;
  }
}
项目:Ironman    文件:CatalystInstanceImpl.java   
@Override
public void handleMemoryPressure(MemoryPressure level) {
  if (mDestroyed) {
    return;
  }
  switch(level) {
    case UI_HIDDEN:
      handleMemoryPressureUiHidden();
      break;
    case MODERATE:
      handleMemoryPressureModerate();
      break;
    case CRITICAL:
      handleMemoryPressureCritical();
      break;
  }
}
项目:RNLearn_Project1    文件:MemoryPressureRouter.java   
private void trimMemory(int level) {
  if (level >= TRIM_MEMORY_COMPLETE) {
    dispatchMemoryPressure(MemoryPressure.CRITICAL);
  } else if (level >= TRIM_MEMORY_BACKGROUND || level == TRIM_MEMORY_RUNNING_CRITICAL) {
    dispatchMemoryPressure(MemoryPressure.MODERATE);
  } else if (level == TRIM_MEMORY_UI_HIDDEN) {
    dispatchMemoryPressure(MemoryPressure.UI_HIDDEN);
  }
}
项目:RNLearn_Project1    文件:MemoryPressureRouter.java   
private void dispatchMemoryPressure(MemoryPressure level) {
  // copy listeners array to avoid ConcurrentModificationException if any of the listeners remove
  // themselves in handleMemoryPressure()
  MemoryPressureListener[] listeners =
    mListeners.toArray(new MemoryPressureListener[mListeners.size()]);
  for (MemoryPressureListener listener : listeners) {
    listener.handleMemoryPressure(level);
  }
}
项目:RNLearn_Project1    文件:MemoryPressureRouter.java   
private void trimMemory(int level) {
  if (level >= TRIM_MEMORY_COMPLETE) {
    dispatchMemoryPressure(MemoryPressure.CRITICAL);
  } else if (level >= TRIM_MEMORY_BACKGROUND || level == TRIM_MEMORY_RUNNING_CRITICAL) {
    dispatchMemoryPressure(MemoryPressure.MODERATE);
  } else if (level == TRIM_MEMORY_UI_HIDDEN) {
    dispatchMemoryPressure(MemoryPressure.UI_HIDDEN);
  }
}
项目:RNLearn_Project1    文件:MemoryPressureRouter.java   
private void dispatchMemoryPressure(MemoryPressure level) {
  // copy listeners array to avoid ConcurrentModificationException if any of the listeners remove
  // themselves in handleMemoryPressure()
  MemoryPressureListener[] listeners =
    mListeners.toArray(new MemoryPressureListener[mListeners.size()]);
  for (MemoryPressureListener listener : listeners) {
    listener.handleMemoryPressure(level);
  }
}
项目:ReactNativeSignatureExample    文件:MemoryPressureRouter.java   
private void trimMemory(int level) {
  if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
    dispatchMemoryPressure(MemoryPressure.CRITICAL);
  } else if (level >= TRIM_MEMORY_BACKGROUND || level == TRIM_MEMORY_RUNNING_CRITICAL) {
    dispatchMemoryPressure(MemoryPressure.MODERATE);
  }
}
项目:ReactNativeSignatureExample    文件:MemoryPressureRouter.java   
private void dispatchMemoryPressure(MemoryPressure level) {
  // copy listeners array to avoid ConcurrentModificationException if any of the listeners remove
  // themselves in handleMemoryPressure()
  MemoryPressureListener[] listeners =
    mListeners.toArray(new MemoryPressureListener[mListeners.size()]);
  for (MemoryPressureListener listener : listeners) {
    listener.handleMemoryPressure(level);
  }
}
项目:react-native-ibeacon-android    文件:MemoryPressureRouter.java   
private void trimMemory(int level) {
  if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
    dispatchMemoryPressure(MemoryPressure.CRITICAL);
  } else if (level >= TRIM_MEMORY_BACKGROUND || level == TRIM_MEMORY_RUNNING_CRITICAL) {
    dispatchMemoryPressure(MemoryPressure.MODERATE);
  }
}
项目:react-native-ibeacon-android    文件:MemoryPressureRouter.java   
private void dispatchMemoryPressure(MemoryPressure level) {
  // copy listeners array to avoid ConcurrentModificationException if any of the listeners remove
  // themselves in handleMemoryPressure()
  MemoryPressureListener[] listeners =
    mListeners.toArray(new MemoryPressureListener[mListeners.size()]);
  for (MemoryPressureListener listener : listeners) {
    listener.handleMemoryPressure(level);
  }
}
项目:react-native-box-loaders    文件:MemoryPressureRouter.java   
private void trimMemory(int level) {
  if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
    dispatchMemoryPressure(MemoryPressure.CRITICAL);
  } else if (level >= TRIM_MEMORY_BACKGROUND || level == TRIM_MEMORY_RUNNING_CRITICAL) {
    dispatchMemoryPressure(MemoryPressure.MODERATE);
  }
}
项目:react-native-box-loaders    文件:MemoryPressureRouter.java   
private void dispatchMemoryPressure(MemoryPressure level) {
  // copy listeners array to avoid ConcurrentModificationException if any of the listeners remove
  // themselves in handleMemoryPressure()
  MemoryPressureListener[] listeners =
    mListeners.toArray(new MemoryPressureListener[mListeners.size()]);
  for (MemoryPressureListener listener : listeners) {
    listener.handleMemoryPressure(level);
  }
}
项目:Ironman    文件:MemoryPressureRouter.java   
private void trimMemory(int level) {
  if (level >= TRIM_MEMORY_COMPLETE) {
    dispatchMemoryPressure(MemoryPressure.CRITICAL);
  } else if (level >= TRIM_MEMORY_BACKGROUND || level == TRIM_MEMORY_RUNNING_CRITICAL) {
    dispatchMemoryPressure(MemoryPressure.MODERATE);
  } else if (level == TRIM_MEMORY_UI_HIDDEN) {
    dispatchMemoryPressure(MemoryPressure.UI_HIDDEN);
  }
}
项目:Ironman    文件:MemoryPressureRouter.java   
private void dispatchMemoryPressure(MemoryPressure level) {
  // copy listeners array to avoid ConcurrentModificationException if any of the listeners remove
  // themselves in handleMemoryPressure()
  MemoryPressureListener[] listeners =
    mListeners.toArray(new MemoryPressureListener[mListeners.size()]);
  for (MemoryPressureListener listener : listeners) {
    listener.handleMemoryPressure(level);
  }
}