LinearLayoutGridTestpublic class LinearLayoutGridTest extends android.test.SingleLaunchActivityTestCase Tests focus searching between buttons within a grid that are touching, for example,
two buttons next two each other would have the left button's right equal to the
right button's left. Same goes for top and bottom edges.
This exercises some edge cases of {@link android.view.FocusFinder}. |
Fields Summary |
---|
private android.view.ViewGroup | mRootView |
Constructors Summary |
---|
public LinearLayoutGridTest()
super("com.android.frameworktest", LinearLayoutGrid.class);
|
Methods Summary |
---|
protected void | setUp()
super.setUp();
mRootView = getActivity().getRootView();
| public void | testGoDownFromMiddle()
assertEquals(getActivity().getButtonAt(2, 1),
FocusFinder.getInstance().findNextFocus(
mRootView,
getActivity().getButtonAt(1, 1),
View.FOCUS_DOWN));
| public void | testGoLeftFromMiddle()
assertEquals(getActivity().getButtonAt(1, 0),
FocusFinder.getInstance().findNextFocus(
mRootView,
getActivity().getButtonAt(1, 1),
View.FOCUS_LEFT));
| public void | testGoRightFromMiddle()
assertEquals(getActivity().getButtonAt(1, 2),
FocusFinder.getInstance().findNextFocus(
mRootView,
getActivity().getButtonAt(1, 1),
View.FOCUS_RIGHT));
| public void | testGoUpFromMiddle()
assertEquals(getActivity().getButtonAt(0, 1),
FocusFinder.getInstance().findNextFocus(
mRootView,
getActivity().getButtonAt(1, 1),
View.FOCUS_UP));
|
|