Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chandarlee/viewtobitmap
View To Bitmap
https://github.com/chandarlee/viewtobitmap
Last synced: about 2 months ago
JSON representation
View To Bitmap
- Host: GitHub
- URL: https://github.com/chandarlee/viewtobitmap
- Owner: chandarlee
- Created: 2014-11-24T01:13:08.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-13T14:42:53.000Z (over 8 years ago)
- Last Synced: 2023-02-27T02:24:07.386Z (almost 2 years ago)
- Language: Java
- Size: 102 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ViewToBitmap
View To Bitmap
### 何谓沉浸式状态栏简单来说,沉浸式状态栏本质上是要给系统状态栏着色,当这个颜色和我们*Activity*中的*ToolBar*或者*ActionBar*所使用的颜色一致时就会有沉浸式的效果咯;
那么我们应该怎么才能给系统状态栏着色呢?### 怎么给状态栏着色
谷歌后知后觉,在 *API21* 中终于添加了相应的方法
```java
/**
For this to take effect,the window must be drawing the system bar backgrounds with
android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS and
android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_STATUS must not be set
**/
setStatusColor(int color)
```