Skip to content

Repository files navigation

License

调试横幅标签(debug show checked mode banner label),看到flutter有这个功能。

sample1.png

sample2.png

使用

添加依赖

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url 'https://jitpack.io' }
}
}

Release Version

dependencies {
implementation 'com.github.wyjsonGo:DebugBanner:1.0.10'
}

初始化

在Application里

// 默认,全部页面显示DebugBanner.Companion.init(this);

进阶用法

自定义初始化

// 过滤不显示的页面DebugBanner.Companion.init(
this,
newBanner(),
false,
"MainActivity",
"ThreeActivity"
);
// 过滤显示的页面DebugBanner.Companion.init(
this,
newBanner(),
true,
"MainActivity",
"TwoActivity"
);
// 自定义样式DebugBanner.Companion.init(
this,
newBanner(BannerGravity.START, android.R.color.holo_blue_bright, android.R.color.holo_red_light, "BETA")
);

不同页面设置不同样式,实现BannerView接口

publicclassExampleActivityextendsAppCompatActivityimplementsBannerView {
@OverridepublicBannernewBanner() {
returnnewBanner(
BannerGravity.START,
android.R.color.holo_blue_light,
android.R.color.black,
"BETA"
);
}
}

About

调试横幅标签(debug show checked mode banner label),flutter有这个功能

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages