Skip to content

Commit a6dd79d

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 41ccea7 + 5adf0ce commit a6dd79d

File tree

2 files changed

+63
-66
lines changed

2 files changed

+63
-66
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 Ozodrukh
3+
Copyright (c) 2015 AutSoft Kft.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 62 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,90 @@
1-
CircularTransform
2-
based on https://github.com/ozodrukh/CircularReveal
3-
Readme and code is under development.
1+
CircularTools
42
==============
53

6-
Lollipop ViewAnimationUtils.createCircularReveal for everyone 2.3+
4+
Readme and code is under development.
5+
6+
Circle based animations for Android (min. API 11)
7+
8+
Currently implemented:
9+
- Circular reveal
10+
- Circular transform
11+
12+
Planned:
13+
- Radial action
14+
15+
**Reveal:**
16+
<a href="https://youtu.be/g83nwbi33c0">YouTube</a>
717

8-
<img src="http://7sbnrp.com1.z0.glb.clouddn.com/lollipop2-CircularReveal.gif" />
18+
<img src="http://i.imgur.com/pT0UqHA.gif" alt="Reveal DEMO" width="240" height="400" border="10" />
19+
20+
**Transform:**
21+
<a href="https://youtu.be/96eBHwWxTiA">YouTube</a>
22+
23+
<img src="http://i.imgur.com/QeaoLpD.gif" alt="Transform DEMO" width="240" height="400" border="10" />
924

10-
<a href="http://www.youtube.com/watch?feature=player_embedded&v=_vVpwzYb4Dg
11-
" target="_blank">Yotube Video <br /> <img src="http://img.youtube.com/vi/_vVpwzYb4Dg/0.jpg"
12-
alt="Ripple DEMO" width="320" height="240" border="10" /></a>
1325

1426
Sample
1527
======
16-
<a href="https://github.com/ozodrukh/CircularReveal/releases"> Sample & .aar file </a>
28+
<a href="https://github.com/Gordi90/CircularTools/releases"> //TODO releases</a>
1729

1830
Note
19-
====
31+
======
32+
- it's a fork from https://github.com/ozodrukh/CircularReveal/
33+
- independent from Jake Wharton's NineOldsAndroid
34+
- the returned `animator` is an `ObjectAnimator` so you can reverse it.
35+
36+
Limitations
37+
======
38+
- it will never use the native `ViewAnimationUtils.createCircularReveal` method
39+
- hardware acceleration cannot be used in every situation. See table below:
2040

21-
depends from Jake Wharton's NineOldsAndroid, or use my modifed version (included auto cancel)
41+
| | API 11-17 | API 18-19 | 19+ |
42+
|-----------|-----------|-----------|----------|
43+
| **Reveal** | Software | Hardware | Software |
44+
| **Transform** | Software | Hardware | Hardware |
2245

2346
Using
2447
======
2548

26-
Use regular `RevealFrameLayout` & `RevealLinearLayout` don't worry, only target will be clipped :)
49+
For reveal and transform you have to wrap your animated views with a `CircularFrameLayout`.
2750

2851
```xml
29-
<io.codetail.widget.RevealFrameLayout
30-
xmlns:android="http://schemas.android.com/apk/res/android"
31-
android:layout_width="match_parent"
32-
android:layout_height="match_parent">
52+
<hu.aut.utillib.circular.widget.CircularFrameLayout
53+
android:id="@+id/simple_reveal"
54+
android:layout_width="match_parent"
55+
android:layout_height="match_parent">
3356

34-
<!-- Put more views here if you want, it's stock frame layout -->
35-
36-
<android.support.v7.widget.CardView
37-
xmlns:app="http://schemas.android.com/apk/res-auto"
38-
android:id="@+id/awesome_card"
39-
style="@style/CardView"
40-
app:cardBackgroundColor="@color/material_deep_teal_500"
41-
app:cardElevation="2dp"
42-
app:cardPreventCornerOverlap="false"
43-
app:cardUseCompatPadding="true"
44-
android:layout_marginLeft="8dp"
45-
android:layout_marginRight="8dp"
46-
android:layout_marginTop="8dp"
47-
android:layout_width="300dp"
48-
android:layout_height="300dp"
49-
android:layout_gravity="center_horizontal"
50-
/>
51-
52-
</io.codetail.widget.RevealFrameLayout>
53-
```
57+
<!-- Put any child views here if you want, it's stock frame layout -->
5458

59+
</hu.aut.utillib.circular.widget.CircularFrameLayout>
60+
```
61+
**Transform:**
5562
```java
63+
//myTargetView & mySourceView are children in the CircularFrameLayout
64+
float finalRadius = CircularAnimationUtils.hypo(width, height);
5665

57-
View myView = findView(R.id.awesome_card);
58-
59-
// get the center for the clipping circle
60-
int cx = (myView.getLeft() + myView.getRight()) / 2;
61-
int cy = (myView.getTop() + myView.getBottom()) / 2;
62-
63-
// get the final radius for the clipping circle
64-
int finalRadius = Math.max(myView.getWidth(), myView.getHeight());
66+
//getCenter computes from 2 view: One is touched, and one will be animated, but you can use anything for center
67+
int[] center = CircularAnimationUtils.getCenter(fab, myTargetView);
6568

66-
SupportAnimator animator =
67-
ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);
68-
animator.setInterpolator(new AccelerateDecelerateInterpolator());
69-
animator.setDuration(1500);
70-
animator.start();
69+
animator = CircularAnimationUtils.createCircularTransform(myTargetView, mySourceView, center[0], center[1], 0F, finalRadius);
70+
animator.setInterpolator(new AccelerateDecelerateInterpolator());
71+
animator.setDuration(1500);
72+
animator.start();
7173

7274
```
7375

74-
####API that need to mention
75-
76-
#####Cancel it!
77-
76+
**Reveal:**
7877
```java
78+
//myView is a child in the CircularFrameLayout
79+
float finalRadius = CircularAnimationUtils.hypo(width, height);
7980

80-
SupportAnimator animator = ... ;
81-
animator.cancel();
82-
83-
```
84-
85-
#####Reverse it!
86-
87-
```java
81+
//getCenter computes from 2 view: One is touched, and one will be animated, but you can use anything for center
82+
int[] center = CircularAnimationUtils.getCenter(fab, myView);
8883

89-
SupportAnimator animator = ... ;
90-
animator = animator.reverse(); // override with new one
84+
animator = CircularAnimationUtils.createCircularReveal(myView, center[0], center[1], 0, finalRadius);
85+
animator.setInterpolator(new AccelerateDecelerateInterpolator());
86+
animator.setDuration(1500);
87+
animator.start();
9188

9289
```
9390

@@ -110,7 +107,7 @@ then add a library dependency
110107

111108
```groovy
112109
dependencies {
113-
compile 'com.github.ozodrukh:CircularReveal:1.1.0@aar'
110+
compile '//TODO'
114111
}
115112
```
116113

@@ -120,7 +117,7 @@ License
120117

121118
The MIT License (MIT)
122119

123-
Copyright (c) 2014 Abdullaev Ozodrukh
120+
Copyright (c) 2015 AutSoft Kft.
124121

125122
Permission is hereby granted, free of charge, to any person obtaining a copy
126123
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)