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(); }
菜单的隐藏与现实(旋转)
最新推荐文章于 2023-03-13 12:54:19 发布