本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例9: onCreate
import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fresco.initialize(this);
initialiseLogger();
initAppComponent();
}
示例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);
}
示例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);
}
示例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));
}
示例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());
}
示例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);
}
示例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();
}