| | |
| | | AppManager.getAppManager().startActivity(GenealogyActivity.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) { |
| | | 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; |
| | | } |
| | | mOperatePopupWindow.getContentView().findViewById(R.id.tv_relation).setOnClickListener(v -> { |
| | | AppManager.getAppManager().startActivity(HomeMindMapActivity.class); |
| | | mOperatePopupWindow.dismiss(); |
| | | }); |
| | | binding.layoutHomeRootNet.setOnTouchListener(new View.OnTouchListener() { |
| | | @Override |
| | | public boolean onTouch(View v, MotionEvent event) { |
| | | gestureDetector.onTouchEvent(event); |
| | | return true; |
| | | } |
| | | }); |
| | | // 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); |
| | | |
| | | |
| | | firstViewOperator1 = new ViewOperator(binding.tvFirst1,binding.ivFirst1); |
| | | firstViewOperator2 = new ViewOperator(binding.tvFirst2,binding.ivFirst2); |