菜单的隐藏与现实(旋转)

来源:互联网 发布:freebsd linux 双系统 编辑:程序博客网 时间:2024/05/29 02:44
public static void hider(ViewGroup v) {        hider(v,0);    }    public static void hider(ViewGroup v,int startOffset) {//        RotateAnimation ra = new RotateAnimation(0,180,v.getWidth()/2,v.getHeight());//        ra.setDuration(4000);//        ra.setFillAfter(true);//        ra.setStartOffset(startOffset);//        v.startAnimation(ra);//        for (int i = 0; i<v.getChildCount();i++){//            View children = v.getChildAt(i);//            children.setEnabled(false);//        }        ObjectAnimator ani = ObjectAnimator.ofFloat(v,"rotation",0,180);        v.setPivotX(v.getWidth()/2);        v.setPivotY(v.getHeight());        ani.setDuration(500);        ani.setStartDelay(100);        ani.start();    }    public static void show(ViewGroup v) {        show(v,0);    }    public static void show(ViewGroup v,int startOffset) {//        RotateAnimation ra = new RotateAnimation(180,360,v.getWidth()/2,v.getHeight());//        ra.setDuration(4000);//        ra.setFillAfter(true);//        ra.setStartOffset(startOffset);//        v.startAnimation(ra);//        for (int i = 0; i<v.getChildCount();i++){//            View children = v.getChildAt(i);//            children.setEnabled(true);//        }        ObjectAnimator ani = ObjectAnimator.ofFloat(v,"rotation",180,360);        v.setPivotX(v.getWidth()/2);        v.setPivotY(v.getHeight());        ani.setDuration(500);        ani.setStartDelay(100);        ani.start();    }
原创粉丝点击