1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
package com.mapbox.mapboxsdk.style.layers;
import android.support.annotation.Keep;
/**
* Resembles transition property from the style specification.
*
* @see <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#transition">Transition documentation</a>
*/
public class TransitionOptions {
@Keep
private long duration;
@Keep
private long delay;
@Keep
private boolean enablePlacementTransitions;
/**
* Create a transition property based on duration and a delay.
*
* @param duration the duration of the transition
* @param delay the delay to start the transition
*/
public TransitionOptions(long duration, long delay) {
this(duration, delay, true);
}
/**
* Create a transition property.
*
* @param duration the duration of the transition
* @param delay the delay to start the transition
* @param enablePlacementTransitions the flag that describes whether the fade in/out symbol placement transition
* should be enabled. Defaults to true.
*/
public TransitionOptions(long duration, long delay, boolean enablePlacementTransitions) {
this.duration = duration;
this.delay = delay;
this.enablePlacementTransitions = enablePlacementTransitions;
}
/**
* Create a transition property based on duration and a delay.
*
* @param duration the duration of the transition
* @param delay the delay to start the transition
* @return a new transition property object
* @deprecated use {@link #fromTransitionOptions(long, long, boolean)} instead
*/
@Keep
@Deprecated
public static TransitionOptions fromTransitionOptions(long duration, long delay) {
// Invoked from JNI only
return new TransitionOptions(duration, delay);
}
/**
* Create a transition property.
*
* @param duration the duration of the transition
* @param delay the delay to start the transition
* @param enablePlacementTransitions the flag that describes whether the fade in/out symbol placement transition
* should be enabled. Defaults to true.
* @return a new transition property object
*/
@Keep
static TransitionOptions fromTransitionOptions(long duration, long delay, boolean enablePlacementTransitions) {
// Invoked from JNI only
return new TransitionOptions(duration, delay, enablePlacementTransitions);
}
/**
* Get the transition duration.
*
* @return the transition duration
*/
public long getDuration() {
return duration;
}
/**
* Get the transition delay.
*
* @return the transition delay
*/
public long getDelay() {
return delay;
}
/**
* Get the flag that describes whether the fade in/out symbol placement transition should be enabled.
*
* @return true if the fade in/out symbol placement transition should be enabled, false otherwise
*/
public boolean isEnablePlacementTransitions() {
return enablePlacementTransitions;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TransitionOptions that = (TransitionOptions) o;
if (duration != that.duration) {
return false;
}
if (delay != that.delay) {
return false;
}
return enablePlacementTransitions == that.enablePlacementTransitions;
}
@Override
public int hashCode() {
int result = (int) (duration ^ (duration >>> 32));
result = 31 * result + (int) (delay ^ (delay >>> 32));
result = 31 * result + (enablePlacementTransitions ? 1 : 0);
return result;
}
@Override
public String toString() {
return "TransitionOptions{"
+ "duration=" + duration
+ ", delay=" + delay
+ ", enablePlacementTransitions=" + enablePlacementTransitions
+ '}';
}
}
|