Dmitry Kozyrenko
Dmitry Kozyrenko

Reputation: 51

How to achieve StatusBar effect like in Medium or Telegram X apps?

Medium: before scroll and after scrolling

Telegram X: normal if you have internet connection and otherwise

As you can see icons like Wi-Fi and others disappear; only currenct time and battery icon remain, but with 50% opacity.

Also, this effect is applied using smooth fade in and fade out animation.

EDIT: For everyone who need some info about this issue check this answer. https://stackoverflow.com/a/49182417/9342948

Upvotes: 5

Views: 636

Answers (1)

niranjan kurambhatti
niranjan kurambhatti

Reputation: 378

After searching for a while I found this. It automatically applies fadein and fadeout animation.

View decorView = getActivity().getWindow().getDecorView();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);

Upvotes: 1

Related Questions