Skip to content

Commit 1e1c13b

Browse files
committed
Updated Readme for the fork
1 parent 87b41f5 commit 1e1c13b

File tree

1 file changed

+53
-65
lines changed

1 file changed

+53
-65
lines changed

README.md

Lines changed: 53 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,81 @@
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)
77

8-
<img src="http://7sbnrp.com1.z0.glb.clouddn.com/lollipop2-CircularReveal.gif" />
8+
Currently implemented:
9+
- Circular reveal
10+
- Circular transform
911

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>
12+
Planned:
13+
- Radial action
14+
15+
//TODO gifs
1316

1417
Sample
1518
======
16-
<a href="https://github.com/ozodrukh/CircularReveal/releases"> Sample & .aar file </a>
19+
<a href="https://github.com/Gordi90/CircularTools/releases"> //TODO releases</a>
1720

1821
Note
19-
====
22+
======
23+
- it's a fork from https://github.com/ozodrukh/CircularReveal/
24+
- independent from Jake Wharton's NineOldsAndroid
25+
- the returned `animator` is an `ObjectAnimator` so you can reverse it.
26+
27+
Limitations
28+
======
29+
- it will never use the native `ViewAnimationUtils.createCircularReveal`
30+
- hardware acceleration cannot be used in every situation. See table below:
2031

21-
depends from Jake Wharton's NineOldsAndroid, or use my modifed version (included auto cancel)
32+
| | API 11-17 | API 18-19 | 19+ |
33+
|-----------|-----------|-----------|----------|
34+
| **Reveal** | Software | Hardware | Software |
35+
| **Transform** | Software | Hardware | Hardware |
2236

2337
Using
2438
======
2539

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

2842
```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">
43+
<hu.aut.utillib.circular.widget.CircularFrameLayout
44+
android:id="@+id/simple_reveal"
45+
android:layout_width="match_parent"
46+
android:layout_height="match_parent">
3347

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-
```
48+
<!-- Put any child views here if you want, it's stock frame layout -->
5449

50+
</hu.aut.utillib.circular.widget.CircularFrameLayout>
51+
```
52+
**Transform:**
5553
```java
54+
//myTargetView & mySourceView are children in the CircularFrameLayout
55+
float finalRadius = ViewAnimationUtils.hypo(width, height);
5656

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;
57+
//getCenter computes from 2 view: One is touched, and one will be animated, but you can use anything for center
58+
int[] center = ViewAnimationUtils.getCenter(fab, myTargetView);
6259

63-
// get the final radius for the clipping circle
64-
int finalRadius = Math.max(myView.getWidth(), myView.getHeight());
65-
66-
SupportAnimator animator =
67-
ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);
68-
animator.setInterpolator(new AccelerateDecelerateInterpolator());
69-
animator.setDuration(1500);
70-
animator.start();
60+
animator = ViewAnimationUtils.createCircularTransform(myTargetView, mySourceView, center[0], center[1], 0F, finalRadius);
61+
animator.setInterpolator(new AccelerateDecelerateInterpolator());
62+
animator.setDuration(1500);
63+
animator.start();
7164

7265
```
7366

74-
####API that need to mention
75-
76-
#####Cancel it!
77-
67+
**Reveal:**
7868
```java
69+
//myView is a child in the CircularFrameLayout
70+
float finalRadius = ViewAnimationUtils.hypo(width, height);
7971

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

89-
SupportAnimator animator = ... ;
90-
animator = animator.reverse(); // override with new one
75+
animator = ViewAnimationUtils.createCircularReveal(myView, center[0], center[1], 0, finalRadius);
76+
animator.setInterpolator(new AccelerateDecelerateInterpolator());
77+
animator.setDuration(1500);
78+
animator.start();
9179

9280
```
9381

@@ -110,7 +98,7 @@ then add a library dependency
11098

11199
```groovy
112100
dependencies {
113-
compile 'com.github.ozodrukh:CircularReveal:1.1.0@aar'
101+
compile '//TODO'
114102
}
115103
```
116104

@@ -120,7 +108,7 @@ License
120108

121109
The MIT License (MIT)
122110

123-
Copyright (c) 2014 Abdullaev Ozodrukh
111+
Copyright (c) 2015 AutSoft Kft.
124112

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

0 commit comments

Comments
 (0)