DevUtils 是一个 Android 工具库, 主要根据不同功能模块,封装快捷使用的工具类及 API 方法调用。
该项目尽可能的便于开发人员,快捷、快速开发安全可靠的项目,以及内置部分常用的资源文件,如color.xml、(toast) layout.xml等
Step 1. Add the JitPack repository to your build file
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
// 因为内含 res 文件, 使用 aar 方式调用
implementation 'com.github.afkT:DevUtils:1.0.2@aar'
// implementation 'com.github.afkT:DevUtils:latest.release@aar'
}
只需要在 Application 中调用 DevUtils.init() 进行初始化就行
DevUtils.openLog() 是打开内部工具类 日志输出, 发包则不调用此句
DevLogger => https://github.com/afkT/DevLogger
/**
* detail: 全局Application
* Created by Ttt
*/
public class BaseApplication extends Application{
// 日志TAG
private final String LOG_TAG = BaseApplication.class.getSimpleName();
@Override
public void onCreate() {
super.onCreate();
// 初始化工具类
DevUtils.init(this.getApplicationContext());
// == 初始化日志配置 ==
// 设置默认Logger配置
LogConfig logConfig = new LogConfig();
logConfig.logLevel = LogLevel.DEBUG;
logConfig.tag = LOG_TAG;
DevLogger.init(logConfig);
// 打开 lib 内部日志
DevUtils.openLog();
DevUtils.openDebug();
}
}
感谢以下开源项目的作者,本项目中有些功能受你们项目灵感的启发,有些功能也用到你们的代码完成。