Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the color of soft keys to white in android(Navigation buttons)

I am making a basic launcher app where i needed my notification bar and status bar to be perfectly transparent. So i used below code.

Window w = getWindow(); // in Activity's onCreate() for instance
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

Which does the trick but the color of the softkeys is not white as shown in figure below.

enter image description here

How do i make it white?

like image 693
Redone Avatar asked Jan 07 '23 22:01

Redone


1 Answers

Ok finally solved it in lollipop. But i haven't tested in devices lower than lollipop.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(Color.TRANSPARENT);
        window.setNavigationBarColor(Color.TRANSPARENT);
    }
like image 129
Redone Avatar answered Apr 05 '23 05:04

Redone