本文整理匯總了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();
}