當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。