Skip to content

Commit 1c4bfb5

Browse files
committed
updated readme
1 parent c4e80a6 commit 1c4bfb5

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Swipe3DRotateView is extended from a Framelayout and should exactly contain 2 vi
1010
Put Swipe3DRotateView in your layout as required :
1111

1212
<com.nipunbirla.swipe3drotateview.Swipe3DRotateView
13+
android:id="@+id/rotateView"
1314
android:layout_height="match_parent"
1415
android:layout_width="match_parent">
1516

@@ -31,4 +32,38 @@ Put Swipe3DRotateView in your layout as required :
3132

3233
</com.nipunbirla.swipe3drotateview.Swipe3DRotateView>
3334

35+
Find view in your activity as :
36+
37+
Swipe3DRotateView swipe3DRotateView = findViewById(R.id.rotateView);
38+
39+
To set if X Rotation is allowed :
40+
41+
swipe3DRotateView.setIsXRotationAllowed(true);
42+
43+
To set if Y Rotation is allowed :
44+
45+
swipe3DRotateView.setIsYRotationAllowed(true);
46+
47+
To check if X Rotation is allowed :
48+
49+
boolean isXAllowed = swipe3DRotateView.isXRotationAllowed();
50+
51+
To check if Y Rotation is allowed :
52+
53+
boolean isYAllowed = swipe3DRotateView.isYRotationAllowed();
54+
55+
To set Animation duration, default value is 1000 millis
56+
57+
swipe3DRotateView.setAnimationDuration(1000);
58+
59+
To set animation listener on view up front, use :
60+
61+
swipe3DRotateView.setHalfAnimationCompleteListener(halfListener);
62+
63+
To set animation listener on view at back, use :
64+
65+
swipe3DRotateView.setCompleteAnimationCompleteListener(fullListener);
66+
67+
68+
3469

library/src/main/java/com/nipunbirla/swipe3drotateview/Swipe3DRotateView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public boolean isYRotationAllowed(){
6969
return allowYRotation;
7070
}
7171

72-
public void setAnimationDuration(long duration){
73-
ANIMATION_DURATION = duration;
72+
public void setAnimationDuration(long durationMillis){
73+
ANIMATION_DURATION = durationMillis/2;
7474
}
7575

7676
public void setHalfAnimationCompleteListener(Animation.AnimationListener listener){

sampleproject/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
tools:context="com.nipunbirla.sampleproject.MainActivity">
1010

1111
<com.nipunbirla.swipe3drotateview.Swipe3DRotateView
12+
android:id="@+id/rotateView"
1213
android:layout_height="match_parent"
1314
android:layout_width="match_parent">
1415

0 commit comments

Comments
 (0)