Skip to content

Commit ea28521

Browse files
committed
Uploaded the v2.1.2 and Adds the capability to automatically flip the view back to front side after some fixed time and updated ReadMe
1 parent f3796df commit ea28521

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

.idea/modules.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EasyFlipView/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ext {
2121
siteUrl = 'https://github.com/wajahatkarim3/EasyFlipView'
2222
gitUrl = 'https://github.com/wajahatkarim3/EasyFlipView.git'
2323

24-
libraryVersion = '2.1.1'
24+
libraryVersion = '2.1.2'
2525

2626
developerId = 'wajahatkarim3'
2727
developerName = 'Wajahat Karim'

EasyFlipView/src/main/java/com/wajahatkarim3/easyflipview/EasyFlipView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class EasyFlipView extends FrameLayout {
3030
public static final String TAG = EasyFlipView.class.getSimpleName();
3131

3232
public static final int DEFAULT_FLIP_DURATION = 400;
33-
public static final int DEFAULT_AUTO_FLIP_BACK_TIME = 100;
33+
public static final int DEFAULT_AUTO_FLIP_BACK_TIME = 1000;
3434
private int animFlipHorizontalOutId = R.animator.animation_horizontal_flip_out;
3535
private int animFlipHorizontalInId = R.animator.animation_horizontal_flip_in;
3636
private int animFlipHorizontalRightOutId = R.animator.animation_horizontal_right_out;

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Changes exist in the [releases](https://github.com/wajahatkarim3/EasyFlipView/re
2525
Add this in your app's build.gradle file:
2626
```groovy
2727
dependencies {
28-
implementation 'com.wajahatkarim3.EasyFlipView:EasyFlipView:2.1.1'
28+
implementation 'com.wajahatkarim3.EasyFlipView:EasyFlipView:2.1.2'
2929
}
3030
```
3131

@@ -35,7 +35,7 @@ Or add EasyFlipView as a new dependency inside your pom.xml
3535
<dependency>
3636
<groupId>com.wajahatkarim3.EasyFlipView</groupId>
3737
<artifactId>EasyFlipView</artifactId>
38-
<version>2.1.1</version>
38+
<version>2.1.2</version>
3939
<type>pom</type>
4040
</dependency>
4141
```
@@ -54,6 +54,8 @@ EasyFlipView In XML layouts("Vertical")
5454
app:flipDuration="400"
5555
app:flipType="vertical"
5656
app:flipFrom="front"
57+
app:autoFlipBack="true"
58+
app:autoFlipBackTime="1000"
5759
>
5860

5961
<!-- Back Layout Goes Here -->
@@ -75,6 +77,7 @@ EasyFlipView In XML layouts("Horizontal")
7577
app:flipDuration="400"
7678
app:flipFrom="right"
7779
app:flipType="horizontal"
80+
app:autoFlipBack="false"
7881
>
7982

8083
<!-- Back Layout Goes Here -->
@@ -124,6 +127,16 @@ All customizable attributes for EasyFlipView
124127
front</td>
125128
<td>Whether card should flip from left to right Or right to left(Horizontal type) or car should flip to front or back(Vertical type)</td>
126129
</tr>
130+
<tr>
131+
<td>app:autoFlipBack="true"</td>
132+
<td>false</td>
133+
<td>If this is set to true, then he card will be flipped back to original front side after the time set in <i>autoFlipBackTime</i>.</td>
134+
</tr>
135+
<tr>
136+
<td>app:autoFlipBackTime="1000"</td>
137+
<td>1000</td>
138+
<td>The time in milliseconds (ms), after the card will be flipped back to original front side.</td>
139+
</tr>
127140
</table>
128141

129142
In Code (Java)
@@ -160,6 +173,14 @@ mYourFlipView.setToHorizontalType();
160173
boolean isVertical = mYourFlipView.isVerticalType();
161174
mYourFlipView.setToVerticalType();
162175

176+
// Get/Set if the auto flip back is enabled
177+
boolean isAutoFlipBackEnabled = mYourFlipView.isAutoFlipBack();
178+
mYourFlipView.setAutoFlipBack(true);
179+
180+
// Get/Set the time in milliseconds (ms) after the view is auto flip back to original front side
181+
int autoflipBackTimeInMilliseconds = mYourFlipView.getAutoFlipBackTime();
182+
mYourFlipView.setAutoFlipBackTime(2000);
183+
163184
// Sets the animation direction from left (horizontal) and back (vertical)
164185
easyFlipView.setFlipTypeFromLeft();
165186

0 commit comments

Comments
 (0)