1package org.robolectric.shadows;
2
3import static android.os.Build.VERSION_CODES.LOLLIPOP;
4
5import android.view.RenderNode;
6import org.robolectric.annotation.Implementation;
7import org.robolectric.annotation.Implements;
8
9@Implements(value = RenderNode.class, isInAndroidSdk = false, minSdk = LOLLIPOP)
10public class ShadowRenderNode {
11  private float alpha = 1f;
12  private float cameraDistance;
13  private boolean clipToOutline;
14  private float elevation;
15  private boolean overlappingRendering;
16  private boolean pivotExplicitlySet;
17  private float pivotX;
18  private float pivotY;
19  private float rotation;
20  private float rotationX;
21  private float rotationY;
22  private float scaleX = 1f;
23  private float scaleY = 1f;
24  private float translationX;
25  private float translationY;
26  private float translationZ;
27
28  @Implementation
29  public boolean setAlpha(float alpha) {
30    this.alpha = alpha;
31    return true;
32  }
33
34  @Implementation
35  public float getAlpha() {
36    return alpha;
37  }
38
39  @Implementation
40  public boolean setCameraDistance(float cameraDistance) {
41    this.cameraDistance = cameraDistance;
42    return true;
43  }
44
45  @Implementation
46  public float getCameraDistance() {
47    return cameraDistance;
48  }
49
50  @Implementation
51  public boolean setClipToOutline(boolean clipToOutline) {
52    this.clipToOutline = clipToOutline;
53    return true;
54  }
55
56  @Implementation
57  public boolean getClipToOutline() {
58    return clipToOutline;
59  }
60
61  @Implementation
62  public boolean setElevation(float lift) {
63    elevation = lift;
64    return true;
65  }
66
67  @Implementation
68  public float getElevation() {
69    return elevation;
70  }
71
72  @Implementation
73  public boolean setHasOverlappingRendering(boolean overlappingRendering) {
74    this.overlappingRendering = overlappingRendering;
75    return true;
76  }
77
78  @Implementation
79  public boolean hasOverlappingRendering() {
80    return overlappingRendering;
81  }
82
83  @Implementation
84  public boolean setRotation(float rotation) {
85    this.rotation = rotation;
86    return true;
87  }
88
89  @Implementation
90  public float getRotation() {
91    return rotation;
92  }
93
94  @Implementation
95  public boolean setRotationX(float rotationX) {
96    this.rotationX = rotationX;
97    return true;
98  }
99
100  @Implementation
101  public float getRotationX() {
102    return rotationX;
103  }
104
105  @Implementation
106  public boolean setRotationY(float rotationY) {
107    this.rotationY = rotationY;
108    return true;
109  }
110
111  @Implementation
112  public float getRotationY() {
113    return rotationY;
114  }
115
116  @Implementation
117  public boolean setScaleX(float scaleX) {
118    this.scaleX = scaleX;
119    return true;
120  }
121
122  @Implementation
123  public float getScaleX() {
124    return scaleX;
125  }
126
127  @Implementation
128  public boolean setScaleY(float scaleY) {
129    this.scaleY = scaleY;
130    return true;
131  }
132
133  @Implementation
134  public float getScaleY() {
135    return scaleY;
136  }
137
138  @Implementation
139  public boolean setTranslationX(float translationX) {
140    this.translationX = translationX;
141    return true;
142  }
143
144  @Implementation
145  public boolean setTranslationY(float translationY) {
146    this.translationY = translationY;
147    return true;
148  }
149
150  @Implementation
151  public boolean setTranslationZ(float translationZ) {
152    this.translationZ = translationZ;
153    return true;
154  }
155
156  @Implementation
157  public float getTranslationX() {
158    return translationX;
159  }
160
161  @Implementation
162  public float getTranslationY() {
163    return translationY;
164  }
165
166  @Implementation
167  public float getTranslationZ() {
168    return translationZ;
169  }
170
171  @Implementation
172  public boolean isPivotExplicitlySet() {
173    return pivotExplicitlySet;
174  }
175
176  @Implementation
177  public boolean setPivotX(float pivotX) {
178    this.pivotX = pivotX;
179    this.pivotExplicitlySet = true;
180    return true;
181  }
182
183  @Implementation
184  public float getPivotX() {
185    return pivotX;
186  }
187
188  @Implementation
189  public boolean setPivotY(float pivotY) {
190    this.pivotY = pivotY;
191    this.pivotExplicitlySet = true;
192    return true;
193  }
194
195  @Implementation
196  public float getPivotY() {
197    return pivotY;
198  }
199}