Rect
values.
13 | */
14 | public class RectFEvaluator implements TypeEvaluatorreuseRect
33 | * in {@link #evaluate(float, RectF, RectF)} calls.
34 | * The value returned from
35 | * {@link #evaluate(float, RectF, RectF)} should
36 | * not be cached because it will change over time as the object is reused on each
37 | * call.
38 | *
39 | * @param reuseRect A Rect to be modified and returned by evaluate.
40 | */
41 | public RectFEvaluator(RectF reuseRect) {
42 | mRect = reuseRect;
43 | }
44 |
45 | /**
46 | * This function returns the result of linearly interpolating the start and
47 | * end Rect values, with fraction
representing the proportion
48 | * between the start and end values. The calculation is a simple parametric
49 | * calculation on each of the separate components in the Rect objects
50 | * (left, top, right, and bottom).
51 | * 52 | *
If {@link #RectFEvaluator(RectF)} was used to construct
53 | * this RectEvaluator, the object returned will be the reuseRect
54 | * passed into the constructor.
fraction
parameter.
61 | */
62 | @Override
63 | public RectF evaluate(float fraction, RectF startValue, RectF endValue) {
64 | float left = startValue.left + (endValue.left - startValue.left) * fraction;
65 | float top = startValue.top + (endValue.top - startValue.top) * fraction;
66 | float right = startValue.right + (endValue.right - startValue.right) * fraction;
67 | float bottom = startValue.bottom + (endValue.bottom - startValue.bottom) * fraction;
68 | if (mRect == null) {
69 | return new RectF(left, top, right, bottom);
70 | } else {
71 | mRect.set(left, top, right, bottom);
72 | return mRect;
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/imagetrans/src/main/java/it/liuting/imagetrans/listener/OnActionListener.java:
--------------------------------------------------------------------------------
1 | package it.liuting.imagetrans.listener;
2 |
3 | import android.view.View;
4 |
5 | /**
6 | * Created by liuting on 18/3/14.
7 | */
8 |
9 | public interface OnActionListener {
10 | boolean onClick(View v);
11 |
12 | void onPullRange(float range);
13 |
14 | void onPullCancel();
15 |
16 | void onStartClose();
17 | }
18 |
--------------------------------------------------------------------------------
/imagetrans/src/main/java/it/liuting/imagetrans/listener/OnGestureListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2011, 2012 Chris Banes.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | *******************************************************************************/
16 | package it.liuting.imagetrans.listener;
17 |
18 | public interface OnGestureListener {
19 |
20 | void onDrag(float dx, float dy);
21 |
22 | void onFling(float startX, float startY, float velocityX,
23 | float velocityY);
24 |
25 | void onScale(float scaleFactor, float focusX, float focusY);
26 |
27 | }
--------------------------------------------------------------------------------
/imagetrans/src/main/java/it/liuting/imagetrans/listener/OnPullCloseListener.java:
--------------------------------------------------------------------------------
1 | package it.liuting.imagetrans.listener;
2 |
3 | /**
4 | * Created by liuting on 17/5/26.
5 | */
6 |
7 | public interface OnPullCloseListener {
8 |
9 | void onClose();
10 |
11 | void onPull(float range);
12 |
13 | void onCancel();
14 | }
15 |
--------------------------------------------------------------------------------
/imagetrans/src/main/java/it/liuting/imagetrans/listener/OnTransformListener.java:
--------------------------------------------------------------------------------
1 | package it.liuting.imagetrans.listener;
2 |
3 | /**
4 | * Created by liuting on 17/6/15.
5 | */
6 |
7 | public interface OnTransformListener {
8 |
9 | void transformStart();
10 |
11 | void transformEnd();
12 | }
13 |
--------------------------------------------------------------------------------
/imagetrans/src/main/java/it/liuting/imagetrans/listener/ProgressViewGet.java:
--------------------------------------------------------------------------------
1 | package it.liuting.imagetrans.listener;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | /**
7 | * Created by liuting on 18/3/19.
8 | */
9 |
10 | public interface ProgressViewGet