十天冲刺

一、说在前面

 今天还可以放下了php进行了安卓学习

二、完成情况

  今天主要完成了之前提到的语音通话中可以实现小窗口划

 case R.id.audio_iv_small:
                WindowHelper.getInstance().hideView(mFullAudioView);
                WindowHelper.getInstance().showView(mSmallAudioView,lpSmallView);
                break;

  

 public void hideView(final View view) {
        if (view != null) {
            if (view.getParent() != null) {
                try {
                    mHandler.post(new Runnable() {
                        @Override
                        public void run() {
                            wm.removeView(view);
                        }
                    });
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

  

    public void showView(final View view, final WindowManager.LayoutParams layoutParams) {
        if (view != null) {
            if (view.getParent() == null) {
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            wm.addView(view, layoutParams);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                });
            }
        }
    }

  

 

posted @ 2020-06-04 16:29  恶霸xx  阅读(126)  评论(0编辑  收藏  举报