Java 类com.facebook.stetho.dumpapp.DumperPlugin 实例源码

项目:GitHub    文件:ComparisonApp.java   
@Override
public void onCreate() {
  super.onCreate();
  final Context context = this;
  Stetho.initialize(Stetho.newInitializerBuilder(context)
      .enableDumpapp(new DumperPluginsProvider() {
        @Override
        public Iterable<DumperPlugin> get() {
          return new Stetho.DefaultDumperPluginsBuilder(context)
              .provide(new FrescoStethoPlugin())
              .finish();
        }
      })
      .build());
}
项目:droidconde-2016    文件:StethoInitializer.java   
@Override
public Iterable<DumperPlugin> get() {
    List<DumperPlugin> plugins = new ArrayList<>();
    for (DumperPlugin plugin : Stetho.defaultDumperPluginsProvider(context).get()) {
        plugins.add(plugin);
    }
    plugins.add(appDumper);
    return plugins;
}
项目:devfestnantes-2016    文件:StethoInitializer.java   
@Override
public Iterable<DumperPlugin> get() {
    List<DumperPlugin> plugins = new ArrayList<>();
    for (DumperPlugin plugin : Stetho.defaultDumperPluginsProvider(context).get()) {
        plugins.add(plugin);
    }
    plugins.add(appDumper);
    return plugins;
}
项目:mobilization-2016    文件:StethoInitializer.java   
@Override
public Iterable<DumperPlugin> get() {
    List<DumperPlugin> plugins = new ArrayList<>();
    for (DumperPlugin plugin : Stetho.defaultDumperPluginsProvider(context).get()) {
        plugins.add(plugin);
    }
    plugins.add(appDumper);
    return plugins;
}
项目:droidconat-2016    文件:StethoInitializer.java   
@Override
public Iterable<DumperPlugin> get() {
    List<DumperPlugin> plugins = new ArrayList<>();
    for (DumperPlugin plugin : Stetho.defaultDumperPluginsProvider(context).get()) {
        plugins.add(plugin);
    }
    plugins.add(appDumper);
    return plugins;
}
项目:devoxxfr-2016    文件:StethoInitializer.java   
@Override
public Iterable<DumperPlugin> get() {
    List<DumperPlugin> plugins = new ArrayList<>();
    for (DumperPlugin plugin : Stetho.defaultDumperPluginsProvider(context).get()) {
        plugins.add(plugin);
    }
    plugins.add(appDumper);
    return plugins;
}
项目:AndroidJsoup    文件:IApplication.java   
@Override
    public void onCreate() {
        super.onCreate();
        INSTANCE = this;
        final Context mContext = this;
        DBUtils.getInstance().initDB(getApplicationContext());
        Stetho.initialize(Stetho.newInitializerBuilder(mContext)
                .enableDumpapp(new DumperPluginsProvider() {
                    @Override
                    public Iterable<DumperPlugin> get() {
                        return new Stetho.DefaultDumperPluginsBuilder(mContext)
                                .provide(new HprofDumperPlugin(mContext))
                                .finish();
                    }
                })
                .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(mContext))
                .build());
        Stetho.initializeWithDefaults(mContext);




        HttpsUtils.SSLParams sslParams = HttpsUtils.getSslSocketFactory(null, null, null);
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                .addInterceptor(new LoggerInterceptor("TAG"))
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .sslSocketFactory(sslParams.sSLSocketFactory, sslParams.trustManager)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();

        OkHttpUtils.initClient(okHttpClient);
    }
项目:droidcongr-2016    文件:StethoInitializer.java   
@Override
public Iterable<DumperPlugin> get() {
    List<DumperPlugin> plugins = new ArrayList<>();
    for (DumperPlugin plugin : Stetho.defaultDumperPluginsProvider(context).get()) {
        plugins.add(plugin);
    }
    plugins.add(appDumper);
    return plugins;
}
项目:droidcontn-2016    文件:StethoInitializer.java   
@Override
public Iterable<DumperPlugin> get() {
    List<DumperPlugin> plugins = new ArrayList<>();
    for (DumperPlugin plugin : Stetho.defaultDumperPluginsProvider(context).get()) {
        plugins.add(plugin);
    }
    plugins.add(appDumper);
    return plugins;
}
项目:stetho    文件:Stetho.java   
/**
 * Start the listening server.  Most of the heavy lifting initialization is deferred until the
 * first socket connection is received, allowing this to be safely used for debug builds on
 * even low-end hardware without noticeably affecting performance.
 */
public static void initializeWithDefaults(final Context context) {
  initialize(new Initializer(context) {
    @Override
    protected Iterable<DumperPlugin> getDumperPlugins() {
      return new DefaultDumperPluginsBuilder(context).finish();
    }

    @Override
    protected Iterable<ChromeDevtoolsDomain> getInspectorModules() {
      return new DefaultInspectorModulesBuilder(context).finish();
    }
  });
}
项目:stetho    文件:Stetho.java   
public static DumperPluginsProvider defaultDumperPluginsProvider(final Context context) {
  return new DumperPluginsProvider() {
    @Override
    public Iterable<DumperPlugin> get() {
      return new DefaultDumperPluginsBuilder(context).finish();
    }
  };
}
项目:stetho    文件:Stetho.java   
public Iterable<DumperPlugin> finish() {
  provideIfDesired(new HprofDumperPlugin(mContext));
  provideIfDesired(new SharedPreferencesDumperPlugin(mContext));
  provideIfDesired(new CrashDumperPlugin());
  provideIfDesired(new FilesDumperPlugin(mContext));
  return mDelegate.finish();
}
项目:stetho    文件:Stetho.java   
@Override
public SocketHandler create() {
  ProtocolDetectingSocketHandler socketHandler =
      new ProtocolDetectingSocketHandler(mContext);

  Iterable<DumperPlugin> dumperPlugins = getDumperPlugins();
  if (dumperPlugins != null) {
    Dumper dumper = new Dumper(dumperPlugins);

    socketHandler.addHandler(
        new ProtocolDetectingSocketHandler.ExactMagicMatcher(
            DumpappSocketLikeHandler.PROTOCOL_MAGIC),
        new DumpappSocketLikeHandler(dumper));

    // Support the old HTTP-based protocol since it's relatively straight forward to do.
    DumpappHttpSocketLikeHandler legacyHandler = new DumpappHttpSocketLikeHandler(dumper);
    socketHandler.addHandler(
        new ProtocolDetectingSocketHandler.ExactMagicMatcher(
            "GET /dumpapp".getBytes()),
        legacyHandler);
    socketHandler.addHandler(
        new ProtocolDetectingSocketHandler.ExactMagicMatcher(
            "POST /dumpapp".getBytes()),
        legacyHandler);
  }

  Iterable<ChromeDevtoolsDomain> inspectorModules = getInspectorModules();
  if (inspectorModules != null) {
    socketHandler.addHandler(
        new ProtocolDetectingSocketHandler.AlwaysMatchMatcher(),
        new DevtoolsSocketHandler(mContext, inspectorModules));
  }

  return socketHandler;
}
项目:stetho    文件:SampleDebugApplication.java   
private void initializeStetho(final Context context) {
  // See also: Stetho.initializeWithDefaults(Context)
  Stetho.initialize(Stetho.newInitializerBuilder(context)
      .enableDumpapp(new DumperPluginsProvider() {
        @Override
        public Iterable<DumperPlugin> get() {
          return new Stetho.DefaultDumperPluginsBuilder(context)
              .provide(new HelloWorldDumperPlugin())
              .provide(new APODDumperPlugin(context.getContentResolver()))
              .finish();
        }
      })
      .enableWebKitInspector(new ExtInspectorModulesProvider(context))
      .build());
}
项目:info-dumper    文件:MyApplication.java   
@Override
public Iterable<DumperPlugin> get() {
    List<DumperPlugin> plugins = new ArrayList<>();
    for (DumperPlugin defaultPlugin : Stetho.defaultDumperPluginsProvider(mContext).get()) {
        plugins.add(defaultPlugin);
    }
    // Add InfoDumperPlugin
    plugins.add(new InfoDumperPlugin(mContext));
    return plugins;
}
项目:yandex-disk-restapi-java    文件:Application.java   
@Override
        public Iterable<DumperPlugin> get() {
            ArrayList<DumperPlugin> plugins = new ArrayList<DumperPlugin>();
            for (DumperPlugin defaultPlugin : Stetho.defaultDumperPluginsProvider(mContext).get()) {
                plugins.add(defaultPlugin);
            }
//            plugins.add(new HelloWorldDumperPlugin());
            return plugins;
        }
项目:fresco    文件:ComparisonApp.java   
@Override
public void onCreate() {
  super.onCreate();
  final Context context = this;
  Stetho.initialize(Stetho.newInitializerBuilder(context)
      .enableDumpapp(new DumperPluginsProvider() {
        @Override
        public Iterable<DumperPlugin> get() {
          return new Stetho.DefaultDumperPluginsBuilder(context)
              .provide(new FrescoStethoPlugin())
              .finish();
        }
      })
      .build());
}
项目:GitHub    文件:ShowcaseApplication.java   
@Override
public void onCreate() {
  super.onCreate();
  FLog.setMinimumLoggingLevel(FLog.VERBOSE);
  Set<RequestListener> listeners = new HashSet<>();
  listeners.add(new RequestLoggingListener());

  OkHttpClient okHttpClient = new OkHttpClient.Builder()
      .addNetworkInterceptor(new StethoInterceptor())
      .build();

  ImagePipelineConfig imagePipelineConfig =
      OkHttpImagePipelineConfigFactory.newBuilder(this, okHttpClient)
          .setRequestListeners(listeners)
          .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
          .setImageDecoderConfig(CustomImageFormatConfigurator.createImageDecoderConfig(this))
          .experiment()
          .setMediaVariationsIndexEnabled(
              new Supplier<Boolean>() {
                @Override
                public Boolean get() {
                  return true;
                }
              })
          .experiment()
          .setBitmapPrepareToDraw(true, 0, Integer.MAX_VALUE, true)
          .experiment()
          .setSmartResizingEnabled(Suppliers.BOOLEAN_TRUE)
          .build();

  ImagePipelineConfig.getDefaultImageRequestConfig().setProgressiveRenderingEnabled(true);

  DraweeConfig.Builder draweeConfigBuilder = DraweeConfig.newBuilder();
  CustomImageFormatConfigurator.addCustomDrawableFactories(this, draweeConfigBuilder);

  draweeConfigBuilder.setDebugOverlayEnabledSupplier(
      DebugOverlaySupplierSingleton.getInstance(getApplicationContext()));

  Fresco.initialize(this, imagePipelineConfig, draweeConfigBuilder.build());

  final Context context = this;
  Stetho.initialize(
      Stetho.newInitializerBuilder(context)
          .enableDumpapp(
              new DumperPluginsProvider() {
                @Override
                public Iterable<DumperPlugin> get() {
                  return new Stetho.DefaultDumperPluginsBuilder(context)
                      .provide(new FrescoStethoPlugin())
                      .finish();
                }
              })
          .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(context))
          .build());
}
项目:stetho    文件:Stetho.java   
public DefaultDumperPluginsBuilder provide(DumperPlugin plugin) {
  mDelegate.provide(plugin.getName(), plugin);
  return this;
}
项目:stetho    文件:Stetho.java   
private DefaultDumperPluginsBuilder provideIfDesired(DumperPlugin plugin) {
  mDelegate.provideIfDesired(plugin.getName(), plugin);
  return this;
}
项目:stetho    文件:Stetho.java   
@Nullable
protected abstract Iterable<DumperPlugin> getDumperPlugins();
项目:stetho    文件:Stetho.java   
@Nullable
@Override
protected Iterable<DumperPlugin> getDumperPlugins() {
  return mDumperPlugins != null ? mDumperPlugins.get() : null;
}
项目:fresco    文件:ShowcaseApplication.java   
@Override
public void onCreate() {
  super.onCreate();
  FLog.setMinimumLoggingLevel(FLog.VERBOSE);
  Set<RequestListener> listeners = new HashSet<>();
  listeners.add(new RequestLoggingListener());

  OkHttpClient okHttpClient = new OkHttpClient.Builder()
      .addNetworkInterceptor(new StethoInterceptor())
      .build();

  ImagePipelineConfig imagePipelineConfig =
      OkHttpImagePipelineConfigFactory.newBuilder(this, okHttpClient)
          .setRequestListeners(listeners)
          .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
          .setImageDecoderConfig(CustomImageFormatConfigurator.createImageDecoderConfig(this))
          .experiment()
          .setMediaVariationsIndexEnabled(
              new Supplier<Boolean>() {
                @Override
                public Boolean get() {
                  return true;
                }
              })
          .experiment()
          .setBitmapPrepareToDraw(true, 0, Integer.MAX_VALUE, true)
          .experiment()
          .setSmartResizingEnabled(Suppliers.BOOLEAN_TRUE)
          .build();

  ImagePipelineConfig.getDefaultImageRequestConfig().setProgressiveRenderingEnabled(true);

  DraweeConfig.Builder draweeConfigBuilder = DraweeConfig.newBuilder();
  CustomImageFormatConfigurator.addCustomDrawableFactories(this, draweeConfigBuilder);

  draweeConfigBuilder.setDebugOverlayEnabledSupplier(
      DebugOverlaySupplierSingleton.getInstance(getApplicationContext()));

  Fresco.initialize(this, imagePipelineConfig, draweeConfigBuilder.build());

  final Context context = this;
  Stetho.initialize(
      Stetho.newInitializerBuilder(context)
          .enableDumpapp(
              new DumperPluginsProvider() {
                @Override
                public Iterable<DumperPlugin> get() {
                  return new Stetho.DefaultDumperPluginsBuilder(context)
                      .provide(new FrescoStethoPlugin())
                      .finish();
                }
              })
          .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(context))
          .build());
}
项目:stetho    文件:DumperPluginsProvider.java   
Iterable<DumperPlugin> get();