File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
circulardemo/src/main/java/hu/gordon/circulardemo/fragments Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,11 @@ public void onClick(View view) {
68
68
// Pre-calculations
69
69
//
70
70
// get the final radius for the clipping circle
71
- float finalRadius = ViewAnimationUtils .hypo (screenWidth , screenHeight );
71
+
72
+ int [] myViewLocation = new int [2 ];
73
+ myView .getLocationInWindow (myViewLocation );
74
+
75
+ float finalRadius = ViewAnimationUtils .hypo (screenWidth -myViewLocation [0 ], screenHeight -myViewLocation [1 ]);
72
76
int [] center = ViewAnimationUtils .getCenter (fab , myView );
73
77
74
78
ObjectAnimator animator =
Original file line number Diff line number Diff line change @@ -96,7 +96,10 @@ public void onClick(View view) {
96
96
// Pre-calculations
97
97
//
98
98
// get the final radius for the clipping circle
99
- float finalRadius = ViewAnimationUtils .hypo (screenWidth , screenHeight );
99
+ int [] myTargetViewLocation = new int [2 ];
100
+ myTargetView .getLocationInWindow (myTargetViewLocation );
101
+
102
+ float finalRadius = ViewAnimationUtils .hypo (screenWidth -myTargetViewLocation [0 ], screenHeight -myTargetViewLocation [1 ]);
100
103
int [] center = ViewAnimationUtils .getCenter (fab , myTargetView );
101
104
102
105
animator =
You can’t perform that action at this time.
0 commit comments