File tree 1 file changed +19
-8
lines changed
library/src/main/java/com/ToxicBakery/viewpager/transforms 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 20
20
21
21
public class FlipHorizontalTransformer extends ABaseTransformer {
22
22
23
- @ Override
24
- protected void onTransform (View view , float position ) {
25
- final float rotation = 180f * position ;
23
+ @ Override
24
+ protected void onTransform (View view , float position ) {
25
+ final float rotation = 180f * position ;
26
26
27
- view .setAlpha (rotation > 90f || rotation < -90f ? 0 : 1 );
28
- view .setPivotX (view .getWidth () * 0.5f );
29
- view .setPivotY (view .getHeight () * 0.5f );
30
- view .setRotationY (rotation );
31
- }
27
+ view .setAlpha (rotation > 90f || rotation < -90f ? 0 : 1 );
28
+ view .setPivotX (view .getWidth () * 0.5f );
29
+ view .setPivotY (view .getHeight () * 0.5f );
30
+ view .setRotationY (rotation );
31
+ }
32
32
33
+ @ Override
34
+ protected void onPostTransform (View page , float position ) {
35
+ super .onPostTransform (page , position );
36
+
37
+ //resolve problem: new page can't handle click event!
38
+ if (position > -0.5f && position < 0.5f ) {
39
+ page .setVisibility (View .VISIBLE );
40
+ } else {
41
+ page .setVisibility (View .INVISIBLE );
42
+ }
43
+ }
33
44
}
You can’t perform that action at this time.
0 commit comments