Change status bar text color when primaryDark is white

前端 未结 8 1383
自闭症患者
自闭症患者 2021-01-30 06:17

I am trying to reproduce the behaviour of Google Calendar application:

but I have not found a way to change the status text color. If i set the colorPrimaryDark as whit

8条回答
  •  渐次进展
    2021-01-30 06:50

    Try this if not splash page

    getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    getActivity().getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
    getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
    getActivity().getWindow().setNavigationBarColor(ContextCompat.getColor(context, R.color.white));
    getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(context, R.color.white));
    

提交回复
热议问题