Lines Matching refs:root

32     private ViewGroup root;
45 root = new FrameLayout(context);
53 root.addView(child1);
54 root.addView(child2);
55 root.addView(child3);
71 assertThat(root.getLayoutAnimationListener(), nullValue());
83 root.setLayoutAnimationListener(animationListener);
85 assertThat(root.getLayoutAnimationListener(), sameInstance(animationListener));
90 root.removeViewAt(1);
92 assertThat(root.getChildCount(), equalTo(2));
93 assertThat(root.getChildAt(0), sameInstance(child1));
94 assertThat(root.getChildAt(1), sameInstance((View) child3));
101 root.removeAllViews();
102 root.addView(child1);
103 root.addView(child2);
104 root.addView(child3, 1);
105 assertThat(root.getChildAt(0), sameInstance(child1));
106 assertThat(root.getChildAt(1), sameInstance((View) child3));
107 assertThat(root.getChildAt(2), sameInstance(child2));
112 root.removeAllViews();
116 root.addView(child1);
117 root.addView(child2);
118 root.addView(child3, 1);
119 assertThat(root.findViewWithTag("tag1"), sameInstance(child1));
120 assertThat(root.findViewWithTag("tag2"), sameInstance(child2));
121 assertThat((ViewGroup) root.findViewWithTag("tag3"), sameInstance(child3));
126 root.removeAllViews();
130 root.addView(child1);
131 root.addView(child2);
132 root.addView(child3, 1);
133 assertThat(root.findViewWithTag("tag21"), equalTo(null));
134 assertThat((ViewGroup) root.findViewWithTag("tag23"), equalTo(null));
139 root.removeAllViews();
143 root.addView(child1);
144 root.addView(child2);
145 root.addView(child3);
150 //can find views by tag from root
151 assertThat(root.findViewWithTag("tag1"), sameInstance(child1));
152 assertThat(root.findViewWithTag("tag2"), sameInstance(child2));
153 assertThat((ViewGroup) root.findViewWithTag("tag3"), sameInstance(child3));
173 assertFalse(root.hasFocus());
176 assertTrue(root.hasFocus());
179 assertFalse(root.hasFocus());
182 assertTrue(root.hasFocus());
185 assertFalse(root.hasFocus());
187 root.requestFocus();
188 assertTrue(root.hasFocus());
195 root.clearFocus();
199 assertFalse(root.hasFocus());
201 root.requestFocus();
202 root.clearFocus();
203 assertFalse(root.hasFocus());
210 assertSame(child3a, root.findFocus());
218 assertSame(child3, root.findFocus());
226 shadowOf(root).dump(new PrintStream(out), 0);
239 root.removeView(new View(context));
240 assertThat(root.getChildCount(), equalTo(3));
242 root.removeView(child2);
243 assertThat(root.getChildCount(), equalTo(2));
244 assertThat(root.getChildAt(0), sameInstance(child1));
245 assertThat(root.getChildAt(1), sameInstance((View) child3));
247 root.removeView(child2);
248 assertThat(root.getChildCount(), equalTo(2));
249 assertThat(root.getChildAt(0), sameInstance(child1));
250 assertThat(root.getChildAt(1), sameInstance((View) child3));
252 root.removeView(child1);
253 root.removeView(child3);
254 assertThat(root.getChildCount(), equalTo(0));
259 root.removeViewInLayout(new View(context));
260 assertThat(root.getChildCount(), equalTo(3));
262 root.removeViewInLayout(child2);
263 assertThat(root.getChildCount(), equalTo(2));
264 assertThat(root.getChildAt(0), sameInstance(child1));
265 assertThat(root.getChildAt(1), sameInstance((View) child3));
267 root.removeViewInLayout(child2);
268 assertThat(root.getChildCount(), equalTo(2));
269 assertThat(root.getChildAt(0), sameInstance(child1));
270 assertThat(root.getChildAt(1), sameInstance((View) child3));
272 root.removeViewInLayout(child1);
273 root.removeViewInLayout(child3);
274 assertThat(root.getChildCount(), equalTo(0));
279 root.removeViews(0, 0);
280 assertThat(root.getChildCount(), equalTo(3));
282 root.removeViews(2, 1);
283 assertThat(root.getChildCount(), equalTo(2));
284 assertThat(root.getChildAt(0), sameInstance(child1));
285 assertThat(root.getChildAt(1), sameInstance(child2));
287 root.removeViews(0, 1);
288 assertThat(root.getChildCount(), equalTo(1));
289 assertThat(root.getChildAt(0), sameInstance(child2));
291 root.removeViews(0, 1);
292 assertThat(root.getChildCount(), equalTo(0));
294 root.addView(child1);
295 root.addView(child2);
296 root.addView(child3);
298 root.removeViews(1, 1);
299 assertThat(root.getChildCount(), equalTo(2));
300 assertThat(root.getChildAt(0), sameInstance(child1));
301 assertThat(root.getChildAt(1), sameInstance((View) child3));
303 root.removeViews(0, 2);
304 assertThat(root.getChildCount(), equalTo(0));
309 root.removeViewsInLayout(0, 0);
310 assertThat(root.getChildCount(), equalTo(3));
312 root.removeViewsInLayout(2, 1);
313 assertThat(root.getChildCount(), equalTo(2));
314 assertThat(root.getChildAt(0), sameInstance(child1));
315 assertThat(root.getChildAt(1), sameInstance(child2));
317 root.removeViewsInLayout(0, 1);
318 assertThat(root.getChildCount(), equalTo(1));
319 assertThat(root.getChildAt(0), sameInstance(child2));
321 root.removeViewsInLayout(0, 1);
322 assertThat(root.getChildCount(), equalTo(0));
324 root.addView(child1);
325 root.addView(child2);
326 root.addView(child3);
328 root.removeViewsInLayout(1, 1);
329 assertThat(root.getChildCount(), equalTo(2));
330 assertThat(root.getChildAt(0), sameInstance(child1));
331 assertThat(root.getChildAt(1), sameInstance((View) child3));
333 root.removeViewsInLayout(0, 2);
334 assertThat(root.getChildCount(), equalTo(0));