appcompat-v7 v23.0.0 statusbar color black when in ActionMode

后端 未结 3 1893
误落风尘
误落风尘 2020-12-15 01:46

UPDATE

Same issue present in the latest Gmail app. I still don\'t understand why would Google make such unpleasant UI change. Obsessive in me goes cr

3条回答
  •  暖寄归人
    2020-12-15 02:21

    Nobody? Here is the workaround I came up with. Delay.

    @Override
        public void onDestroyActionMode(ActionMode mode) {
    
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                new Handler().postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            getActivity().getWindow().setStatusBarColor(getResources().getColor(android.R.color.transparent));
                        }
                        catch(Exception e)
                        {
                            e.printStackTrace();
                        }
                    }
                }, 400);
    
            }
            mActionMode = null;
    
        }
    

提交回复
热议问题