Linjiajia
2023-09-12 efafbbf142c81c233c71de636a2d3ce9dc2124f0
app/src/main/java/com/application/zhangshi_app_android/ui/home/HomeFragment.java
@@ -115,84 +115,87 @@
            AppManager.getAppManager().startActivity(HomeMindMapActivity.class);
            mOperatePopupWindow.dismiss();
        });
        final GestureDetector gestureDetector = new GestureDetector(getSelfActivity(), new GestureDetector.SimpleOnGestureListener() {
            @Override
            public boolean onDoubleTap(MotionEvent e) {
                AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
                alphaAnimation.setDuration(1000);
                alphaAnimation.setAnimationListener(new Animation.AnimationListener() {
                    @Override
                    public void onAnimationStart(Animation animation) {
                        binding.scrollView.setVisibility(View.VISIBLE);
                        binding.scrollView.post(new Runnable() {
                            @Override
                            public void run() {
                                binding.scrollView.scrollTo(binding.scrollView.getChildAt(0).getMeasuredWidth()/2 - ScreenSizeUtils.getScreenWidth(getSelfActivity())/2,0);
                            }
                        });
                    }
                    @Override
                    public void onAnimationEnd(Animation animation) {
                    }
                    @Override
                    public void onAnimationRepeat(Animation animation) {
                    }
                });
                AlphaAnimation alphaAnimation1 = new AlphaAnimation(1f, 0f);
                alphaAnimation1.setDuration(1000);
                alphaAnimation1.setAnimationListener(new Animation.AnimationListener() {
                    @Override
                    public void onAnimationStart(Animation animation) {
                        binding.layoutHomeRootNet.setVisibility(View.VISIBLE);
                    }
                    @Override
                    public void onAnimationEnd(Animation animation) {
//        final GestureDetector gestureDetector = new GestureDetector(getSelfActivity(), new GestureDetector.SimpleOnGestureListener() {
//            @Override
//            public boolean onDoubleTap(MotionEvent e) {
//                AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
//                alphaAnimation.setDuration(1000);
//                alphaAnimation.setAnimationListener(new Animation.AnimationListener() {
//                    @Override
//                    public void onAnimationStart(Animation animation) {
//                        binding.scrollView.setVisibility(View.VISIBLE);
//                        binding.scrollView.post(new Runnable() {
//                            @Override
//                            public void run() {
//                                binding.scrollView.scrollTo(binding.scrollView.getChildAt(0).getMeasuredWidth()/2 - ScreenSizeUtils.getScreenWidth(getSelfActivity())/2,0);
//                            }
//                        });
//                    }
//
//                    @Override
//                    public void onAnimationEnd(Animation animation) {
//                    }
//
//                    @Override
//                    public void onAnimationRepeat(Animation animation) {
//
//                    }
//                });
//
//                AlphaAnimation alphaAnimation1 = new AlphaAnimation(1f, 0f);
//                alphaAnimation1.setDuration(1000);
//                alphaAnimation1.setAnimationListener(new Animation.AnimationListener() {
//                    @Override
//                    public void onAnimationStart(Animation animation) {
//                        binding.layoutHomeRootNet.setVisibility(View.VISIBLE);
//                    }
//
//                    @Override
//                    public void onAnimationEnd(Animation animation) {
//                        binding.layoutHomeRootNet.setVisibility(View.GONE);
//                    }
//
//                    @Override
//                    public void onAnimationRepeat(Animation animation) {
//
//                    }
//                });
//
//                float scale = binding.layoutHomeRootNet.getWidth()/ (binding.ivTreeView.getWidth() * 2f / 3f);
//                //缩放动画
//                ScaleAnimation scaleAnimation = new ScaleAnimation(1f, scale, 1f, scale, binding.layoutHomeRootNet.getWidth()/2f, binding.layoutHomeRootNet.getHeight()/2f);
//                scaleAnimation.setDuration(1000);
//                scaleAnimation.setAnimationListener(new Animation.AnimationListener() {
//                    @Override
//                    public void onAnimationStart(Animation animation) {
//                    }
//
//                    @Override
//                    public void onAnimationEnd(Animation animation) {
//                        binding.scrollView.startAnimation(alphaAnimation);
//                        binding.layoutHomeRootNet.startAnimation(alphaAnimation1);
//                    }
//
//                    @Override
//                    public void onAnimationRepeat(Animation animation) {
//
//                    }
//                });
//                binding.layoutHomeRootNet.startAnimation(scaleAnimation);
//
//                return true;
//            }
//        });
//        binding.layoutHomeRootNet.setOnTouchListener(new View.OnTouchListener() {
//            @Override
//            public boolean onTouch(View v, MotionEvent event) {
//                gestureDetector.onTouchEvent(event);
//                return true;
//            }
//        });
                        binding.layoutHomeRootNet.setVisibility(View.GONE);
                    }
        binding.scrollView.setVisibility(View.VISIBLE);
                    @Override
                    public void onAnimationRepeat(Animation animation) {
                    }
                });
                float scale = binding.layoutHomeRootNet.getWidth()/ (binding.ivTreeView.getWidth() * 2f / 3f);
                //缩放动画
                ScaleAnimation scaleAnimation = new ScaleAnimation(1f, scale, 1f, scale, binding.layoutHomeRootNet.getWidth()/2f, binding.layoutHomeRootNet.getHeight()/2f);
                scaleAnimation.setDuration(1000);
                scaleAnimation.setAnimationListener(new Animation.AnimationListener() {
                    @Override
                    public void onAnimationStart(Animation animation) {
                    }
                    @Override
                    public void onAnimationEnd(Animation animation) {
                        binding.scrollView.startAnimation(alphaAnimation);
                        binding.layoutHomeRootNet.startAnimation(alphaAnimation1);
                    }
                    @Override
                    public void onAnimationRepeat(Animation animation) {
                    }
                });
                binding.layoutHomeRootNet.startAnimation(scaleAnimation);
                return true;
            }
        });
        binding.layoutHomeRootNet.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                gestureDetector.onTouchEvent(event);
                return true;
            }
        });
        firstViewOperator1 = new ViewOperator(binding.tvFirst1,binding.ivFirst1);
        firstViewOperator2 = new ViewOperator(binding.tvFirst2,binding.ivFirst2);