当前位置: 首页>>代码示例>>Java>>正文


Java UiThreadImmediateExecutorService类代码示例

本文整理汇总了Java中com.facebook.common.executors.UiThreadImmediateExecutorService的典型用法代码示例。如果您正苦于以下问题:Java UiThreadImmediateExecutorService类的具体用法?Java UiThreadImmediateExecutorService怎么用?Java UiThreadImmediateExecutorService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UiThreadImmediateExecutorService类属于com.facebook.common.executors包,在下文中一共展示了UiThreadImmediateExecutorService类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attach

import com.facebook.common.executors.UiThreadImmediateExecutorService; //导入依赖的package包/类
void attach(BitmapUpdateListener listener) {
  mBitmapUpdateListener = listener;

  mAttachCounter++;
  if (mAttachCounter != 1) {
    // this is a secondary attach, ignore it, only updating Bitmap boundaries if needed.
    Bitmap bitmap = getBitmap();
    if (bitmap != null) {
      listener.onSecondaryAttach(bitmap);
    }
    return;
  }

  listener.onImageLoadEvent(ImageLoadEvent.ON_LOAD_START);

  Assertions.assertCondition(mDataSource == null);
  Assertions.assertCondition(mImageRef == null);

  // Submit the request
  ImagePipeline imagePipeline = ImagePipelineFactory.getInstance().getImagePipeline();
  mDataSource = imagePipeline.fetchDecodedImage(mImageRequest, RCTImageView.getCallerContext());
  mDataSource.subscribe(this, UiThreadImmediateExecutorService.getInstance());
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:24,代码来源:PipelineRequestHelper.java

示例2: PipelineDraweeControllerBuilderSupplier

import com.facebook.common.executors.UiThreadImmediateExecutorService; //导入依赖的package包/类
public PipelineDraweeControllerBuilderSupplier(
    Context context,
    ImagePipelineFactory imagePipelineFactory,
    Set<ControllerListener> boundControllerListeners,
    @Nullable DraweeConfig draweeConfig) {
  mContext = context;
  mImagePipeline = imagePipelineFactory.getImagePipeline();

  if (draweeConfig != null && draweeConfig.getPipelineDraweeControllerFactory() != null) {
    mPipelineDraweeControllerFactory = draweeConfig.getPipelineDraweeControllerFactory();
  } else {
    mPipelineDraweeControllerFactory = new PipelineDraweeControllerFactory();
  }
  mPipelineDraweeControllerFactory.init(
      context.getResources(),
      DeferredReleaser.getInstance(),
      imagePipelineFactory.getAnimatedDrawableFactory(context),
      UiThreadImmediateExecutorService.getInstance(),
      mImagePipeline.getBitmapMemoryCache(),
      draweeConfig != null
          ? draweeConfig.getCustomDrawableFactories()
          : null,
      draweeConfig != null
          ? draweeConfig.getDebugOverlayEnabledSupplier()
          : null);
  mBoundControllerListeners = boundControllerListeners;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:PipelineDraweeControllerBuilderSupplier.java

示例3: VolleyDraweeControllerBuilderSupplier

import com.facebook.common.executors.UiThreadImmediateExecutorService; //导入依赖的package包/类
public VolleyDraweeControllerBuilderSupplier(
    Context context,
    ImageLoader imageLoader,
    Set<ControllerListener> boundControllerListeners) {
  mContext = context;
  mImageLoader = imageLoader;
  mVolleyDraweeControllerFactory = new VolleyDraweeControllerFactory(
      context.getResources(),
      DeferredReleaser.getInstance(),
      UiThreadImmediateExecutorService.getInstance());
  mBoundControllerListeners = boundControllerListeners;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:VolleyDraweeControllerBuilderSupplier.java

示例4: createDrawableFactory

import com.facebook.common.executors.UiThreadImmediateExecutorService; //导入依赖的package包/类
private ExperimentalBitmapAnimationDrawableFactory createDrawableFactory() {
  Supplier<Integer> cachingStrategySupplier = new Supplier<Integer>() {
    @Override
    public Integer get() {
      return ExperimentalBitmapAnimationDrawableFactory.CACHING_STRATEGY_FRESCO_CACHE_NO_REUSING;
    }
  };

  final SerialExecutorService serialExecutorServiceForFramePreparing =
      new DefaultSerialExecutorService(mExecutorSupplier.forDecode());

  Supplier<Integer> numberOfFramesToPrepareSupplier = new Supplier<Integer>() {
    @Override
    public Integer get() {
      return NUMBER_OF_FRAMES_TO_PREPARE;
    }
  };

  return new ExperimentalBitmapAnimationDrawableFactory(
      getAnimatedDrawableBackendProvider(),
      UiThreadImmediateExecutorService.getInstance(),
      serialExecutorServiceForFramePreparing,
      RealtimeSinceBootClock.get(),
      mPlatformBitmapFactory,
      mBackingCache,
      cachingStrategySupplier,
      numberOfFramesToPrepareSupplier);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:29,代码来源:AnimatedFactoryV2Impl.java

示例5: wrapAnimationBackendWithInactivityCheck

import com.facebook.common.executors.UiThreadImmediateExecutorService; //导入依赖的package包/类
/**
 * Wraps the given animation backend with an activity check.
 * When no frame has been drawn for more than 2 seconds, an inactivity toast message will
 * be displayed.
 *
 * @param context the context to be used for displaying the toast message
 * @param animationBackend the backend to wrap with the inactivity check
 * @return the wrapped backend to use
 */
public static AnimationBackend wrapAnimationBackendWithInactivityCheck(
    final Context context,
    final AnimationBackend animationBackend) {
  AnimationBackendDelegateWithInactivityCheck.InactivityListener inactivityListener =
      new AnimationBackendDelegateWithInactivityCheck.InactivityListener() {
        @Override
        public void onInactive() {
          // Forward the inactive callback to the backend if needed
          if (animationBackend instanceof
              AnimationBackendDelegateWithInactivityCheck.InactivityListener) {
            ((AnimationBackendDelegateWithInactivityCheck.InactivityListener) animationBackend)
                .onInactive();
          }
          Toast.makeText(
              context,
              "Animation backend inactive.",
              Toast.LENGTH_SHORT)
              .show();
        }
      };
  return createForBackend(
      animationBackend,
      inactivityListener,
      RealtimeSinceBootClock.get(),
      UiThreadImmediateExecutorService.getInstance());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:36,代码来源:AnimationBackendUtils.java

示例6: get

import com.facebook.common.executors.UiThreadImmediateExecutorService; //导入依赖的package包/类
public void get() {
    ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(imageUrl))
            .build();
    ImagePipeline imagePipeline = Fresco.getImagePipeline();
    DataSource<CloseableReference<CloseableImage>> dataSource
            = imagePipeline.fetchDecodedImage(request, WikipediaApp.getInstance());
    dataSource.subscribe(new BitmapDataSubscriber(), UiThreadImmediateExecutorService.getInstance());
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:9,代码来源:ImagePipelineBitmapGetter.java


注:本文中的com.facebook.common.executors.UiThreadImmediateExecutorService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。