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


Java Fresco.initialize方法代码示例

本文整理汇总了Java中com.facebook.drawee.backends.pipeline.Fresco.initialize方法的典型用法代码示例。如果您正苦于以下问题:Java Fresco.initialize方法的具体用法?Java Fresco.initialize怎么用?Java Fresco.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.drawee.backends.pipeline.Fresco的用法示例。


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

示例1: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    if (LeakCanary.isInAnalyzerProcess(this)) {
        return;
    }
    if(CommonConfig.DEBUG){
        LeakCanary.install(this);
        ARouter.openLog();     // 打印日志
        ARouter.openDebug();   // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险)
    }

    ARouter.init(this);
    //CrashReport.initCrashReport(getApplicationContext(), "93f0e37549", CommonConfig.DEBUG);
    Fresco.initialize(this);
    GlobalAppComponent.init(this);
}
 
开发者ID:liu-xiao-dong,项目名称:JD-Test,代码行数:18,代码来源:MyApplication.java

示例2: initialize

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void initialize() {
  super.initialize();
  getReactApplicationContext().addLifecycleEventListener(this);
  if (!hasBeenInitialized()) {
    // Make sure the SoLoaderShim is configured to use our loader for native libraries.
    // This code can be removed if using Fresco from Maven rather than from source
    SoLoaderShim.setHandler(new FrescoHandler());
    if (mConfig == null) {
      mConfig = getDefaultConfig(getReactApplicationContext());
    }
    Context context = getReactApplicationContext().getApplicationContext();
    Fresco.initialize(context, mConfig);
    sHasBeenInitialized = true;
  } else if (mConfig != null) {
    FLog.w(
        ReactConstants.TAG,
        "Fresco has already been initialized with a different config. "
        + "The new Fresco configuration will be ignored!");
  }
  mConfig = null;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:23,代码来源:FrescoModule.java

示例3: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Fresco.initialize(this);//Init Fresco
    applicationComponent = DaggerApplicationComponent.builder()
            .applicationModule(new ApplicationModule(this))
            .contextModule(new ContextModule(this))
            .databaseModule(new DatabaseModule())
            .networkModule(new NetworkModule())
            .build();
    applicationComponent.inject(this);
    CalligraphyConfig.initDefault(calligraphyConfig);
    Timber.plant(new Timber.DebugTree());
    LeakCanary.install(this);

}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:17,代码来源:DouApp.java

示例4: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
  super.onCreate();
  final Config config = Config.load(this);
  ImagePipelineConfig.Builder imagePipelineConfigBuilder = ImagePipelineConfig.newBuilder(this)
      .setResizeAndRotateEnabledForNetwork(false)
      .setDownsampleEnabled(config.downsampling);
  if (WebpSupportStatus.sIsWebpSupportRequired) {
    imagePipelineConfigBuilder.experiment().setWebpSupportEnabled(config.webpSupportEnabled);
  }
  if (config.decodingThreadCount == 0) {
    imagePipelineConfigBuilder.setExecutorSupplier(
        new DefaultExecutorSupplier(Const.NUMBER_OF_PROCESSORS));
  } else {
    imagePipelineConfigBuilder.setExecutorSupplier(
        new ScrollPerfExecutorSupplier(Const.NUMBER_OF_PROCESSORS, config.decodingThreadCount));
  }
  imagePipelineConfigBuilder.experiment().setDecodeCancellationEnabled(config.decodeCancellation);
  DraweeConfig draweeConfig = DraweeConfig.newBuilder()
      .setDrawDebugOverlay(config.draweeOverlayEnabled)
      .build();
  Fresco.initialize(this, imagePipelineConfigBuilder.build(), draweeConfig);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:ScrollPerfApplication.java

示例5: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
  public void onCreate() {
    super.onCreate();
//    initDebugEnvironment(true, false, "DEBUG_SERVER_HOST");
    WXSDKEngine.addCustomOptions("appName", "WXSample");
    WXSDKEngine.addCustomOptions("appGroup", "WXApp");
    WXSDKEngine.initialize(this,
        new InitConfig.Builder()
            .setImgAdapter(new ImageAdapter())
            .build()
    );

    try {
      WXSDKEngine.registerModule("event", WXEventModule.class);
    } catch (WXException e) {
      e.printStackTrace();
    }
    Fresco.initialize(this);
    AppConfig.init(this);
    PluginManager.init(this);
  }
 
开发者ID:coderminer,项目名称:GankIO_weex,代码行数:22,代码来源:WXApplication.java

示例6: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
	public void onCreate() {
		super.onCreate();
//    initDebugEnvironment(true, false, "DEBUG_SERVER_HOST");

		WXSDKEngine.addCustomOptions("appName", "NatExplorer");
		WXSDKEngine.addCustomOptions("appGroup", "Nat");
		WXSDKEngine.initialize(this,
				new InitConfig.Builder()
						.setImgAdapter(new ImageAdapter())
						.build()
		);

		AVOSCloud.useAVCloudUS();
		AVOSCloud.initialize(this, ApiKey.LC_APPID, ApiKey.LC_APPKEY);
		AVAnalytics.enableCrashReport(this, true);

		try {
			WXSDKEngine.registerModule("event", EventModule.class);
			WXSDKEngine.registerModule("navigator", NavigatorModule.class);
		} catch (WXException e) {
			e.printStackTrace();
		}
		Fresco.initialize(this);
		AppConfig.init(this);
		PluginManager.init(this);
	}
 
开发者ID:natjs,项目名称:nat-explorer,代码行数:28,代码来源:WXApplication.java

示例7: NetworkModule

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
public NetworkModule(Context context) {
    final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
    interceptor.setLevel(BuildConfig.DEBUG ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE);
    final OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
    bind(OkHttpClient.class).toInstance(client);
    final Moshi moshi = new Moshi.Builder().add(MoshiJsonAdapterFactory.create()).build();
    bind(Moshi.class).toInstance(moshi);
    final ImagePipelineConfig config = OkHttpImagePipelineConfigFactory.newBuilder(context, client).build();
    Fresco.initialize(context, config);
}
 
开发者ID:wongcain,项目名称:okuki,代码行数:11,代码来源:NetworkModule.java

示例8: FrescoAdapter

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
public FrescoAdapter(
    Context context,
    PerfListener perfListener,
    ImagePipelineConfig imagePipelineConfig) {
  super(context, perfListener);
  Fresco.initialize(context, imagePipelineConfig);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:FrescoAdapter.java

示例9: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    Fresco.initialize(this);

    initialiseLogger();
    initAppComponent();
}
 
开发者ID:alicanozkara,项目名称:PokemonCards,代码行数:10,代码来源:App.java

示例10: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Fresco.initialize(this);
    Twitter.initialize(this);
    DCSharedPreferences.initialize(this);
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:8,代码来源:DCApplication.java

示例11: initFresco

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
public void initFresco(){
    String sign = PreferencesHelper.getCookie();
    DiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder(mContext)
            .setBaseDirectoryPath(mContext.getFilesDir())
            .setBaseDirectoryName("image_cache")
            .setMaxCacheSize(50 * ByteConstants.MB)
            .setMaxCacheSizeOnLowDiskSpace(10 * ByteConstants.MB)
            .setMaxCacheSizeOnVeryLowDiskSpace(2 * ByteConstants.MB)
            .build();
    ImagePipelineConfig config = ImagePipelineConfig.newBuilder(mContext)
            .setNetworkFetcher(new ElnImageDownloaderFetcher(sign,mContext))
            .setMainDiskCacheConfig(diskCacheConfig).build();
    Fresco.initialize(mContext, config);
}
 
开发者ID:ebridfighter,项目名称:GongXianSheng,代码行数:15,代码来源:FrecoFactory.java

示例12: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    MultiDex.install(this);
    //init firebase
    FirebaseDatabase.getInstance().setPersistenceEnabled(true);

    Fresco.initialize(this, ImagePipelineConfigFactory.getImagePipelineConfig(this));
}
 
开发者ID:Elbehiry,项目名称:Viajes,代码行数:10,代码来源:HotelApp.java

示例13: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Fresco.initialize(this);//Init Fresco
    applicationComponent = DaggerApplicationComponent.builder()
            .applicationModule(new ApplicationModule(this))
            .contextModule(new ContextModule(this))
            .databaseModule(new DatabaseModule())
            .networkModule(new NetworkModule())
            .build();
    applicationComponent.inject(this);
    CalligraphyConfig.initDefault(calligraphyConfig);
    Timber.plant(new Timber.DebugTree());
}
 
开发者ID:graviton57,项目名称:TheNounProject,代码行数:15,代码来源:TheNounProjectApp.java

示例14: init

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
/**
 * 初始化配置
 *
 * @param context Context对象
 */
public void init(Context context) {

    ImagePipelineConfig imagePipelineConfig = ImagePipelineConfig.newBuilder(context)
            .setDownsampleEnabled(true)
            .setBitmapsConfig(Bitmap.Config.RGB_565)
            .setResizeAndRotateEnabledForNetwork(true)
            .build();
    Fresco.initialize(context, imagePipelineConfig);
}
 
开发者ID:zhonglikui,项目名称:cardinalsSample,代码行数:15,代码来源:FrescoManager.java

示例15: onCreate

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    mContext = getApplicationContext();

    MultiDex.install(getApplicationContext());

    baseComponent = DaggerBaseComponent.builder()
            .baseModule(new BaseModule())
            .build();

    BaseApi.init();

    //AndroidTools initialization
    AndroidTools.init(getApplicationContext(), getLogTag());

    //OkHttpClient initialization
    MyOkHttpClient.init(getApplicationContext());

    //Fresco initialization
    Fresco.initialize(getApplicationContext(),
            ImagePipelineFactory.imagePipelineConfig(getApplicationContext()
                    , MyOkHttpClient.provideOkHttpClient()
                    , getCacheDir().getAbsolutePath()));

    //UMeng initialization
    MobclickAgent.setDebugMode(BuildConfig.IS_TEST);
    MobclickAgent.setCatchUncaughtExceptions(true);
    MobclickAgent.openActivityDurationTrack(false);

    mActivityManager = new ActivityManager();
}
 
开发者ID:Jusenr,项目名称:RX_Demo,代码行数:33,代码来源:TotalApplication.java


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