[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Status%20Bar%20Alert-green.svg?style=flat )]( https://android-arsenal.com/details/1/7037 )
[![](https://jitpack.io/v/fede87/StatusBarAlert.svg)](https://jitpack.io/#fede87/StatusBarAlert)
<img src="https://github.com/fede87/StatusBarAlert/raw/master/status_bar_alert_demo.gif" width="330" height="600" />
## What is this?
This is a small library inspired by Telegram X status bar new alert written in Kotlin.
It can show custom message with optional indeterminate progress in status bar area.
Optional autohide feature can be tweaked with custom duration.
When showing, status bar alert kindly hides status bar's icon with SYSTEM_UI_FLAG_LOW_PROFILE flag mode, if available from os.
## Supported devices
This lib is supported by every device with a SDK level of at least 14 (Android 4+. On Android 4.x the alert will be drawn below the status).
<b>Android X required for v1.1.0 and above, otherwise use old version v1.0.2.</b>
## Quick walkthrough
### Gradle
##### Step 1. Add the JitPack repository to your build file
gradle: add it in your root build.gradle at the end of repositories:
```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
##### Step 2. Add this line to your app's dependencies:
```gradle
implementation 'com.github.fede87:StatusBarAlert:2.0.0'
```
### Quick Sample
Create a new StatusBarAlert in activities and fragments.
Using Kotlin DSL:
```kotlin
statusBarAlert {
autoHide()
duration(2, TimeUnit.SECONDS)
showProgress()
text("Kotlin DSL")
alertColor(android.R.color.red)
textColor(android.R.color.white)
progressBarColor(android.R.color.white)
}.show()
```
Using Java way:
```kotlin
val statusBarAlertview: StatusBarAlert = StatusBarAlert.Builder(this@MainActivity)
.autoHide()
.withDuration(100)
.showProgress()
.text("autohide!")
.alertColor(R.color.colorPrimaryDark)
.textColor(R.color.colorAccent)
.progressBarColor(R.color.colorAccent)
.typeface(typeface)
.build().show()
//update status bar alert view text at any time:
statusBarAlertView.setText("UPDATED!!")
//or:
statusBarAlertView.setText(R.string.updated)
// show indeterminate progress:
statusBarAlertView.showProgress()
// hide indeterminate progress:
statusBarAlertView.hideProgress()
```
## License
Copyright 2018 Federico Marin
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.
没有合适的资源?快使用搜索试试~ 我知道了~
TelegramX启发了android状态栏警报视图_Kotlin_Java_下.zip
共41个文件
xml:11个
kt:6个
png:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 160 浏览量
2023-04-05
12:59:41
上传
评论
收藏 2.67MB ZIP 举报
温馨提示
TelegramX启发了android状态栏警报视图_Kotlin_Java_下.zip
资源推荐
资源详情
资源评论
收起资源包目录
TelegramX启发了android状态栏警报视图_Kotlin_Java_下.zip (41个子文件)
StatusBarAlert-master
gradle.properties 779B
gradle
wrapper
gradle-wrapper.jar 53KB
gradle-wrapper.properties 231B
app
src
androidTest
java
com
fede987
statusbaralert
ExampleInstrumentedTest.kt 664B
test
java
com
fede987
statusbaralert
ExampleUnitTest.kt 351B
main
assets
font
Lato-Regular.ttf 642KB
java
com
fede987
statusbaralert
app
MainActivity.kt 4KB
res
mipmap-xxhdpi
ic_launcher_round.png 10KB
mipmap-hdpi
ic_launcher_round.png 5KB
drawable-v24
ic_launcher_foreground.xml 2KB
mipmap-anydpi-v26
ic_launcher.xml 272B
ic_launcher_round.xml 272B
mipmap-mdpi
ic_launcher_round.png 3KB
mipmap-xxxhdpi
ic_launcher_round.png 15KB
mipmap-xhdpi
ic_launcher_round.png 7KB
values
colors.xml 286B
strings.xml 470B
styles.xml 383B
layout
activity_main.xml 2KB
drawable
ic_launcher_background.xml 5KB
AndroidManifest.xml 726B
proguard-rules.pro 751B
build.gradle 1KB
.gitignore 7B
LICENSE 11KB
build.gradle 759B
settings.gradle 36B
status_bar_alert_demo.gif 5.49MB
gradlew 5KB
status-bar-alert
src
androidTest
java
com
fede987
statusbaralert
ExampleInstrumentedTest.java 751B
test
java
com
fede987
statusbaralert
ExampleUnitTest.java 387B
main
java
com
fede987
statusbaralert
utils
ContextUtils.kt 1KB
ScreenUtils.kt 960B
StatusBarAlert.kt 14KB
res
values
strings.xml 25B
AndroidManifest.xml 113B
proguard-rules.pro 751B
build.gradle 1KB
.gitignore 7B
.gitignore 3KB
README.MD 3KB
共 41 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功