explaingit

gyf-dev/immersionbar

11,460JavaAudience · developerComplexity · 2/5Setup · easy

TLDR

An Android library that controls the status bar and navigation bar appearance in your app with a simple one-line API, handling edge cases like notched screens and soft keyboard conflicts automatically.

Mindmap

mindmap
  root((ImmersionBar))
    What it does
      Status bar control
      Navigation bar control
      Icon color switching
      Full-screen mode
    Handles Edge Cases
      Notched screens
      Soft keyboard
      Screen rotation
      Manufacturer differences
    Works With
      Activity
      Fragment
      Dialog
      PopupWindow
    Tech Stack
      Java
      Kotlin extension
      Android 4.4 plus
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Make app content flow visually behind the status bar and navigation bar for a full-screen edge-to-edge experience.

USE CASE 2

Set the status bar to match your app's brand color and switch bar icons between dark and light modes to stay readable.

USE CASE 3

Handle notched screens and soft keyboard layout conflicts automatically without writing device-specific workarounds.

USE CASE 4

Control navigation bar appearance inside a Fragment or Dialog independently from the parent Activity.

Tech stack

JavaKotlinAndroid

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

ImmersionBar is an Android library for controlling the status bar (the thin strip at the top of the screen showing time, battery level, and notifications) and the navigation bar (the row of buttons at the bottom for back, home, and recents). It targets Android version 4.4 and above. When building Android apps, developers often want the app content to flow visually behind these system bars, or want the bar colors to match the app design. ImmersionBar provides a single setup API to configure these bars: you can set them to transparent, pick custom colors, control whether the text and icons inside them appear dark or light, and hide them entirely if needed. The library handles a range of tricky situations that trip up basic Android code: switching between portrait and landscape orientation, notched screens (the camera cutout at the top, as seen on Huawei, Xiaomi, and others), soft keyboard pop-up conflicts where the keyboard covers input fields, and differences between device manufacturers. On phones where Android's standard tools do not allow changing text color in the status bar, the library adapts automatically. It works with the main Android screen building blocks: Activity, Fragment, DialogFragment, Dialog, and PopupWindow. Adding it to a project takes one line in the build file, and the minimum working code is one line of Java or Kotlin. A Kotlin extension module is available for a more natural Kotlin style. The library is at version 3.2.2, distributed via Maven Central, and comes with a downloadable demo app to see the effects on a real device.

Copy-paste prompts

Prompt 1
I'm building an Android app and want a transparent status bar with dark icons for my light-themed screens. Show me how to set this up with ImmersionBar in Kotlin.
Prompt 2
My Android app has a Fragment with a different color scheme than the main Activity. Show me how to use ImmersionBar to change the status bar color per Fragment without affecting the rest of the app.
Prompt 3
My login screen has a white background and the status bar icons are invisible against it. Use ImmersionBar to make the status bar icons dark only on that screen.
Prompt 4
I have a screen with an input field that the soft keyboard is covering. Show me how ImmersionBar handles keyboard conflicts to keep the input field visible.
Open on GitHub → Explain another repo

← gyf-dev on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.