github android drawer,DebugDrawer,用于加快开发速度的Android调试抽屉,下载DebugDrawer的源码_GitHub_开发99...

Android调试抽屉

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f416e64726f6964253230417273656e616c2d44656275672532304472617765722d627269676874677265656e2e7376673f7374796c653d666c6174

使用调试抽屉加快开发速度

debug_drawer.gif

特性

DeviceModule - 有关你的设备的通用信息

device.png

BuildModule - 应用程序生成信息

build.png

SettingsModule - 开开开发人员,电池,默认设置,开放应用信息和可以能直接卸载应用程序

settings.png

NetworkModule - 启用/禁用 Wifi,移动或者蓝牙

network.png

OkHttpModule,OkHttp3Module - 关于http客户端的通用信息( 需要额外的依赖关系)

okhttp.png

PicassoModule - 映像下载和缓存统计( 需要额外的依赖关系)

picasso.png

GlideModule - 映像下载和缓存统计( 需要额外的依赖关系)

glide.png

ScalpelModule - 在你的应用程序( 需要额外的依赖项) 下发现层的工具。 感谢 ebabel 贡献。

scalpel.png

LocationModule - 公共位置信息( 需要额外的依赖关系)

location.png

TimberModule - 具有共享功能( 需要额外的依赖项)的日志查看器。 感谢 AntonyGolovin 贡献。

timber.png

ActionsModule - 任何依赖于上下文的操作( ButtonAction,SwitchAction,SpinnerAction )

actions.png

FpsModule - 使用编舞来测量 FPS ( 需要额外的依赖)

fps.png

LogsModule - Logcat和OkHttp网络调用拦截器( 需要额外的依赖项)。 片尾 Sloy

logs.png

NetworkQualityModule - 网络调用的错误/延迟速率管理( 需要额外的依赖项)。 片尾 Sloy

network_quality.png

待办事项获取屏幕截图功能

欢迎你给我们推荐模块 !

启动

添加Gradle依赖项:DebugDrawerdependencies {

debugImplementation 'io.palaima.debugdrawer:debugdrawer:0.8.0' releaseImplementation 'io.palaima.debugdrawer:debugdrawer-no-op:0.8.0'}DebugViewdependencies {

debugImplementation 'io.palaima.debugdrawer:debugdrawer-view:0.8.0' releaseImplementation 'io.palaima.debugdrawer:debugdrawer-view-no-op:0.8.0'}

BuildModule,DeviceModule,SettingsModule,NetworkModuledependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-commons:0.8.0'}

ActionsModule - ButtonAction,SwitchAction,SpinnerActiondependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-actions:0.8.0'}

需要 OkHttpModule,OkHttp3ModuleOkHttp 库dependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-okhttp:0.8.0' implementation 'io.palaima.debugdrawer:debugdrawer-okhttp3:0.8.0'}

PicassoModule库要求dependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-picasso:0.8.0'}

需要 GlideModule滑翔库dependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-glide:0.8.0'}

ScalpelModule手术刀库要求库dependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-scalpel:0.8.0'}

LocationModuledependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-location:0.8.0'}

需要 TimberModule木材库dependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-timber:0.8.0'}

FpsModuleTakt库要求dependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-fps:0.8.0'}

LogsModuleLynx & 卡盘库要求dependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-logs:0.8.0'}

需要 NetworkQualityModuleOkHttp 库dependencies {

implementation 'io.palaima.debugdrawer:debugdrawer-network-quality:0.8.0'}

把所有

1在 Activity 中初始化

你可以根据需要使用 DebugDrawer 或者 DebugView示例使用 DebugDrawer ( 用于 DebugView 初始化检查DebugViewActivity )privateDebugDrawer debugDrawer;

@Overrideprotectedvoid onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

//...SwitchAction switchAction =newSwitchAction("Test switch", newSwitchAction.Listener() {

@OverridepublicvoidonCheckedChanged(booleanvalue) {

Toast.makeText(MainActivity.this, "Switch checked", Toast.LENGTH_LONG).show();

}

});

ButtonAction buttonAction =newButtonAction("Test button", newButtonAction.Listener() {

@OverridepublicvoidonClick() {

Toast.makeText(MainActivity.this, "Button clicked", Toast.LENGTH_LONG).show();

}

});

SpinnerAction spinnerAction =newSpinnerAction<>(

Arrays.asList("First", "Second", "Third"),

newSpinnerAction.OnItemSelectedListener() {

@OverridepublicvoidonItemSelected(Stringvalue) {

Toast.makeText(MainActivity.this, "Spinner item selected - "+ value, Toast.LENGTH_LONG).show();

}

}

);

debugDrawer =newDebugDrawer.Builder(this)

. modules(

newActionsModule(switchAction, buttonAction, spinnerAction),

newFpsModule(Takt.stock(getApplication())),

newLocationModule(this),

newScalpelModule(this),

newTimberModule(),

newOkHttp3Module(okHttpClient),

newPicassoModule(picasso),

newGlideModule(Glide.get(getContext())),

newDeviceModule(this),

newBuildModule(this),

newNetworkModule(this),

newSettingsModule(this)

).build();

}

2.TimberModule

不要忘记在应用程序类中生成需要的日志树。 TimberModule 中存储在 LumberYard 类中的树。

应用程序类示例:publicclassDebugDrawerApplicationextendsApplication {

@OverridepublicvoidonCreate() {

super.onCreate();

LumberYard lumberYard =LumberYard.getInstance(this);

lumberYard.cleanUp();

Timber.plant(lumberYard.tree());

Timber.plant(newTimber.DebugTree());

}

}

创建和发布你自己的模块

添加 implementation 'io.palaima.debugdrawer:debugdrawer-base:0.8.0' 你的依赖关系

模块必须实现 DebugModule 接口或者扩展 DebugModuleAdapter 如果你不需要生命周期钩子publicinterfaceDebugModule {

/*** Creates module view*/@NonNullViewonCreateView(@NonNullLayoutInflaterinflater, @NonNullViewGroupparent);

/*** Override this method if you need to refresh* some information when drawer is opened*/voidonOpened();

/*** Override this method if you need to stop* some actions when drawer is closed*/voidonClosed();

/*** Override this method if you need to start* some processes*/voidonResume();

/*** Override this method if you need to do* some clean up*/voidonPause();

/*** Override this method if you need to start* some processes that would be killed when* onStop() is called* E.g. register receivers*/voidonStart();

/*** Override this method if you need to do* some clean up when activity goes to foreground.* E.g. unregister receivers*/voidonStop();

}

示例

你可以克隆该项目并自己编译它。

想要贡献欢迎? !

请求请求fork的repo 并从 dev 创建分支。

如果你已经更改了 api,请更新文档。

确保代码 lints。

必要时更改 README.md

编码风格打开大括号以显示在与代码相同的行上

所有变量必须是 camelCase

所有资源必须具有 dd_ 前缀

Credits

许可证Copyright 2016 Mantas Palaima.

Licensed under the Apache License, Version 2.0 (the"License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an"AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值